RMAN

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

Now, let’s see another run block. This time, it will succeed.

RMAN> run {
  shutdown immediate;
  startup mount;

  restore database to restore point before_converting;
  recover database to restore point before_converting;
  alter database open resetlogs;
}
2> 3> 4> 5> 6> 7>
database closed
database dismounted
Oracle instance shut down

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     838860800 bytes

Fixed Size                     2929936 bytes
Variable Size                562039536 bytes
Database Buffers             268435456 bytes
Redo Buffers                   5455872 bytes

Starting restore at 29-OCT-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK
...

Did you see the difference? I bounced the database to MOUNT state for further RMAN operations.

Leave a Reply

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