list archivelog all 是列出控制文件中记录的未被rman delete 命令删除的手工删除的日志文件,如果手工删除之后使用list命令对应的日志文件的status为标记为X!
模拟删除日志yangdb_1_192_762800109.log
oracle@rac3:/opt/oracle/yangdb_arch>mv yangdb_1_192_762800109.log /tmp/
crosscheck 命令检查归档日志的信息:
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
validation failed for archived log
archived log file name=/opt/oracle/yangdb_arch/yangdb_1_192_762800109.log RECID=188 STAMP=770308389
validation succeeded for archived log
archived log file name=/opt/oracle/yangdb_arch/yangdb_1_193_762800109.log RECID=189 STAMP=770308806
validation succeeded for archived log
再次使用list archivelog all; mv掉的日志被标记为X。
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name YANGDB
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
188 1 192 X 19-DEC-11 Name: /opt/oracle/yangdb_arch/yangdb_1_192_762800109.log
189 1 193 A 19-DEC-11 Name: /opt/oracle/yangdb_arch/yangdb_1_193_762800109.log
RMAN> list expired archivelog all;
List of Archived Log Copies for database with db_unique_name YANGDB
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
188 1 192 X 19-DEC-11 Name: /opt/oracle/yangdb_arch/yangdb_1_192_762800109.log
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
List of Archived Log Copies for database with db_unique_name YANGDB
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
188 1 192 X 19-DEC-11 Name: /opt/oracle/yangdb_arch/yangdb_1_192_762800109.log
Do you really want to delete the above objects (enter YES or NO)? y
deleted archived log
archived log file name=/opt/oracle/yangdb_arch/yangdb_1_192_762800109.log RECID=188 STAMP=770308389
Deleted 1 EXPIRED objects
删除之后再次查看!已经yangdb_1_192_762800109.log被删除的!
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name YANGDB
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - ---------
189 1 193 A 19-DEC-11 Name: /opt/oracle/yangdb_arch/yangdb_1_193_762800109.log
RMAN>
list backup of archivelog all;查看已经备份的归档日志!
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
184 2.50K DISK 00:00:00 19-DEC-11
BP Key: 184 Status: AVAILABLE Compressed: NO Tag: TAG20111219T143310
Piece Name: /opt/oracle/flash_recovery_area/YANGDB/backupset/2011_12_19/o1_mf_annnn_TAG20111219T143310_7gxpo6cf_.bkp
List of Archived Logs in backup set 184
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 192 4388362 19-DEC-11 4388394 19-DEC-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
185 16.00K DISK 00:00:00 19-DEC-11
BP Key: 185 Status: AVAILABLE Compressed: NO Tag: TAG20111219T144006
Piece Name: /opt/oracle/flash_recovery_area/YANGDB/backupset/2011_12_19/o1_mf_annnn_TAG20111219T144006_7gxq26r4_.bkp
List of Archived Logs in backup set 185
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 193 4388394 19-DEC-11 4388874 19-DEC-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
191 7.50K DISK 00:00:00 19-DEC-11
BP Key: 191 Status: AVAILABLE Compressed: NO Tag: TAG20111219T144042
Piece Name: /opt/oracle/flash_recovery_area/YANGDB/backupset/2011_12_19/o1_mf_annnn_TAG20111219T144042_7gxq3b2n_.bkp
List of Archived Logs in backup set 191
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 194 4388874 19-DEC-11 4388908 19-DEC-11
RMAN>