standby库归档日志断档,故standby库不能利用恢复归档日志和生产库保持同步,因生产库有1T多,重拉数据将非常耗时,遂利用RMAN对生产库进行增量备份,将增量备份集合成到standby库,利用此方法就跨过了被删除的归档日志。具体方法如下:
1。操作平台如下:
2。在生产库新生成一个standby controlfile,将其拷贝到备份库
3。利用新生成过来的控制文件重启备份库
4。将备份库注册到catalog库,作为生产库的0级备份
5。将其注册到catalog库
6。连接至生产库利用RMAN生成增量备份集
备份过程中注意查看相关等待事件
7。将生成的增量备份集拷贝到备份库
8。恢复增量备份集至standby库
1。操作平台如下:
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production
2。在生产库新生成一个standby controlfile,将其拷贝到备份库
SQL> alter database create standby controlfile as '/tmp/cc.ctl';
Database altered.
3。利用新生成过来的控制文件重启备份库
4。将备份库注册到catalog库,作为生产库的0级备份
set pagesize 0
set head off
set linesize 150
spool catalog.lst
select 'catalog datafilecopy '||''''||'/Tbackup/orajfdz/oradata/'||substr(name,instr(name,'/',-1)+1)||''''||' level=0'||' tag='||''''||'mcdbra'||''''||';' from v$datafile;
spool off
exit
5。将其注册到catalog库
$ rman target / catalog mcdbra/mcdbra@mcdrb
Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jul 6 11:53:32 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORAJFDZ (DBID=4110352480, not open)
connected to recovery catalog database
RMAN> @catalog.lst
RMAN> catalog datafilecopy '/Tbackup/orajfdz/oradata/rdz02_sys01_4G' level=0 tag='mcdbra';
Starting implicit crosscheck backup at 06-JUL-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=2185 devtype=DISK
Finished implicit crosscheck backup at 06-JUL-09
Starting implicit crosscheck copy at 06-JUL-09
using channel ORA_DISK_1
Crosschecked 182 objects
Finished implicit crosscheck copy at 06-JUL-09
searching for all files in the recovery area
cataloging files...
no files cataloged
cataloged datafile copy
datafile copy filename=/Tbackup/orajfdz/oradata/rdz02_sys01_4G recid=183 stamp=691502070
RMAN> catalog datafilecopy '/Tbackup/orajfdz/oradata/rdz01_ud01_4G' level=0 tag='mcdbra';
。。。
6。连接至生产库利用RMAN生成增量备份集
$ rman target / catalog mcdbra/mcdbra@mcdrb
Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jul 6 13:18:51 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORAJFDZ (DBID=4110352480)
connected to recovery catalog database
RMAN> backup incremental level 1 tag 'mcdbra' database format '/Tbackup/orajfdz/oradata/orajfdz%u.inc';
Starting backup at 06-JUL-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=2062 devtype=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00102 name=/dev/rjfdz02_151_18G
input datafile fno=00261 name=/dev/rjfdz01_153_18G
input datafile fno=00265 name=/dev/rjfdz02_154_18G
input datafile fno=00279 name=/dev/rjfdz02_156_18G
input datafile fno=00104 name=/dev/rjfdz02_149_9G
input datafile fno=00110 name=/dev/rjfdz02_105_9G
input datafile fno=00114 name=/dev/rjfdz02_114_9G
input datafile fno=00206 name=/dev/rjfdz02_104_9G
input datafile fno=00213 name=/dev/rjfdz02_108_9G
input datafile fno=00228 name=/dev/rjfdz02_116_9G
input datafile fno=00232 name=/dev/rjfdz02_120_9G
input datafile fno=00236 name=/dev/rjfdz02_124_9G
input datafile fno=00240 name=/dev/rjfdz02_128_9G
input datafile fno=00244 name=/dev/rjfdz01_135_9G
input datafile fno=00248 name=/dev/rjfdz01_139_9G
input datafile fno=00252 name=/dev/rjfdz01_143_9G
input datafile fno=00256 name=/dev/rjfdz01_147_9G
input datafile fno=00267 name=/dev/rjfdz02_150_9G
input datafile fno=00275 name=/dev/rjfdz01_116_9G
input datafile fno=00008 name=/dev/rdz01_ud05_4G
input datafile fno=00069 name=/dev/rjfdz01_043_4G
input datafile fno=00073 name=/dev/rjfdz01_047_4G
input datafile fno=00077 name=/dev/rjfdz01_051_4G
input datafile fno=00081 name=/dev/rjfdz01_055_4G
input datafile fno=00085 name=/dev/rjfdz01_059_4G
input datafile fno=00089 name=/dev/rjfdz01_063_4G
input datafile fno=00093 name=/dev/rjfdz01_067_4G
input datafile fno=00097 name=/dev/rjfdz01_071_4G
input datafile fno=00208 name=/dev/rjfdz02_024_2G
input datafile fno=00210 name=/dev/rjfdz02_023_2G
input datafile fno=00218 name=/dev/rjfdz02_027_2G
input datafile fno=00222 name=/dev/rjfdz01_032_2G
input datafile fno=00226 name=/dev/rjfdz01_036_2G
input datafile fno=00277 name=/dev/rjfdz01_035_2G
input datafile fno=00010 name=/dev/rjfdz01_001_2G
input datafile fno=00014 name=/dev/rjfdz01_005_2G
input datafile fno=00018 name=/dev/rjfdz01_009_2G
input datafile fno=00022 name=/dev/rjfdz01_013_2G
input datafile fno=00026 name=/dev/rjfdz01_017_2G
input datafile fno=00030 name=/dev/rjfdz01_021_2G
input datafile fno=00034 name=/dev/rjfdz02_007_2G
input datafile fno=00038 name=/dev/rjfdz02_011_2G
input datafile fno=00042 name=/dev/rjfdz02_015_2G
input datafile fno=00046 name=/dev/rjfdz02_019_2G
input datafile fno=00050 name=/dev/rjfdz01_025_2G
input datafile fno=00054 name=/dev/rjfdz01_029_2G
input datafile fno=00058 name=/dev/rjfdz01_033_2G
input datafile fno=00062 name=/dev/rjfdz01_037_2G
input datafile fno=00066 name=/dev/rjfdz02_040_2G
channel ORA_DISK_1: starting piece 1 at 06-JUL-09
备份过程中注意查看相关等待事件
[SQL> /
SID EVENT
---------- ----------------------------------------------------------------
2205 pmon timer
[b]2162 RMAN backup & recovery I/O[/b]
2153 db file scattered read
2196 smon timer
2066 jobq slave wait
2188 Streams AQ: waiting for time management or cleanup tasks
2184 Streams AQ: qmn coordinator idle wait
2187 Streams AQ: qmn slave idle wait
8 rows selected.
7。将生成的增量备份集拷贝到备份库
8。恢复增量备份集至standby库
RMAN> run {
set newname for datafile 1 to '/u03/stby/system01.dbf';
set newname for datafile 2 to '/u03/stby/undotbs01.dbf';
set newname for datafile 3 to '/u03/stby/indx01.dbf';
set newname for datafile 4 to '/u03/stby/tools01.dbf';
set newname for datafile 5 to '/u03/stby/undotbs02.dbf';
set newname for datafile 6 to '/u03/stby/users01.dbf';
switch datafile all;
recover database noredo;
}