Friday, August 21, 2009

Delete archive logs using RMAN.

You can delete the archive logs using RMAN with or with out Recovery Catalog.
Use the below command to delete archive logs from ASM Disk Group or other file systems.

Method 1: Delete archive logs using RMAN with Recovery Catalog

RMAN> connect catalog userid/password@connection_string
RMAN> connect target
RMAN> delete force archivelog like '’;
For ex: -
RMAN> delete force archivelog like '+FLASH/testdb/archivelog/2009_08_11/thread_1_seq_366.663.1;

To delete multiple files just place them after the LIKE clause and use wildcard for file names.
RMAN> delete force archivelog like '+FLASH/asm/archivelog/2009_08_11/thread_1_*;

Method 2: Delete archive logs using RMAN with out Recovery Catalog.

RMAN> connect target
RMAN> delete force archivelog like '+FLASH/asm/archivelog/2009_08_11/thread_1_seq_366.663.1;

RMAN will update the controlfile/recovery catalog that the files have been removed.

Click here to learn How to delete the database files and archive logs without using RMAN.

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

3 comments:

  1. Step Configuration :
    The first thing to do is, find where the archive log is put and after that you must use RMAN to delete the archive on command promt. type this command RMAN

    RMAN> run { allocate channel d1 type disk;
    delete archivelog all;
    release channel d1;
    }

    16GB SD Karte

    ReplyDelete
  2. Hi
    I am using this same command and RMAN Process is telling me "specification does not match any archived log in the recovery catalog"

    Any suggestions
    thanks
    Vikas

    my code:
    rman target / << EOD
    run {
    allocate channel ch01 type disk;
    # delete noprompt force archivelog until time 'SYSDATE-1'; # this works deletes
    all files from disk and asm.
    # delete noprompt force archivelog like '+COMMPRD_ARC/' completed before 'SYSDAT
    E-1';
    # delete noprompt force archivelog until time 'SYSDATE-3' like '+COMMPRD_ARC/RMA
    NPRD/ARCHIVELOG/2010_05_20/thread_1_*';
    delete noprompt force archivelog until time 'sysdate-1' like '/sv1/arch/RMANPRD/
    *';
    release channel ch01;
    }
    EOD

    ReplyDelete
  3. delete noprompt force archivelog until time 'sysdate-1' like '/sv1/arch/RMANPRD/
    *';

    Please note that there are no archivelogs to satisfy the above command that's why you have received that message.

    ReplyDelete