还原不同位置的数据库
机器A:机器B:
创建要恢复oracle的目录
e:\oracle\product\10.2.0\oradata\orcl
e:\oracle\product\10.2.0\admin
e:\oracle\product\10.2.0\falsh_recovery_area
把收到的文件夹orcl放到e:\oracle\product\10.2.0\admin
拷贝
e:\oracle\product\10.2.0\admin\orcl\pfile中的参数文件到自己真实数据库db_1\database文件夹中,并改名为initorcl.ora
打开initorcl.ora
把里面的路径改为真实oracle数据库的位置
d:\替换为e:\
cmd1:
set oracle_sid=orcl
oracle orcl
等到提示ctrl+c
cmd2:
set oracle_sid=orcl
sqlplus / as sysdba
startup nomount;
cmd3:
set oracle_sid=orcl
rman target sys/abc
restore controlfile from 'C:\back\ORCL_2_20090414_FULL.BAK';
cmd2:
alter database mount;
cmd3:
run{
set newname for datafile 1 to 'E:\oracle\product\10.2.0\oradata\orcl\SYSTEM01.DBF';
set newname for datafile 2 to 'E:\oracle\product\10.2.0\oradata\orcl\UNDOTBS01.DBF';
set newname for datafile 3 to 'E:\oracle\product\10.2.0\oradata\orcl\SYSAUX01.DBF';
set newname for datafile 4 to 'E:\oracle\product\10.2.0\oradata\orcl\USERS01.DBF';
set newname for datafile 5 to 'E:\oracle\product\10.2.0\oradata\orcl\XM';
restore database;
switch datafile all;
}
cmd2:
select name from v$database;
shutdown immediate;
startup mount;
alter database backup controlfile to trace;
找到跟踪文件:
重做控制文件:把里面的路径改为正确路径:
d:\改为 e:\
shutdown immediate;
startup nomount;
执行生成控制文件的语句;执行钱必须先删除.ctl的文件
alter database open resetlogs;
select name from v$database;
select member from v$logfile;