• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Oracle » Oracle Database » How to delete the archive logs in Oracle

How to delete the archive logs in Oracle

January 29, 2023 by techgoeasy Leave a Comment

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

Table of Contents

  • How to delete the archivelog after the backup is done
  • How to delete the archive logs which are backed off
  • How to delete the archive logs
  • How to delete the expired archive logs
  • How to delete the archive logs from a particular archive dest

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

Filed Under: Oracle, Oracle Database

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • How to use sed replace string in file
  • Password Version in oracle
  • How to login as user without changing the password in Oracle database(alter user identified by values)
  • How to check encrypted tablespace in the Database
  • How To Export -Import TDE Master Encryption Key

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us