Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1013325
  • 博文数量: 584
  • 博客积分: 2293
  • 博客等级: 大尉
  • 技术积分: 3045
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-28 11:15
文章分类

全部博文(584)

文章存档

2012年(532)

2011年(47)

2009年(5)

我的朋友

分类:

2012-03-08 20:09:55

下面演示将备份集mv到其他目录后加入catalog的过程.
1.列出当前的备份集信息(当前的备份集位于目录/u01/rman_backup/2011/201111/)
  1. RMAN> list backup;

  2. using target database control file instead of recovery catalog

  3. List of Backup Sets
  4. ===================

  5. BS Key Type LV Size Device Type Elapsed Time Completion Time
  6. ------- ---- -- ---------- ----------- ------------ ---------------

  7. 4 Full 351.26M DISK 00:00:51 30-NOV-11
  8.         BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  9.         Piece Name: /u01/rman_backup/2011/201111/df_768589674_5_1.bak
  10.   List of Datafiles in backup set 4
  11.   File LV Type Ckp SCN Ckp Time Name
  12.   ---- -- ---- ---------- --------- ----

  13.   1 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/system01.dbf
  14.   4 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/users01.dbf

  15. BS Key Type LV Size Device Type Elapsed Time Completion Time
  16. ------- ---- -- ---------- ----------- ------------ ---------------

  17. 5 Full 173.91M DISK 00:00:55 30-NOV-11
  18.         BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  19.         Piece Name: /u01/rman_backup/2011/201111/df_768589674_6_1.bak
  20.   List of Datafiles in backup set 5
  21.   File LV Type Ckp SCN Ckp Time Name
  22.   ---- -- ---- ---------- --------- ----

  23.   2 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/undotbs01.dbf
  24.   3 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/sysaux01.dbf
  25.   5 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/hxl01.dbf

  26. BS Key Type LV Size Device Type Elapsed Time Completion Time
  27. ------- ---- -- ---------- ----------- ------------ ---------------

  28. 6 Full 6.77M DISK 00:00:03 30-NOV-11
  29.         BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  30.         Piece Name: /u01/rman_backup/2011/201111/df_768589733_7_1.bak
  31.   Control File Included: Ckp SCN: 530571 Ckp time: 30-NOV-11

  32. BS Key Type LV Size Device Type Elapsed Time Completion Time
  33. ------- ---- -- ---------- ----------- ------------ ---------------

  34. 7 Full 80.00K DISK 00:00:02 30-NOV-11
  35.         BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  36.         Piece Name: /u01/rman_backup/2011/201111/df_768589735_8_1.bak
  37.   SPFILE Included: Modification time: 30-NOV-11

2.将备份集mv到目录/u01/rman_backup/2011/201111/mybak

  1. [oracle@hxl 201111]$ ls -1
  2. 20111130
  3. df_768589674_5_1.bak
  4. df_768589674_6_1.bak
  5. df_768589733_7_1.bak
  6. df_768589735_8_1.bak
  7. mybak

  8. [oracle@hxl 201111]$mv *.bak ./mybak

3.校验当前的备份集,因为备份集迁移到了其他目录,所以crosscheck后标记为EXPIRED.

  1. RMAN> crosscheck backup;

  2. allocated channel: ORA_DISK_1
  3. channel ORA_DISK_1: sid=147 devtype=DISK
  4. crosschecked backup piece: found to be 'EXPIRED'
  5. backup piece handle=/u01/rman_backup/2011/201111/df_768589674_5_1.bak recid=4 stamp=768589674
  6. crosschecked backup piece: found to be 'EXPIRED'
  7. backup piece handle=/u01/rman_backup/2011/201111/df_768589674_6_1.bak recid=5 stamp=768589674
  8. crosschecked backup piece: found to be 'EXPIRED'
  9. backup piece handle=/u01/rman_backup/2011/201111/df_768589733_7_1.bak recid=6 stamp=768589735
  10. crosschecked backup piece: found to be 'EXPIRED'
  11. backup piece handle=/u01/rman_backup/2011/201111/df_768589735_8_1.bak recid=7 stamp=768589737
  12. Crosschecked 4 objects

4.删除过期的备份集

  1. RMAN> delete expired backup;

  2. using channel ORA_DISK_1

  3. List of Backup Pieces
  4. BP Key BS Key Pc# Cp# Status Device Type Piece Name
  5. ------- ------- --- --- ----------- ----------- ----------

  6. 4 4 1 1 EXPIRED DISK /u01/rman_backup/2011/201111/df_768589674_5_1.bak
  7. 5 5 1 1 EXPIRED DISK /u01/rman_backup/2011/201111/df_768589674_6_1.bak
  8. 6 6 1 1 EXPIRED DISK /u01/rman_backup/2011/201111/df_768589733_7_1.bak
  9. 7 7 1 1 EXPIRED DISK /u01/rman_backup/2011/201111/df_768589735_8_1.bak

  10. Do you really want to delete the above objects (enter YES or NO)? YES
  11. deleted backup piece
  12. backup piece handle=/u01/rman_backup/2011/201111/df_768589674_5_1.bak recid=4 stamp=768589674
  13. deleted backup piece
  14. backup piece handle=/u01/rman_backup/2011/201111/df_768589674_6_1.bak recid=5 stamp=768589674
  15. deleted backup piece
  16. backup piece handle=/u01/rman_backup/2011/201111/df_768589733_7_1.bak recid=6 stamp=768589735
  17. deleted backup piece
  18. backup piece handle=/u01/rman_backup/2011/201111/df_768589735_8_1.bak recid=7 stamp=768589737
  19. Deleted 4 EXPIRED objects

