Menghapus archive log dengan paksa

24 Feb

1. dimana letak archive log ?
[oracle@stby11g ~]$ sqlplus / as sysdba
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archive/stby11g
Oldest online log sequence 0
Next log sequence to archive 0
Current log sequence 15

2. hapus
[oracle@stby11g ~]$ cd /u01/archive/stby11g
[oracle@stby11g stby11g]$ ls
1_14_679442351.arc 1_11_679442351.arc 1_9_679442351.arc
1_12_679442351.arc 1_10_679442351.arc 1_13_679442351.arc
[oracle@stby11g stby11g]$ rm *
[oracle@stby11g stby11g]$ ls

3. periksa archive log lewat rman menggunakan crosscheck copy
[oracle@prmr11g prmr11g]$ rman target /
RMAN> crosscheck copy;
Starting implicit crosscheck backup at 24-FEB-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
Finished implicit crosscheck backup at 24-FEB-09

Starting implicit crosscheck copy at 24-FEB-09
using channel ORA_DISK_1
Finished implicit crosscheck copy at 24-FEB-09

searching for all files in the recovery area
cataloging files…
cataloging done

List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/stby11g/STBY11G/archivelog/2009_02_20/o1_mf_1_3_4sx7gsl5_.arc
File Name: /u01/app/oracle/flash_recovery_area/stby11g/STBY11G/archivelog/2009_02_20/o1_mf_1_4_4sxj42j8_.arc
File Name: /u01/app/oracle/flash_recovery_area/stby11g/STBY11G/archivelog/2009_02_20/o1_mf_1_2_4sx6k6kl_.arc

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_9_679442351.arc RECID=3 STAMP=679675797
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_10_679442351.arc RECID=5 STAMP=679675812
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_11_679442351.arc RECID=2 STAMP=679675797
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_12_679442351.arc RECID=4 STAMP=679675806
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_13_679442351.arc RECID=6 STAMP=679675821
validation failed for archived log
archived log file name=/u01/archive/stby11g/1_14_679442351.arc RECID=1 STAMP=679675771
Crosschecked 6 objects

4. hapus data archive log lewat rman menggunakan delete noprompt expired copy
RMAN> delete noprompt expired copy;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
List of Archived Log Copies for database with db_unique_name STBY11G
=====================================================================
Key Thrd Seq S Low Time
——- —- ——- – ———
3 1 9 X 23-FEB-09
Name: /u01/archive/stby11g/1_9_679442351.arc
5 1 10 X 23-FEB-09
Name: /u01/archive/stby11g/1_10_679442351.arc
2 1 11 X 23-FEB-09
Name: /u01/archive/stby11g/1_11_679442351.arc
4 1 12 X 23-FEB-09
Name: /u01/archive/stby11g/1_12_679442351.arc
6 1 13 X 24-FEB-09
Name: /u01/archive/stby11g/1_13_679442351.arc
1 1 14 X 24-FEB-09
Name: /u01/archive/stby11g/1_14_679442351.arc
deleted archived log
archived log file name=/u01/archive/stby11g/1_9_679442351.arc RECID=3 STAMP=679675797
deleted archived log
archived log file name=/u01/archive/stby11g/1_10_679442351.arc RECID=5 STAMP=679675812
deleted archived log
archived log file name=/u01/archive/stby11g/1_11_679442351.arc RECID=2 STAMP=679675797
deleted archived log
archived log file name=/u01/archive/stby11g/1_12_679442351.arc RECID=4 STAMP=679675806
deleted archived log
archived log file name=/u01/archive/stby11g/1_13_679442351.arc RECID=6 STAMP=679675821
deleted archived log
archived log file name=/u01/archive/stby11g/1_14_679442351.arc RECID=1 STAMP=679675771
Deleted 6 EXPIRED objects

5. periksa ulang
RMAN> crosscheck copy;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=115 device type=DISK
specification does not match any archived log in the recovery catalog
RMAN> exit

jika anda jalankan perintah sql, seperti dibawah ini maka isi v$archived_log, seolah – olah masih ada
SQL> select name from v$archived_log;
NAME
——————————————————————————–
6 rows selected.

hal ini berhubungan dengan :
1) V$ARCHIVED_LOG
2) V$CONTROLFILE_RECORD_SECTION

deatil bisa diperiksa di
http://forums.oracle.com/forums/thread.jspa?threadID=621999&start=0&tstart=0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: