How to import a Oracle 11g RMAN backupset on a new database server?
I have got a backupset of an Oracle 11g database which was created with RMAN. Now I want to import/restore th开发者_StackOverflow社区e backupset onto a new and empty database server. I know that the command to create the backupset was
run {
backup as compressed backupset database
tag "FULLBACKUP"
format "/orabackup/rman/backup/FULL_%d_%T_%U";
backup as compressed backupset archivelog all
tag "ARCHIVELOGS"
format "/orabackup/rman/backup/ARCH_%d_%T_%U"
delete all input;
}
but I cannot find out how to make the files produced by this command known to RMAN on my new database server and import the backupset using RESTORE/RECOVER.
I never used this tool, but i google a few minutes any maybe this will help you...
Direct Link: RMAP Import
Here is the script I use to restore the database from the backup, (I always clean up the database before restoring it.) * Startup nomout; * Set dbid xxxxxxxx // This is the dbid of your database * Run { Set controlfile autobackup format for device type disk to ''; // e.g. '/ora101/oradata/TAR/%F' Restore controlfile from autobackup; } * Alter database mount; // can't restore without the database mounted * Restore database; // can't run recover without first restore * Recover database; // if the backup was from incremental, RMAN will try to apply all the logfiles generated after the backup was started. * Alter database open resetlogs;
// EDIT: Here is another link from the OraFaq.
One other method to use is to restore the control file(s) from a backup.
Startup no mount;
run { allocate channel device type disk; restore from '/u01/......'; }
At this point i would shutdown and startup mount. (Make sure the pfile/spfile have the correct entries for the controlfile names and location)
once in mount mode enter the command
catalog start with '/u01/.....' (The controlfile backup should be a good place to start)
You will be asked if you want to add the information from the file. Also this can be repeated for any backuppiece you have.
Now if you do a list backups you should see all the items from you orignal rman backup and then start the process of restoring/recovering the database.
Disclaimer: The commands are taken from memory so the syntax might not be 100% correct but a quick google of it should put you on the right track.
EDIT:
To get the datafiles to be renamed you migh find this command useful. It puts data files into ASM but you should be able to go the other way by replacing the +DATA with the correct datafile name and location
run {
set newname for datafile 1 to "+DATA";
set newname for datafile 2 to "+DATA";
set newname for datafile 3 to "+DATA";
set newname for datafile 4 to "+DATA";
set newname for datafile 5 to "+DATA";
restore database;
switch datafile all;
recover database
}
精彩评论