- Intermittent ORA-12012, ORA-00054, ORA-06512 Errors During Auto Stats Job
- High CPU usage is observed
Snap Time Load %busy %user %sys %idle %iowait
14-Apr 22:15:55 18.66 95.52<======= 69.32 26.20 4.48 2.83
*** SERVICE NAME:(SYS$USERS) 2023-04-06 22:01:59.511
*** MODULE NAME:(DBMS_SCHEDULER) 2023-04-06 22:01:59.511
*** ACTION NAME:(ST$AUTO10778_99) 2023-04-06 22:01:59.511
*** CLIENT DRIVER:() 2023-04-06 22:01:59.511
ORA-12012: error on auto execute of job “SYS”.”ST$AUTO10778_99″
<error barrier> at 0xfffffffffff1970 placed
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
ORA-06512: at “SYS.DBMS_STATS”, line 40807
ORA-06512: at “SYS.DBMS_STATS”, line 40361
ORA-06512: at “SYS.DBMS_STATS”, line 40083
ORA-06512: at “SYS.DBMS_STATS”, line 38960
ORA-06512: at “SYS.DBMS_STATS”, line 17786
ORA-04022: nowait requested, but had to wait to lock dictionary object
ORA-06512: at “SYS.DBMS_STATS”, line 1800
ORA-06512: at “SYS.DBMS_STATS”, line 17545
ORA-06512: at “SYS.DBMS_STATS”, line 38910
ORA-06512: at “SYS.DBMS_STATS”, line 39786
ORA-06512: at “SYS.DBMS_STATS”, line 40344
ORA-06512: at “SYS.DBMS_STATS”, line 40780
ORA-06512: at line 1
- ‘concurrent’ option is enabled for statistics preference globally.
- Auto stats jobs wait on event ‘library cache lock’ to acquire dictionary object with nowait.
Blocking Sid (Inst) % Activity Event Caused % Event User Program # Samples Active XIDs
208,63039( 1) 1.13 library cache lock 1.13 SYS oracle (J017) 6/180 [ 3%] 0
- High cpu usage is observed and Resource manager throttles the cpu usage due to consumer group threshold.
Event Waits Total Wait Time (sec) Avg Wait % DB time Wait Class
resmgr:cpu quantum 22,817 4736,7 207.59ms 28.5 Scheduler
enq: TM – contention 502 3461,9 6896.28ms 20.8 Application
- Concurrent sessions compete to access the same object and wait for enq: TM – contention.
SQL ID Plan Hash Executions % Activity Event % Event Top Row Source % Row Source SQL Text
gkq5kmbqpm2rf 171 13.80 enq: TM – contention 13.80 ** Row Source Not Available ** 13.80 lock table wri$_optstat_histhe…
ft7wcqu3hzvca 3729177937 93 6.84 enq: TM – contention 6.72 LOAD TABLE CONVENTIONAL 6.72 insert /* QOSH:OPEN_COL_STATS …
Either add more resource to the database, if concurrent option is set.
or
Lock the table statistics sys.WRI$_OPTSTAT_HISTHEAD_HISTORY which gets failed with ora-00054 during the time of auto stats job and regather manual statistics with ‘FORCE=>TRUE’ to override the lock at a later time. Check the size and purging history for the table and reorg if needed.
EXEC dbms_stats.lock_table_stats(‘SYS’,’WRI$_OPTSTAT_HISTHEAD_HISTORY’);
or
Changing concurrent = ‘false’ solved the issue without deadlocks.
EXEC dbms_stats.set_global_prefs(‘concurrent’,’false’);