修改了oracle的sga大小以後,遇到了一系列的報錯。數據庫
00844和00851報錯oracle
SQL> startup; ORA-00844: Parameter not taking MEMORY_TARGET into account ORA-00851: SGA_MAX_SIZE 2147483648 cannot be set to more than MEM SQL>
01078報錯app
SQL> startup; ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.4/db_1/dbs/inittest.ora'
在測試的時候,插入大量數據發現30009錯誤,我覺得是sga小致使的ide
SQL> insert into t select rownum from dual connect by level<=10000000; insert into t select rownum from dual connect by level<=10000000 * ERROR at line 1: ORA-30009: Not enough memory for CONNECT BY operation Elapsed: 00:00:13.51 SQL>
查看sga測試
SQL> show parameter sga; NAME TYPE VALUE ------------------------------------ --------------------------------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 1584M sga_target big integer 1G SQL>
查看pgacode
SQL> show parameter pga NAME TYPE VALUE ------------------------------------ --------------------------------- ------------------------------ pga_aggregate_target big integer 0 SQL>
更改sga內存
SQL> alter system set sga_max_size=2048M scope=spfile; System altered. Elapsed: 00:00:00.06 SQL>
關閉和啓動數據庫get
SQL> shutdown Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> startup ORA-00844: Parameter not taking MEMORY_TARGET into account ORA-00851: SGA_MAX_SIZE 2147483648 cannot be set to more than MEMORY_TARGET 1660944384.
結果出錯了。通過查找資料,發現11g
新增了個參數MEMORY_TARGET
,其大小等於PGA+SGA
,當sga
的大小大於MEMORY_TARGET
就會報如上錯誤。it
查看MEMORY_TARGET
大小,發現大小爲1584M,與sga不符。io
SQL> show parameter memory_target; NAME TYPE VALUE ------------------------------------ --------------------------------- ------------------------------ memory_target big integer 1584M SQL>
修改spfile
文件中的參數
sga_max_size=1653604352
啓動數據庫
SQL> startup nomount; ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.4/db_1/dbs/inittest.ora' SQL>
啓動後遇到了01078
報錯。解決辦法以下:
將test
(實例名)文件夾下的init.ora.xxx
文件複製到dbs
目錄下便可,複製後的名字按照以前報錯的提示輸入。
[oracle@localhost ~]$ cp /u01/app/oracle/admin/test/pfile/init.ora.922018114616 /u01/app/oracle/product/11.2.4/db_1/dbs/inittest.ora
啓動數據庫
SQL> startup; ORACLE instance started. Total System Global Area 1653518336 bytes Fixed Size 2213896 bytes Variable Size 956303352 bytes Database Buffers 687865856 bytes Redo Buffers 7135232 bytes Database mounted. Database opened. SQL>
歸根結底仍是對數據庫原理不熟致使的,牢記memory_target
值需爲sga+pga
內存的和。