DBA Hub

📋Steps in this guide1/1

Shell Script To Delete Old Archives Using RMAN

Prepare the shell script.

oracle configurationintermediate
by OracleDba
12 views
1

Overview

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cat arch_del.sh
#!/bin/bash
export ORACLE_HOME=/oracle/app/oracle/product/12.1.0.2.0
export ORACLE_SID=PARIS12C
export PATH=$ORACLE_HOME/bin:$PATH
delBackup () {
rman log=/home/oracle/arch_del.log << EOF
connect target /
DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE ‘sysdate-1’;
CROSSCHECK ARCHIVELOG ALL;
DELETE EXPIRED ARCHIVELOG ALL;
exit
EOF
}
# Main
delBackup

00 22 * * * /u01/app/oracle/arch_del.sh > /tmp/rmanarch.log

Comments (0)

Please to add comments

No comments yet. Be the first to comment!