如何在新数据库服务器上导入 Oracle 11g RMAN 备份集?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4213522/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to import a Oracle 11g RMAN backupset on a new database server?
提问by blerontin
I have got a backupset of an Oracle 11g database which was created with RMAN. Now I want to import/restore the backupset onto a new and empty database server. I know that the command to create the backupset was
我有一个用 RMAN 创建的 Oracle 11g 数据库的备份集。现在我想将备份集导入/恢复到新的空数据库服务器上。我知道创建备份集的命令是
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.
但我不知道如何让我的新数据库服务器上的 RMAN 知道此命令生成的文件并使用 RESTORE/RECOVER 导入备份集。
采纳答案by Viper
I never used this tool, but i google a few minutes any maybe this will help you...
我从来没有用过这个工具,但我谷歌了几分钟,也许这会对你有所帮助......
Direct Link: RMAP Import
直接链接:RMAP 导入
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.
// 编辑:这是来自OraFaq 的另一个链接。
回答by GrumpyMonkey
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/......'; }
运行{分配通道设备类型磁盘;从'/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)
在这一点上,我会关闭并启动挂载。(确保 pfile/spfile 具有正确的控制文件名称和位置条目)
once in mount mode enter the command
一旦进入挂载模式,输入命令
catalog start with '/u01/.....' (The controlfile backup should be a good place to start)
目录以 '/u01/.....' 开头(控制文件备份应该是一个很好的起点)
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.
现在,如果您执行列表备份,您应该会看到原始 rman 备份中的所有项目,然后开始还原/恢复数据库的过程。
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.
免责声明:这些命令是从内存中获取的,因此语法可能不是 100% 正确,但是快速 google 应该会让你走上正确的轨道。
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
要重命名数据文件,您可能会发现此命令很有用。它将数据文件放入 ASM,但您应该可以通过将 +DATA 替换为正确的数据文件名称和位置来另一种方式
run {
跑 {
set newname for datafile 1 to "+DATA";
将数据文件 1 的新名称设置为“+DATA”;
set newname for datafile 2 to "+DATA";
将数据文件 2 的新名称设置为“+DATA”;
set newname for datafile 3 to "+DATA";
将数据文件 3 的新名称设置为“+DATA”;
set newname for datafile 4 to "+DATA";
将数据文件 4 的新名称设置为“+DATA”;
set newname for datafile 5 to "+DATA";
将数据文件 5 的新名称设置为“+DATA”;
restore database;
恢复数据库;
switch datafile all;
全部切换数据文件;
recover database
恢复数据库
}
}