Skip to content
Home » Oracle » How to Clean Fast Recovery Area by RMAN (4/8) - Delete Specific Archivelog.

How to Clean Fast Recovery Area by RMAN (4/8) - Delete Specific Archivelog.

How to Clean Fast Recovery Area by RMAN (3/8) - Delete Obsolete by Configuring More Restrictive Policies
Deleting a specific range of archivelogs makes FRA to free space, but before deleting, you should list the files to confirm the candidates to delete.

List archivelogs that are older than 60 days by indicating UNTIL TIME clause.
RMAN> list archivelog until time 'sysdate-60';

List of Archived Log Copies for database with db_unique_name PRIMDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
1       1    4       A 29-OCT-12
        Name: +DATA/compdb/archive/1_4_797940996.arc

4       1    5       A 29-OCT-12
        Name: +DATA/compdb/archive/1_5_797940996.arc
...

218     2    58      A 12-NOV-12
        Name: +DATA/primdb/archivelog/2012_11_12/thread_2_seq_58.1068.799173865

222     2    59      A 12-NOV-12
        Name: +DATA/primdb/archivelog/2012_12_17/thread_2_seq_59.1077.802260459

Delete these archivelogs, if they are deletable.
RMAN> delete archivelog until time 'sysdate -60';

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=103 instance=primdb1 device type=DISK
List of Archived Log Copies for database with db_unique_name PRIMDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
1       1    4       A 29-OCT-12
        Name: +DATA/compdb/archive/1_4_797940996.arc

4       1    5       A 29-OCT-12
        Name: +DATA/compdb/archive/1_5_797940996.arc
...

218     2    58      A 12-NOV-12
        Name: +DATA/primdb/archivelog/2012_11_12/thread_2_seq_58.1068.799173865

222     2    59      A 12-NOV-12
        Name: +DATA/primdb/archivelog/2012_12_17/thread_2_seq_59.1077.802260459


Do you really want to delete the above objects (enter YES or NO)? yes

deleted archived log
archived log file name=+DATA/compdb/archive/1_4_797940996.arc RECID=1 STAMP=797944474
deleted archived log
archived log file name=+DATA/compdb/archive/1_5_797940996.arc RECID=4 STAMP=797944494
deleted archived log

...
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_11_12/thread_2_seq_58.1068.799173865 RECID=218 STAMP=799173866
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_12_17/thread_2_seq_59.1077.802260459 RECID=222 STAMP=802260464
Deleted 129 objects

Another way to specify the time is to convert a string to date by the function TO_DATE.
RMAN> delete archivelog until time "to_date('2012-12-18', 'yyyy-mm-dd')";

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=103 instance=primdb1 device type=DISK
List of Archived Log Copies for database with db_unique_name PRIMDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
221     1    68      A 17-DEC-12
        Name: +DATA/primdb/archivelog/2012_12_17/thread_1_seq_68.1076.802260457

226     1    69      A 17-DEC-12
        Name: +DATA/primdb/archivelog/2012_12_17/thread_1_seq_69.1081.802260891
...

261     2    69      A 17-DEC-12
        Name: +DATA/primdb/archivelog/2012_12_17/thread_2_seq_69.1092.802263873

265     2    70      A 17-DEC-12
        Name: +DATA/primdb/archivelog/2013_01_19/thread_2_seq_70.1097.805121755


Do you really want to delete the above objects (enter YES or NO)? yes

deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_12_17/thread_1_seq_68.1076.802260457 RECID=221 STAMP=802260457
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_12_17/thread_1_seq_69.1081.802260891 RECID=226 STAMP=802260896

...
deleted archived log
archived log file name=+DATA/primdb/archivelog/2012_12_17/thread_2_seq_69.1092.802263873 RECID=261 STAMP=802263873
deleted archived log
archived log file name=+DATA/primdb/archivelog/2013_01_19/thread_2_seq_70.1097.805121755 RECID=265 STAMP=805121764
Deleted 19 objects

How to Clean Fast Recovery Area by RMAN (5/8) - Delete Specific Backup or Copy

Leave a Reply

Your email address will not be published. Required fields are marked *