Skip to content

RMAN restore Error

scenario : database is up and running and want to restore from last backup and some of the archive log missing on disk.

  • crosscheck backup

rman target / catalog rman@rman

RMAN> crosscheck backup;

RMAN> crosscheck archivelog all;

RMAN> delete expired archivelog all;

RMAN> restore archivelog all;

Now this error happen when we do restore from backup

  • RMAN-06023  RMAN-06026 ORA-19870 ORA-45909 ORA-19573

RMAN> restore database until time = “to_date(‘2019-03-26:15:55.05′,’yyyy-mm-dd:hh24:mi:ss’)”;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/04/2019 14:51:07
RMAN-06026: some targets not found – aborting restore
RMAN-06023: no backup or copy of datafile 21 found to restore
RMAN-06023: no backup or copy of datafile 20 found to restore

RMAN> restore database until time = “to_date(‘2019-03-26:16:55.05′,’yyyy-mm-dd:hh24:mi:ss’)”;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/04/2019 14:52:51
ORA-19870: error while restoring backup piece +ORAFRA1/7D13CEC4F82A013AE0530A0289C306A0/BACKUPSET/2019_03_26/nnndn0_tag20190326t154250_0.619.1003938175
ORA-19573: cannot obtain exclusive enqueue for datafile 22
ORA-45909: restore, recover or block media recovery may be in progress

  • start database in mount mode and try again restore

sqlplus / as sysdba

SQL> startup mount;

-bash-4.2$ rman target / catalog rman@rman

RMAN> restore database until time = “to_date(‘2019-03-26:16:55.05′,’yyyy-mm-dd:hh24:mi:ss’)”;

channel ORA_DISK_3: restored backup piece 6
channel ORA_DISK_3: restore complete, elapsed time: 00:07:16
Finished restore at 04.04.2019 15:04:39

  • recover until time or available redo (12.2 new feature)

RMAN> recover database until time = “to_date(‘2019-03-26:16:55.05′,’yyyy-mm-dd:hh24:mi:ss’)”;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/04/2019 15:07:22
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 206 and starting SCN of 2130899998541

RMAN> recover database until available redo;

Starting recover at 04.04.2019 15:25:59
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
using channel ORA_SBT_TAPE_3
using channel ORA_SBT_TAPE_4

starting media recovery

warning: attempt media recovery until thread 1, sequence 206
Finished recover at 04.04.2019 15:26:04

RMAN> alter database open resetlogs;

Statement processed
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

  • bounce the database with srvctl or sqlplus 

srvctl stop database -d abc -o immediate;

srvctl start database -d abc;

 

 

 

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: