1. 首页
  2. IT资讯

rman 删除所有过期归档

1、SQL> select name from v$archived_log;NAME——————————————————————————–/arch1/arch_1_5_766706446.log/arch1/arch_1_6_766706446.log/arch1/arch_1_7_766706446.log/arch1/arch_1_8_766706446.log/arch1/arch_1_9_766706446.log/arch1/arch_1_10_766706446.log/arch1/arch_1_11_766706446.log/arch1/arch_1_12_766706446.log/arch1/arch_1_13_766706446.log/arch1/arch_1_14_766706446.log/arch1/arch_1_15_766706446.logNAME——————————————————————————–/arch1/arch_1_16_766706446.log/arch1/arch_1_17_766706446.log/arch1/arch_1_19_766706446.log/arch1/arch_1_18_766706446.log/arch1/arch_1_20_766706446.log/arch1/arch_1_21_766706446.log/arch1/arch_1_22_766706446.log/arch1/arch_1_23_766706446.log上面日志有的是过期的(expired).2、使用rman 查询和删除过期的归档[oracle@yitai ~]$ rman target /Recovery Manager: Release 10.2.0.1.0 – Production on Tue Oct 16 15:12:45 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: CUUG (DBID=1247937484)RMAN> crosscheck archivelog all;using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=141 devtype=DISKvalidation failed for archived logarchive log filename=/arch1/arch_1_5_766706446.log recid=1 stamp=796830677validation failed for archived logarchive log filename=/arch1/arch_1_6_766706446.log recid=2 stamp=796830677validation failed for archived logarchive log filename=/arch1/arch_1_7_766706446.log recid=3 stamp=796831908validation failed for archived logarchive log filename=/arch1/arch_1_8_766706446.log recid=4 stamp=796832094validation failed for archived logarchive log filename=/arch1/arch_1_9_766706446.log recid=5 stamp=796832102validation failed for archived logarchive log filename=/arch1/arch_1_10_766706446.log recid=6 stamp=796832363validation failed for archived logarchive log filename=/arch1/arch_1_11_766706446.log recid=7 stamp=796832371validation failed for archived logarchive log filename=/arch1/arch_1_12_766706446.log recid=8 stamp=796832381validation failed for archived logarchive log filename=/arch1/arch_1_13_766706446.log recid=9 stamp=796832394validation failed for archived logarchive log filename=/arch1/arch_1_14_766706446.log recid=10 stamp=796832401validation failed for archived logarchive log filename=/arch1/arch_1_15_766706446.log recid=11 stamp=796832410validation failed for archived logarchive log filename=/arch1/arch_1_16_766706446.log recid=12 stamp=796832415validation failed for archived logarchive log filename=/arch1/arch_1_17_766706446.log recid=13 stamp=796832422validation failed for archived logarchive log filename=/arch1/arch_1_18_766706446.log recid=15 stamp=796833242validation failed for archived logarchive log filename=/arch1/arch_1_19_766706446.log recid=14 stamp=796833242validation failed for archived logarchive log filename=/arch1/arch_1_20_766706446.log recid=16 stamp=796833245validation failed for archived logarchive log filename=/arch1/arch_1_21_766706446.log recid=17 stamp=796833408validation failed for archived logarchive log filename=/arch1/arch_1_22_766706446.log recid=18 stamp=796835220validation succeeded for archived logarchive log filename=/arch1/arch_1_23_766706446.log recid=19 stamp=796835527Crosschecked 19 objectsRMAN> list expired archivelog all; #列出过期的归档List of Archived Log CopiesKey Thrd Seq S Low Time Name——- —- ——- – ——— —-1 1 5 X 16-OCT-12 /arch1/arch_1_5_766706446.log2 1 6 X 16-OCT-12 /arch1/arch_1_6_766706446.log3 1 7 X 16-OCT-12 /arch1/arch_1_7_766706446.log4 1 8 X 16-OCT-12 /arch1/arch_1_8_766706446.log5 1 9 X 16-OCT-12 /arch1/arch_1_9_766706446.log6 1 10 X 16-OCT-12 /arch1/arch_1_10_766706446.log7 1 11 X 16-OCT-12 /arch1/arch_1_11_766706446.log8 1 12 X 16-OCT-12 /arch1/arch_1_12_766706446.log9 1 13 X 16-OCT-12 /arch1/arch_1_13_766706446.log10 1 14 X 16-OCT-12 /arch1/arch_1_14_766706446.log11 1 15 X 16-OCT-12 /arch1/arch_1_15_766706446.log12 1 16 X 16-OCT-12 /arch1/arch_1_16_766706446.log13 1 17 X 16-OCT-12 /arch1/arch_1_17_766706446.log15 1 18 X 16-OCT-12 /arch1/arch_1_18_766706446.log14 1 19 X 16-OCT-12 /arch1/arch_1_19_766706446.log16 1 20 X 16-OCT-12 /arch1/arch_1_20_766706446.log17 1 21 X 16-OCT-12 /arch1/arch_1_21_766706446.log18 1 22 X 16-OCT-12 /arch1/arch_1_22_766706446.logRMAN> delete noprompt expired archivelog all; #删除过期的归档released channel: ORA_DISK_1allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=141 devtype=DISKList of Archived Log CopiesKey Thrd Seq S Low Time Name——- —- ——- – ——— —-1 1 5 X 16-OCT-12 /arch1/arch_1_5_766706446.log2 1 6 X 16-OCT-12 /arch1/arch_1_6_766706446.log3 1 7 X 16-OCT-12 /arch1/arch_1_7_766706446.log4 1 8 X 16-OCT-12 /arch1/arch_1_8_766706446.log5 1 9 X 16-OCT-12 /arch1/arch_1_9_766706446.log6 1 10 X 16-OCT-12 /arch1/arch_1_10_766706446.log7 1 11 X 16-OCT-12 /arch1/arch_1_11_766706446.log8 1 12 X 16-OCT-12 /arch1/arch_1_12_766706446.log9 1 13 X 16-OCT-12 /arch1/arch_1_13_766706446.log10 1 14 X 16-OCT-12 /arch1/arch_1_14_766706446.log11 1 15 X 16-OCT-12 /arch1/arch_1_15_766706446.log12 1 16 X 16-OCT-12 /arch1/arch_1_16_766706446.log13 1 17 X 16-OCT-12 /arch1/arch_1_17_766706446.log15 1 18 X 16-OCT-12 /arch1/arch_1_18_766706446.log14 1 19 X 16-OCT-12 /arch1/arch_1_19_766706446.log16 1 20 X 16-OCT-12 /arch1/arch_1_20_766706446.log17 1 21 X 16-OCT-12 /arch1/arch_1_21_766706446.log18 1 22 X 16-OCT-12 /arch1/arch_1_22_766706446.logdeleted archive logarchive log filename=/arch1/arch_1_5_766706446.log recid=1 stamp=796830677deleted archive logarchive log filename=/arch1/arch_1_6_766706446.log recid=2 stamp=796830677deleted archive logarchive log filename=/arch1/arch_1_7_766706446.log recid=3 stamp=796831908deleted archive logarchive log filename=/arch1/arch_1_8_766706446.log recid=4 stamp=796832094deleted archive logarchive log filename=/arch1/arch_1_9_766706446.log recid=5 stamp=796832102deleted archive logarchive log filename=/arch1/arch_1_10_766706446.log recid=6 stamp=796832363deleted archive logarchive log filename=/arch1/arch_1_11_766706446.log recid=7 stamp=796832371deleted archive logarchive log filename=/arch1/arch_1_12_766706446.log recid=8 stamp=796832381deleted archive logarchive log filename=/arch1/arch_1_13_766706446.log recid=9 stamp=796832394deleted archive logarchive log filename=/arch1/arch_1_14_766706446.log recid=10 stamp=796832401deleted archive logarchive log filename=/arch1/arch_1_15_766706446.log recid=11 stamp=796832410deleted archive logarchive log filename=/arch1/arch_1_16_766706446.log recid=12 stamp=796832415deleted archive logarchive log filename=/arch1/arch_1_17_766706446.log recid=13 stamp=796832422deleted archive logarchive log filename=/arch1/arch_1_18_766706446.log recid=15 stamp=796833242deleted archive logarchive log filename=/arch1/arch_1_19_766706446.log recid=14 stamp=796833242deleted archive logarchive log filename=/arch1/arch_1_20_766706446.log recid=16 stamp=796833245deleted archive logarchive log filename=/arch1/arch_1_21_766706446.log recid=17 stamp=796833408deleted archive logarchive log filename=/arch1/arch_1_22_766706446.log recid=18 stamp=796835220Deleted 18 EXPIRED objects#删除了18个归档——Good Luck !———-

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27042095/viewspace-746573/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:布吉卡,转转请注明出处:http://www.cxybcw.com/196052.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code