dataguard从库删除归档的例子

deletearchlog.sh

#!/bin/sh

export PATH
TABLE='v$archived_log'
sqlplus -silent "/ as sysdba" <<EOF > /home/oracle/script/deleteorclarch.sh
set heading off;
set pagesize 0;
set term off;
set feedback off;
set linesize 32767;
select 'rm -rf '||name from ${TABLE}  where DELETED='NO' and APPLIED='YES'and COMPLETION_TIME<=sysdate-16/24;
exit;
EOF
sh /home/oracle/script/deleteorclarch.sh
rman target /<<END
crosscheck archivelog all;
delete noprompt expired archivelog all;
exit;
END
原文地址:https://www.cnblogs.com/hxlasky/p/10277179.html