RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece
I was trying to restore a controlfile during database restore. But i get the error message saying that controlfile didnot exist on the database. But in rman, the details were still reflecting
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21 Full 13.20M DISK 00:00:01 20-DEC-20
BP Key: 21 Status: AVAILABLE Compressed: NO Tag: TAG20201220T221709
Piece Name: /data01/FRA/ORCL19X1/autobackup/2020_12_20/o1_mf_s_1059689829_hxz00gdt_.bkp
Control File Included: Ckp SCN: 9084890 Ckp time: 20-DEC-20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
22 Full 13.20M DISK 00:00:01 13-JAN-21
BP Key: 22 Status: AVAILABLE Compressed: NO Tag: TAG20210113T163857
Piece Name: /data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp
Control File Included: Ckp SCN: 13919030 Ckp time: 13-JAN-21
I face the error below during restore
RMAN> restore controlfile from '/data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp';
Starting restore at 27-JUL-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=427 device type=DISK
channel ORA_DISK_1: no AUTOBACKUP in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/27/2021 23:03:44
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece
RMAN> exit
I couldnot find the backup piece on the disk anymore which is why rman was throwing the error
[oracle@orcl19x ~]$ ls -lrt /data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp
ls: cannot access /data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp: No such file or directory
I crosschecked the backup available and could find that the backuppieces were expired. This means that the files are no longer available on the disk to restore.
RMAN> crosscheck backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=427 device type=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_nnnd0_TAG20201220T221356_hxyztglx_.bkp RECID=17 STAMP=1059689638
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_nnnd0_TAG20201220T221356_hxyztgmc_.bkp RECID=18 STAMP=1059689638
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_annnn_TAG20201220T221704_hxz008cn_.bkp RECID=19 STAMP=1059689824
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/data01/FRA/ORCL19X1/autobackup/2020_12_20/o1_mf_s_1059689829_hxz00gdt_.bkp RECID=21 STAMP=1059689830
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp RECID=22 STAMP=1061743138
Crosschecked 5 objects
We can delete the expired backup to clean the expired rman entry in current controlfile
RMAN> delete expired backup;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
17 17 1 1 EXPIRED DISK /data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_nnnd0_TAG20201220T221356_hxyztglx_.bkp
18 18 1 1 EXPIRED DISK /data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_nnnd0_TAG20201220T221356_hxyztgmc_.bkp
19 19 1 1 EXPIRED DISK /data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_annnn_TAG20201220T221704_hxz008cn_.bkp
21 21 1 1 EXPIRED DISK /data01/FRA/ORCL19X1/autobackup/2020_12_20/o1_mf_s_1059689829_hxz00gdt_.bkp
22 22 1 1 EXPIRED DISK /data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_nnnd0_TAG20201220T221356_hxyztglx_.bkp RECID=17 STAMP=1059689638
deleted backup piece
backup piece handle=/data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_nnnd0_TAG20201220T221356_hxyztgmc_.bkp RECID=18 STAMP=1059689638
deleted backup piece
backup piece handle=/data01/FRA/ORCL19X1/backupset/2020_12_20/o1_mf_annnn_TAG20201220T221704_hxz008cn_.bkp RECID=19 STAMP=1059689824
deleted backup piece
backup piece handle=/data01/FRA/ORCL19X1/autobackup/2020_12_20/o1_mf_s_1059689829_hxz00gdt_.bkp RECID=21 STAMP=1059689830
deleted backup piece
backup piece handle=/data01/FRA/ORCL19X1/autobackup/2021_01_13/o1_mf_s_1061743135_hzxo6bgc_.bkp RECID=22 STAMP=1061743138
Deleted 5 EXPIRED objects