Skip to content
Home » Oracle » How to Resolve ORA-19573: cannot obtain exclusive enqueue for datafile 1

How to Resolve ORA-19573: cannot obtain exclusive enqueue for datafile 1

ORA-19573

It's pretty easy to reproduce ORA-19573 because the solution is pretty easy, too.

In this post, I will show you two run blocks on execution of RMAN in order to let you tell the difference which is the root cause of the error.

Let's see the first run block which intends to restore the database to a restore point. Unfortunately, it failed with ORA-19573.

[oracle@test ~]$ rman target /
...
RMAN> run {
  restore database to restore point before_converting;
  recover database to restore point before_converting;
  alter database open resetlogs;
}
2> 3> 4> 5>
Starting restore at 29-OCT-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=103 device type=DISK
...
ORA-19870: error while restoring backup piece ...
ORA-19573: cannot obtain exclusive enqueue for datafile 1

We saw there's an error ORA-19873 in the last line, which caused the execution interrupted.

Solution

This is because some recovery process is still running on the database, which conflicts with your restoring job. Most likely, it's a managed recovery process (MRP), also known as apply services.

That is to say, you should stop MRP process before doing it. To stop apply services, you may take one of the following action.

With Broker

DGMGRL> edit database ORCLSTB set state='APPLY-OFF';
Succeeded.

Without Broker

sqL> alter database recover managed standby database cancel;

Database altered.

Cancelling MRP on the standby side may not be enough, you should consider to stop data guard service completely.

In some other cases, you may see this error when you want to perform multiple RMAN tasks at the same time.

6 thoughts on “How to Resolve ORA-19573: cannot obtain exclusive enqueue for datafile 1”

  1. This error happens if another recovery process is running.
    Eg: if you are trying to rollforward an out of sync standby database and you fire rman restore, you may receive above error, Check your MRP is running and stop it , then try to run rman restore.

  2. in my case, below did not say recovery was active. but even then it failed.
    alter database recover managed standby database cancel;
    below command was showing no rows selected but it was failing even then.
    select process,status,sequence#,thread# from gv$managed_standby where process like ‘MRP%’;

    Then i did below at DGMGRL level and then restore was successful.
    DGMGRL> edit database ” set STATE=’APPLY-OFF’ ;

Leave a Reply

Your email address will not be published. Required fields are marked *