Monday, November 26, 2018

ORACLE RMAN: Delete archivelogs older than X hours batch

ORACLE RMAN: Delete archive logs older than X hours

Oracle, RMAN


1. Create .bat script to start rman script

rman @C:\RMAN_delete.rman


2. Create rman script at location from previous script. Script is deleting archive logs older than hours without prompting.

CONNECT TARGET SYS/SysPassword
RUN
{
DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'sysdate-12/24';
}
EXIT;


3. Schedule .bat script at windows scheduler

4. Additionally setup retention policy at RMAN as below


No comments:

Post a Comment

Problem with database open ORA-19804, ORA-19809, ORA-03113

1. Try to login to database with SYS AS SYSDBA user. If the instance is idle, run the startup command. 2. If ORA-03113 occured, check the la...