Rman 默认启动了一个名字为DUMMY的实例
[Oracle@targetdb target_bk]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Dec 30 04:40:27 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DUMMY (not mounted)
RMAN>
[oracle@targetdb target_bk]$ ll -hr
total 596M
-rw-r--r-- 1 oracle oinstall 96K Dec 30 03:57 full_database0qnu4jb5_1_1
-rw-r--r-- 1 oracle oinstall 6.8M Dec 30 03:57 full_database0pnu4jb4_1_1
-rw-r--r-- 1 oracle oinstall 216M Dec 30 03:57 full_database0onu4ja0_1_1
-rw-r--r-- 1 oracle oinstall 373M Dec 30 03:57 full_database0nnu4ja0_1_1
-rw-r--r-- 1 oracle oinstall 2.5K Dec 30 03:56 archivelog_0snu4jbf_1_1
-rw-r--r-- 1 oracle oinstall 554K Dec 30 03:56 archivelog_0rnu4jbf_1_1
参数文件在哪个备份集呢?可以到原库上通过list backup 查看,有经验的查看备份集大小即可判断出。
[oracle@targetdb target_bk]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Dec 30 04:41:43 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DUMMY (not mounted)
RMAN> restore spfile from '/home/oracle/target_bk/full_database0qnu4jb5_1_1';
Starting restore at 30-DEC-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: autobackup found: /home/oracle/target_bk/full_database0qnu4jb5_1_1
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 30-DEC-12
RMAN> shutdown immediate;
Oracle instance shut down
RMAN>
恢复控制文件
使用刚刚恢复出来的参数文件启库:
[oracle@targetdb target_bk]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Dec 30 04:45:54 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 75499764 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
RMAN> restore controlfile to '/u01/oracle/oradata/sourcedb/controlfile01.ctl' from '/home/oracle/target_bk/full_database0pnu4jb4_1_1';
Starting restore at 30-DEC-12
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 30-DEC-12
到sqlplus 下修改参数文件位置:
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DG1/sourcedb/controlfile/cont
rol01.ctl, +DG1/sourcedb/contr
olfile/control02.ctl
SQL> alter system set control_files='/u01/oracle/oradata/sourcedb/control01.ctl','/u01/oracle/oradata/sourcedb/control02.ctl' scope=spfile;
System altered.
