How to delete Archive Logs By using RMAN
Check the count how many archives available on disk which are available.SQL> select count(*) from v$archived_log where name is not null;
COUNT(*)
----------
1000
SQL>
Now connect to RMAN and give the following commands
$rman target /
RMAN> crosscheck archivelog all;
RMAN> delete archivelog all completed before 'sysdate-1';
using target database control file instead of recovery catalog
allocated channel: D1
channel C1: sid=565 devtype=DISK
allocated channel: D2
channel C2: sid=599 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - -------------------- ----
RMAN-06214: Archivelog .
.
.
.
---
deleted archive log
archive log
Deleted 900 objects
RMAN>
RMAN will delete all the archives except today’s archives and now check the how many archives exist from SQL
SQL> select count(*) from v$archived_log where name is not null;
COUNT(*)
----------
100
No comments:
Post a Comment