Regularly clean up the archive script

# Create a directory: 
mkdir -p / Home / the Oracle / Tools / clear_log / 
# shell.sh script editor 
vi / Home / the Oracle / Tools / clear_log / clear_arch.sh 
# / bin /! SH 

. ~ / .Bash_profile 

cd / Home / the Oracle / Tools / clear_log 
RMAN target / log = clear_arch.log < clear_arch.sql 
## copy and paste ### 
# Shell script editor to delete archived call: delete RMAN performed => SQL operations 
vi / Home / the Oracle / Tools / clear_log / clear_arch.sql 
Delete noprompt ARCHIVELOG an until Time ' SYSDATE-. 1 ' ; 

# edit timer task 
[Oracle @ bdp04 ~] $ the crontab - E
no crontab for oracle - using an empty one
#delete archive log --delete one day date archive log
00 * * * * sh /home/oracle/tools/clear_log/clear_arch.sh 1>/tmp/clear_arch.log 2>&1

 

Guess you like

Origin www.cnblogs.com/lvcha001/p/11764905.html