RMAN catalog command tips | To restore the oracle database using rman , first of all we have to Cataloging
RMAN backup in RMAN Catalog.
There are many rman catalog commands
to register the rman catalog
backup piece to new location, so that rman read the backup piece and
restore them. Below are some RMAN CATALOG command example.
#Catalog as Backuppiece in RMAN repository:-
If you wiil execute 'CATALOG BACKUPPIECE' backup will cataloged by piece. We have to run the CATALOG BACKUPPIECE command for every Backuppiece from different location so that rman register old backupset. Once all Backup piece will cataloged , start restoration oracle database.
RMAN> CATALOG BACKUPPIECE '/DATA01/BACKUP/PROD_2123.BKP';
#Catalog as Whole bakuppiece in RMAN repository:-
Here RMAN CATALOG START WITH command,will catalog all backup piece in single execution. Here no need to run one by one, it will cataloged all backup piece, once we will run CATALOG BACKUPPIECE with exact Backup location.
RMAN> CATALOG START WITH '/DATA01/BACKUP/';
using target database control file instead of recovery catalog
List of Files Unknown to the Database
File Name: /DATA01/BACKUP/DB_1_20180904_22226.rbkp
Do you really want to catalog the above files (enter YES or NO)? YES
#Catalog archive log in RMAN repository.
RMAN> CATALOG ARCHIVELOG '/oradata/archive/archive_100.dbf','/oradata/archive/archive_101.dbf';
#Catalog data filecopy in RMAN repository.
RMAN> CATALOG DATAFILECOPY '/oradata/datafile/users01.dbf' LEVEL 0;
#Catalog user managed controlfile copy in RMAN repository.
SQL> alter database backup controlfile as '/tmp/control01.ctl';
RMAN> CATALOG controlfilecopy '/tmp/control01.ctl';
#Catalog file in Flash Recovery Area and Recovery file destination in RMAN repository.
RMAN> CATALOG RECOVERY AREA NOPROMPT;
RMAN> CATALOG DB_RECOVERY_FILE_DEST;
#Catalog as Backuppiece in RMAN repository:-
If you wiil execute 'CATALOG BACKUPPIECE' backup will cataloged by piece. We have to run the CATALOG BACKUPPIECE command for every Backuppiece from different location so that rman register old backupset. Once all Backup piece will cataloged , start restoration oracle database.
RMAN> CATALOG BACKUPPIECE '/DATA01/BACKUP/PROD_2123.BKP';
#Catalog as Whole bakuppiece in RMAN repository:-
Here RMAN CATALOG START WITH command,will catalog all backup piece in single execution. Here no need to run one by one, it will cataloged all backup piece, once we will run CATALOG BACKUPPIECE with exact Backup location.
RMAN> CATALOG START WITH '/DATA01/BACKUP/';
using target database control file instead of recovery catalog
searching for all files that
match the pattern /DATA01/BACKUP/
List of Files Unknown to the Database
=====================================
File Name: /DATA01/BACKUP/DB_1_20180904_22226.rbkp
File Name:
/DATA01/BACKUP/DB_1_20180904_22224.rbkp
File Name:
/DATA01/BACKUP/DB_1_20180904_22212.rbkp
File Name: /DATA01/BACKUP/DB_1_20180904_22211.rbkp
File Name:
/DATA01/BACKUP/DB_1_20180904_22205.rbkp
File Name:
/DATA01/BACKUP/DB_1_20180904_22219.rbkp
File Name:
/DATA01/BACKUP/DB_1_20180904_22213.rbkp
File Name:
/DATA01/BACKUP/CNT_1_20180904_22238.rbkp
File Name: /DATA01/BACKUP/DB_1_20180904_22229.rbkp
File Name:
/DATA01/BACKUP/DB_1_20180904_22225.rbkp
Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done
Now we have ‘catalog backup piece from disk ‘ , Need to do the restoration steps.
#Catalog archive log in RMAN repository.
RMAN> CATALOG ARCHIVELOG '/oradata/archive/archive_100.dbf','/oradata/archive/archive_101.dbf';
#Catalog data filecopy in RMAN repository.
RMAN> CATALOG DATAFILECOPY '/oradata/datafile/users01.dbf' LEVEL 0;
#Catalog user managed controlfile copy in RMAN repository.
SQL> alter database backup controlfile as '/tmp/control01.ctl';
RMAN> CATALOG controlfilecopy '/tmp/control01.ctl';
#Catalog file in Flash Recovery Area and Recovery file destination in RMAN repository.
RMAN> CATALOG RECOVERY AREA NOPROMPT;
RMAN> CATALOG DB_RECOVERY_FILE_DEST;
No comments:
Post a Comment
Thanks for reading till end. I hope this will help you more to improve your knowledge.
Now it's your turn!
What do you think? Share your experience in the comments box and subscribe for more interesting post.