Oracle用RMAN还原种子数据库

起一个新实例名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,seed,种子数据库)