Oracle ASM删除归档日志
一、查询当前归档路径
$export ORACLE_SID=rac1
$sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 20 23:43:59 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FLASHBACK_DISK/rac/archivelog
Oldest online log sequence 30
Next log sequence to archive 31
Current log sequence 31
确定当前归档目录的路径为“+FLASHBACK_DISK/rac/archivelog”。
二、asmcmd命令行删除指定archivelog
$export ORACLE_SID=+ASM1
$asmcmd
ASMCMD>
ASMCMD> ls
FLASHBACK_DISK/
RAC_DISK/
ASMCMD>
ASMCMD>
ASMCMD> cd +FLASHBACK_DISK/rac/archivelog
ASMCMD> ls
1_69_726504737.dbf
1_70_726504737.dbf
2010_08_08/
2010_09_20/
2010_09_21/
2_28_726504737.dbf
2_29_726504737.dbf
ASMCMD> rm 1_69_726504737.dbf
ASMCMD> rm 2_28_726504737.dbf
ASMCMD> rm 2_29_726504737.dbf
三、从RMAN中校验并删除过期归档
$export ORACLE_SID=rac1
$rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Sep 21 00:43:04 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: RAC (DBID=2314486753)
RMAN> crosscheck archivelog all;
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=128 instance=rac1 devtype=DISK
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/1_11_726504737.dbf recid=2 stamp=726512010
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/1_12_726504737.dbf recid=4 stamp=726512121
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/1_13_726504737.dbf recid=8 stamp=727096441
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/1_14_726504737.dbf recid=10 stamp=727110648
validation failed for archived log
archive log filename=+FLASHBACK_DISK/rac/archivelog/1_69_726504737.dbf recid=12 stamp=730255226
validation succeeded for archived log
archive log filename=+FLASHBACK_DISK/rac/archivelog/1_70_726504737.dbf recid=13 stamp=730255273
validation succeeded for archived log
archive log filename=+FLASHBACK_DISK/rac/2_1_726504737.dbf recid=1 stamp=726498306
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/2_2_726504737.dbf recid=3 stamp=726500578
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/2_3_726504737.dbf recid=5 stamp=726500687
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/2_4_726504737.dbf recid=6 stamp=726515975
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/2_5_726504737.dbf recid=7 stamp=727096438
validation failed for archived log
archive log filename=+RAC_DISK/rac/archive/2_6_726504737.dbf recid=9 stamp=727098115
validation failed for archived log
archive log filename=+FLASHBACK_DISK/rac/archivelog/2_28_726504737.dbf recid=11 stamp=730250879
validation failed for archived log
archive log filename=+FLASHBACK_DISK/rac/archivelog/2_29_726504737.dbf recid=14 stamp=730250935
Crosschecked 14 objects
RMAN> delete noprompt expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=128 instance=rac1 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
2 1 11 X 08-AUG-10 +RAC_DISK/rac/archive/1_11_726504737.dbf
4 1 12 X 08-AUG-10 +RAC_DISK/rac/archive/1_12_726504737.dbf
8 1 13 X 08-AUG-10 +RAC_DISK/rac/archive/1_13_726504737.dbf
10 1 14 X 08-AUG-10 +RAC_DISK/rac/archive/1_14_726504737.dbf
12 1 69 X 20-SEP-10 +FLASHBACK_DISK/rac/archivelog/1_69_726504737.dbf
3 2 2 X 08-AUG-10 +RAC_DISK/rac/archive/2_2_726504737.dbf
5 2 3 X 08-AUG-10 +RAC_DISK/rac/archive/2_3_726504737.dbf
6 2 4 X 08-AUG-10 +RAC_DISK/rac/archive/2_4_726504737.dbf
7 2 5 X 08-AUG-10 +RAC_DISK/rac/archive/2_5_726504737.dbf
9 2 6 X 15-AUG-10 +RAC_DISK/rac/archive/2_6_726504737.dbf
11 2 28 X 30-AUG-10 +FLASHBACK_DISK/rac/archivelog/2_28_726504737.dbf
14 2 29 X 20-SEP-10 +FLASHBACK_DISK/rac/archivelog/2_29_726504737.dbf
deleted archive log
archive log filename=+RAC_DISK/rac/archive/1_11_726504737.dbf recid=2 stamp=726512010
deleted archive log
archive log filename=+RAC_DISK/rac/archive/1_12_726504737.dbf recid=4 stamp=726512121
deleted archive log
archive log filename=+RAC_DISK/rac/archive/1_13_726504737.dbf recid=8 stamp=727096441
deleted archive log
archive log filename=+RAC_DISK/rac/archive/1_14_726504737.dbf recid=10 stamp=727110648
deleted archive log
archive log filename=+FLASHBACK_DISK/rac/archivelog/1_69_726504737.dbf recid=12 stamp=730255226
deleted archive log
archive log filename=+RAC_DISK/rac/archive/2_2_726504737.dbf recid=3 stamp=726500578
deleted archive log
archive log filename=+RAC_DISK/rac/archive/2_3_726504737.dbf recid=5 stamp=726500687
deleted archive log
archive log filename=+RAC_DISK/rac/archive/2_4_726504737.dbf recid=6 stamp=726515975
deleted archive log
archive log filename=+RAC_DISK/rac/archive/2_5_726504737.dbf recid=7 stamp=727096438
deleted archive log
archive log filename=+RAC_DISK/rac/archive/2_6_726504737.dbf recid=9 stamp=727098115
deleted archive log
archive log filename=+FLASHBACK_DISK/rac/archivelog/2_28_726504737.dbf recid=11 stamp=730250879
deleted archive log
archive log filename=+FLASHBACK_DISK/rac/archivelog/2_29_726504737.dbf recid=14 stamp=730250935
Deleted 12 EXPIRED objects
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=128 instance=rac1 devtype=DISK
validation succeeded for archived log
archive log filename=+FLASHBACK_DISK/rac/archivelog/1_70_726504737.dbf recid=13 stamp=730255273
validation succeeded for archived log
archive log filename=+FLASHBACK_DISK/rac/2_1_726504737.dbf recid=1 stamp=726498306
Crosschecked 2 objects
RMAN>
阅读(2864) | 评论(2) | 转发(0) |