Wednesday 29 March 2023

Resolving RMAN-06023 or RMAN-06025 (Doc ID 2038119.1)

 

SYMPTOMS

 You are receiving error:

RMAN-06025: no backup of archived log for thread 1 with sequence 19684 and starting SCN of 1483914453 found to restore

OR

RMAN-06023: no backup or copy of datafile 4 found to restore

CHANGES

 

CAUSE

 These errors are returned by RMAN when it is unable to identify a backup of either an archivelog file (RMAN-06025) or datafile (RMAN-06023)

SOLUTION

1.  Connected with RMAN to the instance in which you are running the restore (or the target when running an RMAN duplicate) and issue:

For RMAN-06025: no backup of archived log.......

RMAN>  list backup of archivelog sequence <sequence# returned by error>;

For example:

RMAN>  list backup of archivelog sequence 19684;

 

NOTE:  If the sequence is older than you expect, check for offline and/or READ ONLY tablespaces.  If RMAN is requesting an archivelog for such datafiles, you may have to add a 'skip' to the recover command or recover by tablespace.   

For RMAN-06023: no backup or copy of datafile ......

RMAN>  list backup of datafile <number returned by the error>;

For example:

RMAN>  list backup of datafile 4;

2.  If no backups are returned:

a.  Check if the you should be connecting to a catalog.

b.  If no catalog is used, you may need to catalog the backups contining the file (archivelog or datafile).  To do this, execute:

RMAN>  catalog start with '/location of backup/' noprompt;

If backups are on tape, see:

Note 550082.1 How to Catalog Tape Backup Pieces

c.  Consider restoring a controlfile which contains the backup information.

3.  If RMAN returns backup information:

a.  Check that the backup's status is available.  

For example:

RMAN> list backup of datafile 4;


List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
291 Full 1.06G DISK 00:00:15 27-JUL-15
BP Key: 292 Status: AVAILABLE Compressed: NO Tag: TAG20150727T144532
Piece Name: <backuppiece path</<backuppiece name>  

b.  for datafiles, check that the datafile's Ckp SCN/Ckp Time in the backup is before the until specified by the restore/duplicate:

For example:

RMAN> list backup of datafile 4;

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
291 Full 1.06G DISK 00:00:15 27-JUL-2015 14:45:47
BP Key: 292 Status: AVAILABLE Compressed: NO Tag: TAG20150727T144532
Piece Name: <backuppiece path</<backuppiece name>
List of Datafiles in backup set 291


File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- -------------------- ----
4 Full 59195530 27-JUL-2015 14:45:32 <db file path>/<db file name>  

In this example, this backup cannot be used for an 'until' earlier than 59195530, the checkpoint of the file in the backup.

c.  Check if the backup lists an absolute fuzzy SCN, this SCN must be from before the until specified by the restore/duplicate.

For example:

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
169 Full 31.62M DISK 00:00:00 10-MAR-21
BP Key: 169 Status: AVAILABLE Compressed: NO Tag: TAG20220510T215929
Piece Name: /<backup_path>/bk_ORCL1930_20220510_219_1
List of Datafiles in backup set 169
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
---- -- ---- ---------- --------- ----------- ------ ----
4 Full 25156161 10-MAR-21 25156178 NO /<path>/users01.dbf

In this example, this backup cannot be used for an 'until' earlier than 25156178 although the checkpoint is 25156161.

d.  check that the backup you expect to be used is within the CURRENT incarnation.

For example:

RMAN> list incarnation;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 <db name> 82280094 PARENT 1 19-JUN-2015 10:31:58
2 2 <db name> 82280094 CURRENT 59448598 29-JUL-2015 12:45:27

  

In this case, we clearly see that the backup from 27-JUL-2015 was not taken in the CURRENT incarnation, Reset Time=29-JUL-2015.  To restore the backup of datafile 4, the incarnation must be reset.

For example:

RMAN> reset database to incarnation 1;

database reset to incarnation 1

RMAN> list incarnation;

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 <db name> 82280094 CURRENT 1 19-JUN-2015 10:31:58
2 2 <db name> 82280094 ORPHAN 59448598 29-JUL-2015 12:45:27

No comments:

Post a Comment