mv xxxx.dbf xxxx.dbf.bak
--主库
scp /xxx/xxxx/xxxx.dbf oracle@x.x.x.x:/xxx/xxx/xxx.dbf
--备库
alter database datafile n online;
alter database recover managed standby database disconnect from session;
这种操作本身没有问题,然而有问题的是,这3个文件处理了之后,恢复发行又报错其他的数据文件了,我檫。
整个数据库一共2.2TB,80个30g的文件。 我不可能给他全库scp过去。
那么怎么弄呢 ?
其实很简单,我很早之前也讲过利用rman增量的方式来恢复dataguard环境中缺少日志导致gap的情况。 我们也可以使用类似
这个方法来做,下面是我的基本操作:
---定位备库同步的scn
SQL> col FIRST_CHANGE# for 9999999999999999999
SQL> col next_change# for 9999999999999999
SQL> /
SEQUENCE# APPLIED FIRST_CHANGE# NEXT_CHANGE#
---------- --------- -------------------- -----------------
6141 YES 12331596661580 12331596717210
6142 YES 12331596717210 12331596758421
6143 YES 12331596758421 12331596805008
6144 YES 12331596805008 12331596838849
6145 YES 12331596838849 12331596901470
6146 YES 12331596901470 12331596958127
6147 NO 12331596958127 12331597090365
6148 NO 12331597090365 12331597133130
6149 NO 12331597133130 12331597176234
6150 NO 12331597176234 12331597220783
6151 NO 12331597220783 12331597276144
。。。。。省略部分内容
---主库进行增量备份(基于scn)
rman target / << OEF
run
{
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
backup as compressed backupset incremental from SCN 12331596958127 database format '/oraclenew/datadir3/rmanback双击查看原图_incr_%d_%T_%U.bak'
include current controlfile for standby filesperset=5 tag 'forstandby0527';
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
exit
EOF
----将主库的备份文件scp到备库,并注册到catalog
RMAN> catalog start with '/oraclenew/datadir3/temp/';
using target database control file instead of recovery catalog
searching for all files that match the pattern /oraclenew/datadir3/temp/
List of Files Unknown to the Database
=====================================
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0sp9btk8_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0kp9botr_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0op9brdj_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0mp9bqlg_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0up9butr_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_10p9c01g_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_11p9c37k_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0lp9bqhs_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0gp9bmtn_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0jp9boid_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0ip9bmtn_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0tp9bul8_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0pp9bsg4_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0rp9btan_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0qp9bsul_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0np9br09_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0fp9bmtn_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CRJNEW_20140527_0vp9bvp7_1_1.bak
File Name: /oraclenew/datadir3/temp/db_incr_CR