码迷,mamicode.com
首页 > 数据库 > 详细

Oracle用RMAN还原种子数据库

时间:2015-06-18 20:08:24      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:oracle   rman   种子数据库   seed   

起一个新实例名newdata


1、准备pfile


cp ...../dbs/init.ora ..../dbs/initnewdata.ora


vim initnewdata.ora


改变controlfile的位置


control_files=‘/u01/app/oracle/oradata/newdata/control.ctl‘


 


2、创建spfile


sqlplus / as sysdba


startup pfile=‘..../dbs/initnewdata.ora‘ nomount;


create spfile from pfile;


shutdown immediate;


startup nomount;


 


3、拷贝种子控制文件


cp /u01/app/oracle/product/10.2.0/db_1/assistants/dbca/templates/Seed_Database.ctl /u01/app/oracle/oradata/newdata


alter database mount;


 


4、拷贝种子数据文件备份片


cp /u01/app/oracle/product/10.2.0/db_1/assistants/dbca/templates/Seed_Database.dfb /u01/app/oracle/oradata/newdata


 


5、导入数据备份片信息到控制文件


rman


connect target /


delete noprompt backupset 1;


catalog start with ‘/u01/app/oracle/oradata/newdata/Seed_Database.dfb‘;


 


6、还原并恢复数据库


run {

set newname for datafile ‘/ade/b/2125410156/oracle/oradata/seeddata/system01.dbf‘ to ‘/u01/app/oracle/oradata/raw/system01.dbf‘;

set newname for datafile ‘/ade/b/2125410156/oracle/oradata/seeddata/sysaux01.dbf‘ to ‘/u01/app/oracle/oradata/raw/sysaux01.dbf‘;

set newname for datafile ‘/ade/b/2125410156/oracle/oradata/seeddata/undotbs01.dbf‘ to ‘/u01/app/oracle/oradata/raw/undotbs01.dbf‘;

set newname for datafile ‘/ade/b/2125410156/oracle/oradata/seeddata/usres01.dbf‘ to ‘/u01/app/oracle/oradata/raw/users01.dbf‘;

restore database;

recover database;

}



7、打开数据库


alter database open resetlogs;


Oracle用RMAN还原种子数据库

标签:oracle   rman   种子数据库   seed   

原文地址:http://7737197.blog.51cto.com/7727197/1663238

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!