RMAN的crosscheck和obsolete的用法(2)

---查看所有备份集
 RMAN> list backup summary;
 
List of Backups
 ===============
 Key    TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
 ------- -- -- - ----------- --------------- ------- ------- ---------- ---
 1      B  F  A DISK        10-MAR-14      1      1      NO        TAG20140310T105231
 2      B  F  A DISK        10-MAR-14      1      1      NO        TAG20140310T105231
 3      B  F  A DISK        10-MAR-14      1      1      NO        TAG20140310T105231
 4      B  F  A DISK        10-MAR-14      1      1      NO        TAG20140310T105404
 5      B  F  A DISK        10-MAR-14      1      1      NO        TAG20140310T105404
 
---这里用corsscheck 检查备份的可用性
 RMAN> crosscheck backup;
 
using channel ORA_DISK_1
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_full_01p2qnrf_1_1 RECID=1 STAMP=841834351
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_full_02p2qnrm_1_1 RECID=2 STAMP=841834358
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_full_03p2qnrn_1_1 RECID=3 STAMP=841834360
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_system_04p2qnuc_1_1 RECID=4 STAMP=841834444
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_system_05p2qnuf_1_1 RECID=5 STAMP=841834448
 Crosschecked 5 objects
 ---都是‘available’
 

---违背备份策略查看
 RMAN> report obsolete;
 
RMAN retention policy will be applied to the command
 RMAN retention policy is set to redundancy 1
 Report of obsolete backups and copies
 Type                Key    Completion Time    Filename/Handle
 -------------------- ------ ------------------ --------------------
 Archive Log          1      10-MAR-14          /u01/app/Oracle/product/11.2.0.3/db_1/dbs/arch1_34_824748936.dbf
 Archive Log          2      10-MAR-14          /u01/app/oracle/product/11.2.0.3/db_1/dbs/arch1_35_824748936.dbf
 Archive Log          3      10-MAR-14          /u01/app/oracle/product/11.2.0.3/db_1/dbs/arch1_36_824748936.dbf
 Archive Log          4      10-MAR-14          /u01/app/oracle/product/11.2.0.3/db_1/dbs/arch1_37_824748936.dbf
 Backup Set          3      10-MAR-14       
  Backup Piece      3      10-MAR-14          /u01/backup/ora_full_03p2qnrn_1_1
 Backup Set          4      10-MAR-14       
  Backup Piece      4      10-MAR-14          /u01/backup/ora_system_04p2qnuc_1_1
 Backup Set          5      10-MAR-14       
  Backup Piece      5      10-MAR-14          /u01/backup/ora_system_05p2qnuf_1_1
 --这里备份了两次system,违背备份规则。。
 
[oracle@11g ~]$ cd /u01/backup/
 [oracle@11g backup]$ ls -ltr
 -rw-r----- 1 oracle oinstall  1130496 03-10 10:52 ora_full_02p2qnrm_1_1
 -rw-r----- 1 oracle oinstall 298704896 03-10 10:52 ora_full_01p2qnrf_1_1
 -rw-r----- 1 oracle oinstall  9601024 03-10 10:52 ora_full_03p2qnrn_1_1
 -rw-r----- 1 oracle oinstall 211337216 03-10 10:54 ora_system_04p2qnuc_1_1
 -rw-r----- 1 oracle oinstall  9601024 03-10 10:54 ora_system_05p2qnuf_1_1
 -rw-r----- 1 oracle oinstall 211337216 03-10 10:59 ora_system_06p2qo9d_1_1
 -rw-r----- 1 oracle oinstall  9601024 03-10 11:00 ora_system_07p2qo9g_1_1
 [oracle@11g backup]$ mv ora_system_04p2qnuc_1_1 ora_system_04p2qnuc_1_1.bak --我们这里mv重命名后等与破坏了备份集
 [oracle@11g backup]$ ls -ltr
 -rw-r----- 1 oracle oinstall  1130496 03-10 10:52 ora_full_02p2qnrm_1_1
 -rw-r----- 1 oracle oinstall 298704896 03-10 10:52 ora_full_01p2qnrf_1_1
 -rw-r----- 1 oracle oinstall  9601024 03-10 10:52 ora_full_03p2qnrn_1_1
 -rw-r----- 1 oracle oinstall 211337216 03-10 10:54 ora_system_04p2qnuc_1_1.bak
 -rw-r----- 1 oracle oinstall  9601024 03-10 10:54 ora_system_05p2qnuf_1_1
 -rw-r----- 1 oracle oinstall 211337216 03-10 10:59 ora_system_06p2qo9d_1_1
 -rw-r----- 1 oracle oinstall  9601024 03-10 11:00 ora_system_07p2qo9g_1_1
 
[oracle@11g backup]$ rman target /
 Recovery Manager: Release 11.2.0.3.0 - Production on Mon Mar 10 11:02:54 2014
 Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
 connected to target database: XUPENG (DBID=874511048)
 RMAN> crosscheck backup;
 
using target database control file instead of recovery catalog
 allocated channel: ORA_DISK_1
 channel ORA_DISK_1: SID=1 device type=DISK
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_full_01p2qnrf_1_1 RECID=1 STAMP=841834351
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_full_02p2qnrm_1_1 RECID=2 STAMP=841834358
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_full_03p2qnrn_1_1 RECID=3 STAMP=841834360
 crosschecked backup piece: found to be 'EXPIRED'
 backup piece handle=/u01/backup/ora_system_04p2qnuc_1_1 RECID=4 STAMP=841834444
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_system_05p2qnuf_1_1 RECID=5 STAMP=841834448
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_system_06p2qo9d_1_1 RECID=6 STAMP=841834797
 crosschecked backup piece: found to be 'AVAILABLE'
 backup piece handle=/u01/backup/ora_system_07p2qo9g_1_1 RECID=7 STAMP=841834801
 Crosschecked 7 objects
 ---这里发现有备份片‘EXPIRED’无效。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fd24c01992d3d2bec9d3d088f14939ad.html