Last night I prepared one restore guide for a friend, and I found when I restored the full database, I always got below error:
- creating datafile file number=1 name=+DATA/ORATEST/datafile/system01.dbf
- released channel: d1
- released channel: d2
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of restore command at 05/05/2017 00:59:49
- ORA-01180: can not create datafile 1
- ORA-01110: data file 1: '/oradata/ora11g/system01.dbf'
I already set new name for the system data file, while what the new name was, I always got this error.
It was weird that I had been restored databases many many times, and I double checked the restore statements to make sure they were correct.
I did not found way to fix it and until the next day I realized maybe I made one simple mistake and caused this issue. From Oracle support webiste, I found a reply said that Oracle would do similar thing when there was no backup of the datafile, so the reason was that there was no backup for the database?
- RMAN> list backup of database;
- specification does not match any backup in the repository
- RMAN> catalog start with '/oradata/oraback';
- searching for all files that match the pattern /oradata/oraback
- List of Files Unknown to the Database
- =====================================
- File Name: /oradata/oraback/ORA11G_20170504_7_1_07s3c3bo.ctl
- File Name: /oradata/oraback/ora11g_full.log
- File Name: /oradata/oraback/ORA11G_20170504_3_1_03s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_8_1_08s3c3bp.ora
- File Name: /oradata/oraback/ORA11G_20170504_5_1_05s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_4_1_04s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_6_1_06s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_9_1_09s3c3c0.arc
- Do you really want to catalog the above files (enter YES or NO)? YES
- cataloging files...
- cataloging done
- List of Cataloged Files
- =======================
- File Name: /oradata/oraback/ORA11G_20170504_7_1_07s3c3bo.ctl
- File Name: /oradata/oraback/ORA11G_20170504_3_1_03s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_8_1_08s3c3bp.ora
- File Name: /oradata/oraback/ORA11G_20170504_5_1_05s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_4_1_04s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_6_1_06s3c3bm.ctl
- File Name: /oradata/oraback/ORA11G_20170504_9_1_09s3c3c0.arc
- List of Files Which Where Not Cataloged
- =======================================
- File Name: /oradata/oraback/ora11g_full.log
- RMAN-07517: Reason: The file header is corrupted
Then I restored it again and it worked well.
So, why I did catalog the backup first?
- [oracle@olinux69 oradata]$ rman target / log='/oradata/oraback/ora11g_full.log' <<EOF
- > run {
- > allocate channel d1 type disk;
- > allocate channel d2 type disk;
- > allocate channel d3 type disk;
- > allocate channel d4 type disk;
- > backup AS COMPRESSED BACKUPSET INCREMENTAL LEVEL = 0 database
- > format '/oradata/oraback/full_%d_%T_%s_%p_%u.bak' tag 'full_backup'
- > include current controlfile
- > format '/oradata/oraback/%d_%T_%s_%p_%u.ctl' tag 'ctl_backup'
- > plus archivelog SKIP INACCESSIBLE
- > format '/oradata/oraback/%d_%T_%s_%p_%u.arc' tag 'arc_backup'
- > delete all input;
- > release channel d4;
- > release channel d3;
- > release channel d2;
- > release channel d1;
- > }
- > EOF
I made the backup both database and controlfile at the same time, and I though the contofile should already have the backup information, and the restore was on the same server, so I made such assumption.
So if I double checked the backup information, I could finish the restore in several minutes.
And how to backup them both and the control file will contain the backup information? Is it possible?