5.查看当前的备份集,因为标记为过期的备份集已经删除,所以当前catalog里没有备份集的记录.

  1. RMAN> list backup;

6.逐个将备份集加入到catalog里

  1. RMAN> catalog backuppiece '/u01/rman_backup/2011/201111/mybak/df_768589674_5_1.bak';

  2. cataloged backuppiece
  3. backup piece handle=/u01/rman_backup/2011/201111/mybak/df_768589674_5_1.bak recid=12 stamp=769250367

  4. RMAN> catalog backuppiece '/u01/rman_backup/2011/201111/mybak/df_768589674_6_1.bak';

  5. cataloged backuppiece
  6. backup piece handle=/u01/rman_backup/2011/201111/mybak/df_768589674_6_1.bak recid=13 stamp=769250424

  7. RMAN> catalog backuppiece '/u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak';

  8. cataloged backuppiece
  9. backup piece handle=/u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak recid=14 stamp=769250451

  10. RMAN> catalog backuppiece '/u01/rman_backup/2011/201111/mybak/df_768589735_8_1.bak';

  11. cataloged backuppiece
  12. backup piece handle=/u01/rman_backup/2011/201111/mybak/df_768589735_8_1.bak recid=15 stamp=769250478

7.列出迁移到mybak目录后的备份集

  1. RMAN> list backup;

  2. List of Backup Sets
  3. ===================

  4. BS Key Type LV Size Device Type Elapsed Time Completion Time
  5. ------- ---- -- ---------- ----------- ------------ ---------------

  6. 4 Full 351.26M DISK 00:00:51 30-NOV-11
  7.         BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  8.         Piece Name: /u01/rman_backup/2011/201111/mybak/df_768589674_5_1.bak
  9.   List of Datafiles in backup set 4
  10.   File LV Type Ckp SCN Ckp Time Name
  11.   ---- -- ---- ---------- --------- ----

  12.   1 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/system01.dbf
  13.   4 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/users01.dbf

  14. BS Key Type LV Size Device Type Elapsed Time Completion Time
  15. ------- ---- -- ---------- ----------- ------------ ---------------

  16. 5 Full 173.91M DISK 00:00:55 30-NOV-11
  17.         BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  18.         Piece Name: /u01/rman_backup/2011/201111/mybak/df_768589674_6_1.bak
  19.   List of Datafiles in backup set 5
  20.   File LV Type Ckp SCN Ckp Time Name
  21.   ---- -- ---- ---------- --------- ----

  22.   2 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/undotbs01.dbf
  23.   3 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/sysaux01.dbf
  24.   5 Full 530571 30-NOV-11 /u01/app/oracle/oradata/oracl/hxl01.dbf

  25. BS Key Type LV Size Device Type Elapsed Time Completion Time
  26. ------- ---- -- ---------- ----------- ------------ ---------------

  27. 6 Full 6.77M DISK 00:00:03 30-NOV-11
  28.         BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  29.         Piece Name: /u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak
  30.   Control File Included: Ckp SCN: 530571 Ckp time: 30-NOV-11

  31. BS Key Type LV Size Device Type Elapsed Time Completion Time
  32. ------- ---- -- ---------- ----------- ------------ ---------------

  33. 7 Full 80.00K DISK 00:00:02 30-NOV-11
  34.         BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20111130T170752
  35.         Piece Name: /u01/rman_backup/2011/201111/mybak/df_768589735_8_1.bak
  36.   SPFILE Included: Modification time: 30-NOV-11

CATALOG常用方法:

1.扫描备份片
CATALOG BACKUPPIECE '/u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak';

2.扫描归档日志
CATALOG ARCHIVELOG '/u01/rman_backup/archive_bak/archlog_78922.bak';

3.扫描数据文件拷贝,并且将其做为增量备份的level 0
CATALOG DATAFILECOPY '/u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak' LEVEL 0;

4.扫描控制文件拷贝
CATALOG CONTROLFILECOPY '/u01/app/oracle/oradata/oracl/control01.ctl'

5.扫描整个目录
CATALOG START WITH '/u01/rman_backup/2011/201111/mybak';

6.扫描闪回恢复区
CATALOG RECOVERY AREA NOPROMPT;

阅读(257) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~