rman
时间:2010-09-14 来源:todayboy
1:首先在控制文件的备份中恢复spfile参数文件信息
RMAN> set dbid=1133434343
executing command: SET DBID
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/product/10.2.0/db_1/dbs/inithanmi.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2019224 bytes
Variable Size 67108968 bytes
Database Buffers 83886080 bytes
Redo Buffers 6369280 bytes
RMAN> restore spfile from '/u02/rmback/data/c-2342404700-20100914-01.ctl';
Starting restore at 14-SEP-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: autobackup found: /u02/rmback/data/c-2342404700-20100914-01.ctl
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 14-SEP-10
RMAN>
创建pfile
SQL> create pfile from spfile='/u01/oracle/product/10.2.0/db_1/dbs/spfilehanmi.ora';
修改pfiel后,创建pfile 中相应的目录
用pfile 启动oracle (删除spfile或改名spfile)
RMAN> shutdown immediate;
Oracle instance shut down
2:重新登陆rman进行控制文件的恢复
RMAN> restore controlfile from '/u02/rmback/data/c-2342404700-20100914-01.ctl';
Starting restore at 14-SEP-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=541 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/u01/oracle/oradata/hanmi/control01.ctl
output filename=/u01/oracle/oradata/hanmi/control02.ctl
output filename=/u01/oracle/oradata/hanmi/control03.ctl
Finished restore at 14-SEP-10
RMAN> shutdown immediate;
Oracle instance shut down
RMAN> exit
Recovery Manager complete.
3:恢复所有数据文件
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 1258291200 bytes
Fixed Size 2020480 bytes
Variable Size 218106752 bytes
Database Buffers 1023410176 bytes
Redo Buffers 14753792 bytes
RMAN> run {
2> set newname for datafile 1 to '/u01/oracle/oradata/hanmi/system01.dbf';
3> set newname for datafile 2 to '/u01/oracle/oradata/hanmi/undotbs01.dbf';
4> set newname for datafile 3 to '/u01/oracle/oradata/hanmi/sysaux01.dbf';
5> set newname for datafile 4 to '/u01/oracle/oradata/hanmi/users01.dbf';
6> set newname for datafile 5 to '/u01/oracle/oradata/hanmi/bjhanmi01.dbf';
7> set newname for datafile 6 to '/u01/oracle/oradata/hanmi/gsp01.dbf';
8> set newname for datafile 7 to '/u01/oracle/oradata/hanmi/unia01.dbf';
9> set newname for datafile 8 to '/u01/oracle/oradata/hanmi/sfa01.dbf';
10> set newname for datafile 9 to '/u01/oracle/oradata/hanmi/rmkunia01.dbf';
11> set newname for datafile 10 to '/u01/oracle/oradata/hanmi/hmp01.dbf';
12> set newname for datafile 11 to '/u01/oracle/oradata/hanmi/test01.dbf';
13> restore database;
14> switch datafile all;
15> recover database ;
16> }