Archive logs keep accumulating and we need to put things in place to delete them on a regular basis. We should not be deleting the archivelog from the filesystem directly as the Oracle Database is not aware of that and space is not released in the Flash recovery area
Let’s see a few commands to delete the archive logs
How to delete the archivelog after the backup is done
BACKUP ARCHIVELOG delete ALL INPUT;
This will delete the archivelog once the backup is done on the channel defined
You can use this together with the database also
BACKUP DATABASE PLUS ARCHIVELOG delete ALL INPUT;
How to delete the archive logs which are backed off
delete archivelog UNTIL TIME = 'SYSDATE-1.5' backed up 1 times to sbt_tape;
You can change the timing accordingly. If you are backing up to Disk only, then you can specify the below command
delete archivelog UNTIL TIME = 'SYSDATE-1.5' backed up 1 times to disk;
This command will ask for the Prompt to delete the archivelog, if you want to delete without any prompt, use the below command
delete noprompt archivelog UNTIL TIME = 'SYSDATE-1.5' backed up 1 times to disk;
Suppose you want to delete the archivelog older than 1 hour, you can use the below command
delete archivelog UNTIL TIME = 'SYSDATE-1/24' backed up 1 times to disk;
How to delete the archive logs
We can delete the archive logs whether backed up or not use using the below command
delete archivelog UNTIL TIME = 'SYSDATE-1/24' ;
How to delete the expired archive logs
Suppose you manually deleted the archive log from FRA, then the below steps can be done to remove those from the FRA dictionary
rman target /
list expired archivelog all;
crosscheck archivelog all;
list expired archivelog all;
delete expired archivelog all;
How to delete the archive logs from a particular archive dest
Suppose you are using two archive locations to store the archive logs, then you can use the below command to delete it
delete archivelog LIKE '%arc_dest_1%' UNTIL TIME = 'SYSDATE-1/24' ;
I hope you like this post on archivelog deletion.
Related Articles
how to check archive log location in oracle
RMAN List backup commands
Leave a Reply