Skip to content
Home » Oracle » How to Resolve RMAN-06023: no backup or copy of datafile found to restore

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

RMAN-06026 and RMAN-06023

There're 2 error patterns of RMAN-06023 and RMAN-06026 in this post.

  1. Target Not Found in Backup
  2. Missing Directory in ASM

Target Not Found in Backup

When we tried to restore some data files from a backup set, we saw errors like the followings.

RMAN> restore datafile 14 from tag 'TAG20220103T231621';
...
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 14 found to restore

The could happened when the data file is newly added and created after the backup completed.

To solve it, we take the following steps.

List Backup of Datafile

We should check in which backups contain the data file.

RMAN> list backup of datafile 14;

Then choose one of the backup sets to restore your targets.

If nothing is returned, it means that the data file has not ever been backed up, or backup sets are not in the backup record. Let's move on.

Catalog Start With

Chances are, some backups had ever been removed from the backup record in the past, or the controlfile forgot those backup sets for some reason.

To get them back, we need to make them join to the backup record again. For example:

RMAN> catalog start with '/backup2/rman';

Lost backups are now cataloged.

Basically, RMAN-06023 means that the target you want to restore does not exist in the backup, but there's a case related to ASM, which seems irrelevant to missing target in backup, it just need a destination to be created in ASM.

Next, let's see the case.

Missing Directory in ASM

Found errors RMAN-06026 and RMAN-06023 after several hours of database restore.

RMAN> restore database;
...
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/16/2021 22:07:53
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 8 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore

After doing some investigations, I found those data files all belong to pdbseed. The big hint reminded me that I forgot to create the directory for pdbseed in ASM.

To solve it, we take the following steps.

Make a Directory

So the solution is simple, just like I did in How to Resolve ORA-15173, I make a directory for the target PDB pdbseed.

[grid@primary01 ~]$ asmcmd mkdir +DATA/ORCLCDB/pdbseed

Restore Datafiles

RMAN> restore datafile 5, 6, 8;

Now we can safely recover the database.

2 thoughts on “How to Resolve RMAN-06023: no backup or copy of datafile found to restore”

Leave a Reply

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