Oracle RMAN 跨平台恢复测试(Windows->Linux)(一)

2015-01-26 17:27:19 · 作者: · 浏览: 35

数据库启动到nomount状态


oracle@changeme:~> sqlplus /nolog
SQL> conn / as sysdba
SQL> startup nomount
SQL> exit


进入RMAN进行恢复


oracle@changeme:~> rman target /


Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 29 17:39:40 2013


Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.


connected to target database: CSDB (not mounted)


RMAN> set DBID=3039653104


executing command: SET DBID



RMAN> restore controlfile from '/home/oracle/rmanbackup/CTL_0FODDSB1_20130629';


Starting restore at 29-JUN-13
using channel ORA_DISK_1


channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/csdb/control01.ctl
Finished restore at 29-JUN-13


RMAN> sql 'alter database mount';


sql statement: alter database mount
released channel: ORA_DISK_1


RMAN> catalog start with '/home/oracle/rmanbackup';


Starting implicit crosscheck backup at 29-JUN-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 29-JUN-13


Starting implicit crosscheck copy at 29-JUN-13
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 29-JUN-13


searching for all files in the recovery area
cataloging files...
no files cataloged


searching for all files that match the pattern /home/oracle/rmanbackup


List of Files Unknown to the Database
=====================================
File Name: /home/oracle/rmanbackup/ARCH_0GODDSKM_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0DODDS85_20130629
File Name: /home/oracle/rmanbackup/CTL_0FODDSB1_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0EODDSAQ_20130629


Do you really want to catalog the above files (enter YES or NO)? y
cataloging files...
cataloging done


List of Cataloged Files
=======================
File Name: /home/oracle/rmanbackup/ARCH_0GODDSKM_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0DODDS85_20130629
File Name: /home/oracle/rmanbackup/CTL_0FODDSB1_20130629
File Name: /home/oracle/rmanbackup/DB_INC0_0EODDSAQ_20130629


?


RMAN> run{
2> allocate channel c1 type disk;
3> set newname for datafile 1 to '/u01/app/oracle/oradata/csdb/system01.dbf';
4> set newname for datafile 2 to '/u01/app/oracle/oradata/csdb/sysaux01.dbf';
5> set newname for datafile 3 to '/u01/app/oracle/oradata/csdb/undotbs1.dbf';
6> set newname for datafile 4 to '/u01/app/oracle/oradata/csdb/users01.dbf';
7> set newname for datafile 5 to '/u01/app/oracle/oradata/csdb/example01.dbf';
8> set newname for datafile 6 to '/u01/app/oracle/oradata/csdb/undotbs2.dbf';
9> set newname for datafile 7 to '/u01/app/oracle/oradata/csdb/testtbs01.dbf';
10> restore database;
11> switch datafile all;
12> release channel c1;
13> }


released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=134 device type=DISK


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


Starting restore at 29-JUN-13


channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to /u01/app/oracle/oradata/csdb/system01.dbf
channel c1: restoring datafile 00002 to /u01/app/oracle/oradata/csdb/sysaux01.dbf
channel c1: re