standby库归档日志断档,故standby库不能利用恢复归档日志和生产库保持同步,因生产库有1T多,重拉数据将非常耗时,遂利用RMAN对生产库进行增量备份,将增量备份集合成到standby库,利用此方法就跨过了被删除的归档日志。具体方法如下:
1。操作平台如下:

  1. SQL> select * from v$version;
  2. BANNER
  3. —————————————————————-
  4. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
  5. PL/SQL Release 10.2.0.4.0 - Production
  6. CORE    10.2.0.4.0 Production
  7. TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
  8. NLSRTL Version 10.2.0.4.0 - Production
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,将其拷贝到备份库

  1. SQL> alter database create standby controlfile as ‘/tmp/cc.ctl’;
  2. Database altered.
SQL> alter database create standby controlfile as '/tmp/cc.ctl';

Database altered.

3。利用新生成过来的控制文件重启备份库
4。将备份库注册到catalog库,作为生产库的0级备份

  1. set pagesize 0
  2. set head off
  3. set linesize 150
  4. spool catalog.lst
  5. select ‘catalog datafilecopy ’||||‘/Tbackup/orajfdz/oradata/’||substr(name,instr(name,‘/’,-1)+1)||||‘ level=0′||‘ tag=’||||‘mcdbra’||||‘;’ from v$datafile;
  6. spool off
  7. exit
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库

  1. $ rman target / catalog mcdbra/mcdbra@mcdrb
  2. Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jul 6 11:53:32 2009
  3. Copyright (c) 1982, 2007, Oracle.  All rights reserved.
  4. connected to target database: ORAJFDZ (DBID=4110352480, not open)
  5. connected to recovery catalog database
  6. RMAN> @catalog.lst
  7. RMAN> catalog datafilecopy ‘/Tbackup/orajfdz/oradata/rdz02_sys01_4G’ level=0 tag=‘mcdbra’;
  8. Starting implicit crosscheck backup at 06-JUL-09
  9. allocated channel: ORA_DISK_1
  10. channel ORA_DISK_1: sid=2185 devtype=DISK
  11. Finished implicit crosscheck backup at 06-JUL-09
  12. Starting implicit crosscheck copy at 06-JUL-09
  13. using channel ORA_DISK_1
  14. Crosschecked 182 objects
  15. Finished implicit crosscheck copy at 06-JUL-09
  16. searching for all files in the recovery area
  17. cataloging files…
  18. no files cataloged
  19. cataloged datafile copy
  20. datafile copy filename=/Tbackup/orajfdz/oradata/rdz02_sys01_4G recid=183 stamp=691502070
  21. RMAN> catalog datafilecopy ‘/Tbackup/orajfdz/oradata/rdz01_ud01_4G’ level=0 tag=‘mcdbra’;
  22. 。。。
