Rman全备恢复到另外服务器操作指南(操作笔记)

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:

[oracle@oracle ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 18 13:20:22 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL>

SQL> conn /as sysdba;
Connected to an idle instance.

 

 

SQL> create pfile from spfile='/u01/oracle/product/10.2.0/db_1/dbs/spfilehanmi.ora';

  修改pfiel后,创建pfile 中相应的目录


*.db_file_name_convert=('/u01/app/oracle/oradata/hanmi/','/u01/oracle/oradata/hanmi')
*.log_file_name_convert=('/u01/app/oracle/oradata/hanmi/','/u01/oracle/oradata/hanmi')

 

   用pfile 启动oracle (删除spfile或改名spfile)

 

RMAN> shutdown immediate;

Oracle instance shut down

 


2:重新登陆rman进行控制文件的恢复

[oracle@oracle ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jul 5 14:30:57 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)

 

RMAN> startup nomount; 

connected to target database (not started)
Oracle instance started

Total System Global Area    2634022912 bytes

Fixed Size                     2023112 bytes
Variable Size                452985144 bytes
Database Buffers            2130706432 bytes
Redo Buffers                  48308224 bytes
 

 

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 {
 set newname for datafile 1 to '/u01/oracle/oradata/hanmi/system01.dbf';
 set newname for datafile 2 to '/u01/oracle/oradata/hanmi/undotbs01.dbf';
 set newname for datafile 3 to '/u01/oracle/oradata/hanmi/sysaux01.dbf';
 set newname for datafile 4 to '/u01/oracle/oradata/hanmi/users01.dbf';
 set newname for datafile 5 to '/u01/oracle/oradata/hanmi/bjhanmi01.dbf';
 set newname for datafile 6 to '/u01/oracle/oradata/hanmi/gsp01.dbf';
 set newname for datafile 7 to '/u01/oracle/oradata/hanmi/unia01.dbf';
 set newname for datafile 8 to '/u01/oracle/oradata/hanmi/sfa01.dbf';
 set newname for datafile 9 to '/u01/oracle/oradata/hanmi/rmkunia01.dbf';
 set newname for datafile 10 to '/u01/oracle/oradata/hanmi/hmp01.dbf';
 set newname for datafile 11 to '/u01/oracle/oradata/hanmi/test01.dbf';


 restore database;
 switch datafile all;
 recover database ;
 }

 

 


 

你可能感兴趣的:(职场,rman,休闲)