当前位置:网站首页>DataGuard active / standby cleanup archive settings

DataGuard active / standby cleanup archive settings

2022-07-07 23:44:00 Joyce. Du

cat /rmancc/shell/rmanlog.sh

#!/bin/sh

export ORACLE_SID=cc

rman target / <<EOF

run{

sql 'alter system archive log current' ;

backup format '/rmancc/%d_log_%T_%U' archivelog until time 'sysdate' delete all input ;

delete noprompt obsolete;

}

quit;

EOF

cat /rmancc/shell/rmanlog_clear.sh

#!/bin/sh

export ORACLE_SID=cc

rman target / <<EOF

run{

crosscheck archivelog all;

delete noprompt expired archivelog all;

delete noprompt archivelog  until time 'sysdate';

}

quit;

EOF

PR End :

root crontab clear archivelog part :

0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog.sh" 1>>/rmancc/shell/rmanlog.log 2>>/rmancc/shell/rmanlog.err

#0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog_clear.sh" 1>>/rmancc/shell/rmanlog_clear.log 2>>/rmancc/shell/rmanlog_clear.err

DR End :

root crontab clear archivelog part :

#0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog.sh" 1>>/rmancc/shell/rmanlog.log 2>>/rmancc/shell/rmanlog.err

0,30 * * * * su - oracle -c "/rmancc/shell/rmanlog_clear.sh" 1>>/rmancc/shell/rmanlog_clear.log 2>>/rmancc/shell/rmanlog_clear.err

When disaster recovery is switched , Need to put PR Terminal crontab To DR Terminal crontab;

take DR Terminal crontab To PR Terminal crontab;

Return to the original after failback crontab

Be careful :

(1) When dr Of mrp The process didn't start , But the database plays (tnsname through ),pr The archiving of will be done by pr Of lns Normal transmission to dr, here dr The archive deletion script of cannot delete an archive that is not applied , An error is as follows :

RMAN-08137: warning: archived log not deleted, needed for standby or upstream capture process

therefore dr The archive directory of is easy to fill , once dr The archive directory of is full , It will lead to pr Unable to continue transferring archives , Which leads to pr The archive on the end cannot be deleted normally , When deleting, it will also report RMAN-08137: warning: archived log not deleted, needed for standby or upstream capture process, Finally lead to pr Archive full , Cause trouble ;

(2) If dr Monitoring exception of ,pr Cannot transfer archive to dr,pr Cannot backup and delete normally

原网站

版权声明
本文为[Joyce. Du]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207072124330429.html