ORA-00604: error occurred at recursive SQL level 1 ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select count(*) from sys.job...","sql area","tmp") Mon Nov 2 11:43:00 2015 Errors in file /u01/app/oracle/admin/SCM2/bdump/scm2_cjq0_6571.trc: ORA-00604: error occurred at recursive SQL level 1 ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select job, nvl2(last_date, ...","sql area","tmp") Mon Nov 2 11:43:00 2015 Errors in file /u01/app/oracle/admin/SCM2/bdump/scm2_cjq0_6571.trc: ORA-00604: error occurred at recursive SQL level 1 ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select count(*) from sys.job...","sql area","tmp") Mon Nov 2 11:43:05 2015 Errors in file /u01/app/oracle/admin/SCM2/bdump/scm2_cjq0_6571.trc: ORA-00604: error occurred at recursive SQL level 1 ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select job, nvl2(last_date, ...","sql area","tmp") Mon Nov 2 11:43:05 2015 Errors in file /u01/app/oracle/admin/SCM2/bdump/scm2_cjq0_6571.trc: ORA-00604: error occurred at recursive SQL level 1 ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select count(*) from sys.job...","sql area","tmp") Mon Nov 2 11:43:08 2015 Errors in file /u01/app/oracle/admin/SCM2/bdump/scm2_reco_6569.trc: ORA-04031: unable to allocate 32 bytes of shared memory ("shared pool","select host,userid,password,...","sql area","tmp") Mon Nov 2 11:43:08 2015 RECO: terminating instance due to error 4031 Mon Nov 2 11:43:08 2015 Errors in file /u01/app/oracle/admin/SCM2/bdump/scm2_pmon_6555.trc: ORA-04031: unable to allocate bytes of shared memory ("","","","") Instance terminated by RECO, pid = 6569
SO: 0xa617d9c0, type: 4, owner: 0xa8a26c68, flag: INIT/-/-/0x00 (session) sid: 932 trans: (nil), creator: 0xa8a26c68, flag: (51) USR/- BSY/-/-/-/-/- DID: 0001-000A-00000003, short-term DID: 0000-0000-00000000 txn branch: (nil) oct: 0, prv: 0, sql: (nil), psql: (nil), user: 0/SYS last wait for 'SGA: allocation forcing component growth' blocking sess=0x(nil) seq=51324 wait_time=10714 seconds since wait started=0 =0, =0, =0 Dumping Session Wait History for 'SGA: allocation forcing component growth' count=1 wait_time=10714 =0, =0, =0 for 'SGA: allocation forcing component growth' count=1 wait_time=10512 =0, =0, =0 for 'latch: shared pool' count=1 wait_time=892 address=600e7320, number=d6, tries=0 for 'latch: shared pool' count=1 wait_time=28 address=600e7320, number=d6, tries=0 for 'latch: shared pool' count=1 wait_time=51 address=600e7320, number=d6, tries=0 for 'latch: shared pool' count=1 wait_time=114 address=600e7320, number=d6, tries=0 for 'latch: shared pool' count=1 wait_time=120 address=600e7320, number=d6, tries=0 for 'latch: library cache' count=1 wait_time=33 address=a3fa46e8, number=d7, tries=1
SELECT start_time, component, oper_type, oper_mode, initial_size / 1024 / 1024 "INITIAL", final_size / 1024 / 1024 "FINAL", end_time FROM v$sga_resize_ops WHERE component IN ( 'DEFAULT buffer cache', 'shared pool' ) AND status = 'COMPLETE' ORDER BY start_time, component;
這個可以通過設置數據庫參數SHARED_POOL_SIZE,保證SHARED_POOL_SIZE大小不會由於內存緊張而低於這個大小,另外可以設置SGA resize的時間間隔 ALTER SYSTEM SET “_memory_broker_stat_interval”=n SCOPE=SPFILE; 問題雖然解決了,但是真正需要反思的是為什麼這個SGA_MAX_SIZE設置為1168M大小的事情!而且沒有在巡檢當中被發現。