两台数据库服务器环境和版本一样,均为solaris10,oracle10.0.2.5,
A机sid:prirac,B机sid:secrac
测试表空间lizi
现在从B机上用rman备份测试表空间的数据文件,之后将备份scp到A机的/export/home/oracle/rmanback/目录下面;
接下来修改A机数据库的dbid,详细方法我就不说了,修改为跟B机DBID相同,之后登录rman,进行catalog注册:
[oracle@db2 rmantest]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Wed Mar 9 14:57:04 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: test1 (DBID=2043040012)
RMAN> catalog start with '/home/oracle/rmantest';
using target database control file instead of recovery catalog
searching for all files that match the pattern /home/oracle/rmantest
List of Files Unknown to the Database
=====================================
File Name: /home/oracle/rmantest/edoas2_TEST_1_20110309
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /home/oracle/rmantest/edoas2_TEST_1_20110309
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
1 Full 50.93M DISK 00:00:00 2011-03-09 13:49:56
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20110309T134956
Piece Name: /home/oracle/rmantest/edoas2_TEST_1_20110309
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
6 Full 734152 2011-03-09 13:49:56
RMAN> exit
Recovery Manager complete.
至此在A机上能够找到B机表空间的备份集。
接下来该如何恢复?
我直接restore tablespace不行啊:
[oracle@db2 rmantest]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Wed Mar 9 15:49:40 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: test1 (DBID=2043040012)
RMAN> shutdown immediate
using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 1610612736 bytes
Fixed Size 2096632 bytes
Variable Size 385876488 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14680064 bytes
RMAN> RUN {
2> ALLOCATE CHANNEL CH1 TYPE disk format '/home/oracle/rmantest/%d_%p_%T';
3> restore tablespace edoas2;
4> RELEASE CHANNEL CH1;
5> }
allocated channel: CH1
channel CH1: sid=153 devtype=DISK
Starting restore at 2011-03-09 15:50:52
creating datafile fno=5 name=/home/oracle/test1/test1/edoas2.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 2011-03-09 15:50:56
released channel: CH1
RMAN> exit
Recovery Manager complete.
恢复之后根本就不是恢复的B机上的备份集。