I got ” ORA-19573: cannot obtain exclusive enqueue for datafile ” error in Oracle database.
ORA-19573: cannot obtain exclusive enqueue for datafile
Details of error are as follows.
ORA-19573: Cannot obtain %s enqueue for datafile. Cause: The file access enqueue could not be obtained for a file specified in a backup, copy or restore operation. If the enqueue type shown is 'shared', then the file is the input file for a backup or copy. If the type is 'exclusive', then the file is the output file for a datafile copy or restore which is attempting to overwrite the currently active version of that file - in this case, the file must be offline or the database must be closed. If the type is 'read-only', then you are attempting to back up or copy this file while the database is in NOARCHIVELOG mode. Action: Wait until the conflicting operation is complete, then retry the copy or backup. If the database is in NOARCHIVELOG mode, then all files being backed up must be closed cleanly.
When trying to restore standby database with incremental backups, its failing with below error even after MRP process is stopped on standby using sqlplus.
Please note this can also happen during any RMAN restore operation.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/08/2014 10:15:47
ORA-19870: error while restoring backup piece 8sp56ih5_1_1
ORA-19573: cannot obtain exclusive enqueue for datafile 1878
Cannot obtain %s enqueue for datafile
This ORA-19573 error is related with the file access enqueue could not be obtained for a file specified in a backup, copy or restore operation. If the enqueue type shown is ‘shared’, then the file is the input file for a backup or copy.
If the type is ‘exclusive’, then the file is the output file for a datafile copy or restore which is attempting to overwrite the currently active version of that file -in this case, the file must be offline or the database must be closed. If the type is ‘read-only’, then you are attempting to back up or copy this file while the database is in NOARCHIVELOG mode.
It was failing even though MRP was stopped using sqlplus on standby:
SQL> alter database recover managed standby database cancel;
Below query was NOT returning any rows:
SQL> select process,status,sequence#,thread# from gv$managed_standby where process like 'MRP%';
Dataguard Broker is configured for this environment and MRP was not stopped using dataguard broker.
To solve this error, Stop MRP using dataguard broker by running below command:
DGMGRL> edit database '<Standby db_unique_name>' set STATE='APPLY-OFF' ;
Then Retry the restore.
OR
You can stop the dataguard MRP process using the following command.
SQL> alter database recover managed standby database cancel;
Then you can continue to recover standby database with incremental backup using the following command.
RMAN> recover database noredo;
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )