Recently do a DG archive log Delete,
[[Email protected] logs]crontab-l* 8 * * * sh/home/oracle/dbscripts/del_arc.sh
The script calls generate delete checksum three scripts respectively
Cat del_arc.sh#! /bin/bashsource/home/oracle/.bash_profilesh/home/oracle/dbscripts/build_del_archivelog.sh >>/home/oracle/ Dbscripts/del_arch ' Date +%f_%h '. Shsleep 5sh/home/oracle/dbscripts/del_arch ' date +%f_%h '. SH >>/home/oracle/ Dbscripts/logs/del_arch ' Date +%f_%h '. Logsleep 5sh/home/oracle/dbscripts/crosscheck_archivelog.sh >>/home/ Oracle/dbscripts/logs/cross_check ' Date +%f_%h '. Log
First look at the generated
Cat build_del_archivelog.sh sqlplus-s shark/235619<<eofset heading offset linesize 1000set echo offset Feedback offset Timing offset termout onset trimout offset trimspool onset newpage noneselect ' rm-f ' | | Name from v\ $archived _log where applied= ' YES ' and deleted= ' NO ' and Completion_time < trunc (sysdate); Eof
The primary is to generate the physical deletion of archived logs that have been applied from V$archived_log, note that the name in ASM Disk Management does not include paths.
In addition, the spacing of each line is too large, I hope you will not hesitate to enlighten.
The resulting delete script
]head del_arch2014-05-07_08.sh rm-f/arch_backup/1_24144_831167377.log Rm-f/arch_backup/2_22765_831167377.log
Is that Y's too much line spacing.
]cat crosscheck_archivelog.sh #! /bin/bashsource/home/oracle/.bash_profileexec >>/home/oracle/dbscripts/logs/del_arch ' Date +%F_%H '. log$ Oracle_home/bin/rman target/<<eofcrosscheck archivelog all;delete noprompt expired archivelog all; #delete NoPrompt Archivelog until time ' sysdate-1 '; exit; Eof
This is the last script for the test! The annotations that were originally used to delete the archived logs.
This verification script is primarily intended to clean up archived information. Assuming this information is stored in the control file, DG can't be deleted.
ORACLE 11G Single Instance disk File System DG archive log Delete script based on Red HAT LINUX 5.3 X86 64BIT