$ 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生成增量备份集

  1. $ rman target / catalog mcdbra/mcdbra@mcdrb
  2. Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jul 6 13:18:51 2009
  3. Copyright (c) 1982, 2007, Oracle.  All rights reserved.
  4. connected to target database: ORAJFDZ (DBID=4110352480)
  5. connected to recovery catalog database
  6. RMAN>  backup incremental level 1 tag ‘mcdbra’ database format ‘/Tbackup/orajfdz/oradata/orajfdz%u.inc’;
  7. Starting backup at 06-JUL-09
  8. allocated channel: ORA_DISK_1
  9. channel ORA_DISK_1: sid=2062 devtype=DISK
  10. channel ORA_DISK_1: starting incremental level 1 datafile backupset
  11. channel ORA_DISK_1: specifying datafile(s) in backupset
  12. input datafile fno=00102 name=/dev/rjfdz02_151_18G
  13. input datafile fno=00261 name=/dev/rjfdz01_153_18G
  14. input datafile fno=00265 name=/dev/rjfdz02_154_18G
  15. input datafile fno=00279 name=/dev/rjfdz02_156_18G
  16. input datafile fno=00104 name=/dev/rjfdz02_149_9G
  17. input datafile fno=00110 name=/dev/rjfdz02_105_9G
  18. input datafile fno=00114 name=/dev/rjfdz02_114_9G
  19. input datafile fno=00206 name=/dev/rjfdz02_104_9G
  20. input datafile fno=00213 name=/dev/rjfdz02_108_9G
  21. input datafile fno=00228 name=/dev/rjfdz02_116_9G
  22. input datafile fno=00232 name=/dev/rjfdz02_120_9G
  23. input datafile fno=00236 name=/dev/rjfdz02_124_9G
  24. input datafile fno=00240 name=/dev/rjfdz02_128_9G
  25. input datafile fno=00244 name=/dev/rjfdz01_135_9G
  26. input datafile fno=00248 name=/dev/rjfdz01_139_9G
  27. input datafile fno=00252 name=/dev/rjfdz01_143_9G
  28. input datafile fno=00256 name=/dev/rjfdz01_147_9G
  29. input datafile fno=00267 name=/dev/rjfdz02_150_9G
  30. input datafile fno=00275 name=/dev/rjfdz01_116_9G
  31. input datafile fno=00008 name=/dev/rdz01_ud05_4G
  32. input datafile fno=00069 name=/dev/rjfdz01_043_4G
  33. input datafile fno=00073 name=/dev/rjfdz01_047_4G
  34. input datafile fno=00077 name=/dev/rjfdz01_051_4G
  35. input datafile fno=00081 name=/dev/rjfdz01_055_4G
  36. input datafile fno=00085 name=/dev/rjfdz01_059_4G
  37. input datafile fno=00089 name=/dev/rjfdz01_063_4G
  38. input datafile fno=00093 name=/dev/rjfdz01_067_4G
  39. input datafile fno=00097 name=/dev/rjfdz01_071_4G
  40. input datafile fno=00208 name=/dev/rjfdz02_024_2G
  41. input datafile fno=00210 name=/dev/rjfdz02_023_2G
  42. input datafile fno=00218 name=/dev/rjfdz02_027_2G
  43. input datafile fno=00222 name=/dev/rjfdz01_032_2G
  44. input datafile fno=00226 name=/dev/rjfdz01_036_2G
  45. input datafile fno=00277 name=/dev/rjfdz01_035_2G
  46. input datafile fno=00010 name=/dev/rjfdz01_001_2G
  47. input datafile fno=00014 name=/dev/rjfdz01_005_2G
  48. input datafile fno=00018 name=/dev/rjfdz01_009_2G
  49. input datafile fno=00022 name=/dev/rjfdz01_013_2G
  50. input datafile fno=00026 name=/dev/rjfdz01_017_2G
  51. input datafile fno=00030 name=/dev/rjfdz01_021_2G
  52. input datafile fno=00034 name=/dev/rjfdz02_007_2G
  53. input datafile fno=00038 name=/dev/rjfdz02_011_2G
  54. input datafile fno=00042 name=/dev/rjfdz02_015_2G
  55. input datafile fno=00046 name=/dev/rjfdz02_019_2G
  56. input datafile fno=00050 name=/dev/rjfdz01_025_2G
  57. input datafile fno=00054 name=/dev/rjfdz01_029_2G
  58. input datafile fno=00058 name=/dev/rjfdz01_033_2G
  59. input datafile fno=00062 name=/dev/rjfdz01_037_2G
  60. input datafile fno=00066 name=/dev/rjfdz02_040_2G
  61. channel ORA_DISK_1: starting piece 1 at 06-JUL-09
$ 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

备份过程中注意查看相关等待事件

  1. [SQL> /
  2. SID EVENT
  3. ---------- ----------------------------------------------------------------
  4. 2205 pmon timer
  5. [b]2162 RMAN backup & recovery I/O[/b]
  6. 2153 db file scattered read
  7. 2196 smon timer
  8. 2066 jobq slave wait
  9. 2188 Streams AQ: waiting for time management or cleanup tasks
  10. 2184 Streams AQ: qmn coordinator idle wait
  11. 2187 Streams AQ: qmn slave idle wait
  12. 8 rows selected.
[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库

  1. RMAN> run {
  2. set newname for datafile 1 to ‘/u03/stby/system01.dbf’;
  3. set newname for datafile 2 to ‘/u03/stby/undotbs01.dbf’;
  4. set newname for datafile 3 to ‘/u03/stby/indx01.dbf’;
  5. set newname for datafile 4 to ‘/u03/stby/tools01.dbf’;
  6. set newname for datafile 5 to ‘/u03/stby/undotbs02.dbf’;
  7. set newname for datafile 6 to ‘/u03/stby/users01.dbf’;
  8. switch datafile all;
  9. recover database noredo;
  10. }



Related posts

coded by nessus
分享:  DeliciousGReader鲜果豆瓣CSDN网摘
Trackback

only 1 comment untill now

  1. cottonmouth@conclusively.neurasthenic” rel=”nofollow”>.…

    thanks!…

Add your comment now

无觅相关文章插件