您好,登錄后才能下訂單哦!
修改了oracle的sga大小之后,遇到了一系列的報錯。
00844和00851報錯
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報錯
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小導致的
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>
查看pga
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>
關閉和啟動數據庫
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
就會報如上錯誤。
查看MEMORY_TARGET
大小,發現大小為1584M,與sga不符。
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
內存的和。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。