Dealing with the problem of Oracle11gADG standby database downtime caused by ORA-04021
Find the database alarm, check the alert log and find the following error
Errors in file / u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcl1_lgwr_26383.trc:
ORA-04021: timeout occurred while waiting to lock object
LGWR (ospid: 26383): terminating the instance due to error 4021
Sun Mar 25 03:29:07 2018
System state dump requested by (instance=1, osid=26383 (LGWR)), summary= [abnormal instance termination].
System State dumped to trace file / u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcle1_diag_26321_20180325032907.trc
Instance terminated by LGWR, pid = 26383
Sun Mar 25 03:29:20 2018
Starting ORACLE instance (normal)
First deal with the problem of DG database preparation, check the status to find that the database is MOUNT status, and start the database first.
SQL > alter database open
SQL > alter database recover managed standby database using current logfile disconnect
SQL > select open_mode from v$database
OPEN_MODE
READ ONLY WITH APPLY
Looking at the question again, MOS explains it as follows:
APPLIES TO:
Oracle Database-Enterprise Edition-Version 11.2.0.3 and later
Information in this document applies to any platform.
SYMPTOMS
DR database crashed with below errors..
Client address: (ADDRESS= (PROTOCOL=tcp) (HOST=XX.XXX.XXX.XX) (PORT=54537))
WARNING: inbound connection timed out (ORA-3136)
Wed Jul 13 13:43:24 2016
Errors in file / u01/app/oracle/diag/rdbms/rxeprr_dr/RXEPRR1/trace/RXEPRR1_lgwr_31312.trc:
ORA-04021: timeout occurred while waiting to lock object
LGWR (ospid: 31312): terminating the instance due to error 4021
Wed Jul 13 13:43:24 2016
System state dump requested by (instance=1, osid=31312 (LGWR)), summary= [abnormal instance termination].
System State dumped to trace file / u01/app/oracle/diag/rdbms/rxeprr_dr/RXEPRR1/trace/RXEPRR1_diag_31221.trc
Wed Jul 13 13:43:25 2016
License high water mark = 318
Instance terminated by LGWR, pid = 31312
USER (ospid: 20898): terminating the instance
Instance terminated by USER, pid = 20898
Wed Jul 13 13:43:39 2016
Starting ORACLE instance (normal)
CHANGES
No changes
CAUSE
Bug 16717701-ADG SHOULD GET THE INSTANCE PARSE LOCK WITH A TIMEOUT
Bug 11712267-ACTIVE DATA GUARD DATABASE HUNG ON 'LIBRARY CACHE: MUTEX X' WAIT EVENT
LGWR trace file (RXEPRR1_lgwr_31312.trc)
2016-07-13 13 14 14 43 24 498
SESSION ID: (6709.1) 2016-07-13 1315 4315 24.498
CLIENT ID: () 2016-07-13 13 1315 4315 24.498
SERVICE NAME: (SYS$BACKGROUND) 2016-07-13 13 43 purl 24.498
MODULE NAME: () 2016-07-13 13 1315 4315 24.498
ACTION NAME: () 2016-07-13 13 1315 4315 24.498
Error 4021 detected in background process
ORA-04021: timeout occurred while waiting to lock object
Kjzduptcctx: Notifying DIAG for crash event
-Abridged Call Stack Trace-
Ksedsts () + 1296