Sunday, July 26, 2009

managed archived log at standby database, shipped status

Agar disk tidak penuh di primary karean archivelog yang sudah di kirim ke standby, maka
anggap saja archive log tersebut sudah obsolete. Oleh karena itu archive tersebut bisa di delete atau di moving
ke tempat lain tapi khusus archive dengan status sudah dikirim ke standby. dengan menggunkan shell
script berikut :

[oracle@ora11g script]$ more checkarchive

export ORACLE_HOME=/oracle/apps/product/11.1.0/db_1
export ORACLE_SID=ORADEV
/oracle/apps/product/11.1.0/db_1/bin/sqlplus -s "/ as sysdba" '<<' EOF
set term off
set head off
set trims on
set pages 0
set feedback off
set linesize 1000
spool /oracle/home/script/checkarchtransport.txt

select name from v\$archived_log
where name is not null
and dest_id = 1
and sequence# in (
select sequence# from v\$archived_log
where name is not null
and dest_id = 2);

spool off
exit
EOF

while read i; do rm -rf "$i" ; sleep 2; done '<' checkarchtransport.txt

mudah2an bermanfaat :)

No comments:

Post a Comment