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

 

posted @ 2019-01-16 15:17  slnngk  阅读(433)  评论(0编辑  收藏  举报