Wednesday, June 16, 2021

Why and How to clean up (delete) archive log in Oracle

 Why ?

You will need to clean up archive log if you are running your database in  archivelog mode to avoid disk filled up with these files.

How ?

 

Before you delete archive log files, you need to take a backup of these file or you will not be able to restore/recover your DB and make it consistent again in case of failure , also , you have to make sure it is been shipped to standby database in case you are running a data guard for your primary database :

RMAN utility is your connection and manager of these file , no OS commands is needed if you setup your things correctly , however; you may run OS crontab and shell scripts to automate these files .

I am creating a shell script with below details to keep last day files in system only:

rman target / << __EOF__

 crosscheck archivelog all;

DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE -1';

EXIT

__EOF__

and in RMAN policy I configure two things,

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY BACKED UP 1 TIMES TO 'SBT_TAPE';

You can check all configuration of RMAN by running the below:

RMAN> show all;




No comments:

Post a Comment

Why and How to install Grid 19c on RHEL 8?

  Why ? Simply we will be requested to install Oracle Grid RAC DB on Redhat RHEL 8, below is my note for this installation . How ? 1-  OS in...