This content has been marked as final. Show 6 replies
Hello;1 person found this helpful
Welcome to the Forum.
You have 3 options.
1. Delete the archive at the OS level using a command like "rm" or "del" ( you will still need to run CROSSCHECK if any RMAN is used, if no RMAN then omit the CROSSCHECK)
$ORACLE_HOME/bin/sqlplus /nolog <<EOF connect / as sysdba @/u01/app/oracle/dba_tool/bin/removestandbyarch.sql SPOOL OFF EOF echo "Setting permissions and running script" chmod 740 /u01/app/oracle/dba_tool/bin/rm_arch_standby.sh . /u01/app/oracle/dba_tool/bin/rm_arch_standby.sh #####If using RMAN continue with echo `date` echo "Runnung RMAN archive crosscheck" $ORACLE_HOME/bin/rman <<EOF connect target / crosscheck archivelog all; delete noprompt expired archivelog all; exit EOF
2. Have RMAN remove the archive.
SET echo off SET feedback off SET term off SET pagesize 0 SET linesize 200 SET newpage 0 SET space 0 col name format a120 spool /u01/app/oracle/dba_tool/bin/rm_arch_standby.sh select 'rm '||NAME from v$archived_log where REGISTRAR='RFS' and APPLIED='YES' and DELETED='NO' and COMPLETION_TIME < (SYSDATE-10); SPOOL OFF
3. Setup FRA and let Oracle handle it.
delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-8';
Hi,1 person found this helpful
a very good way is to let it Oracle handle.
So you configure and setup a flash recovery area.
Then Oracle will handle it for you.
If you use a DR with Oracle Data Guard then it is also possible to handle it via RMAN.
Take a look in RMAN with "show all" and set the deletion policy like this.
CONFIGURE ARCHIVELOG DELETION POLICY TO applied on standby;
Is it necessary to use FRA, I mean won't RMAN be able to take care if we are using FS as location for archive logs?
My question is
After I set "CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY" in both PRIMARY and STANDBY
can RMAN take care of deleting archive logs only after it gets applied on the standby?
If yes please let me know the correct statement to be used
crosscheck archivelog all;
delete noprompt expired archivelog all;
Hello again;1 person found this helpful
You probably don't need the "crosscheck archivelog all". Unless you delete outside of RMAN you don't need to crosscheck that often.
crosscheck archivelog all; delete noprompt expired archivelog all;
DELETE ARCHIVELOG ALL relies entirely on the configured archived redo log deletion policy. So this is OK.
You can use "list expired backup all" to check.
Thanks very much,
I'm little confused,
can you tell me if I should configure the RMAN in Primary and Standby or both
can you tell me where I should run the delete archivelog all - Primary or Standby
can you tell me if I should configure the RMAN in Primary and Standby or both.
Now you only register RMAN on the Primary since the Standby has the same DBID you cannot register it, as it is already registered.
How you configure depends upon where the backup is taken. If you backup from the Primary for example you want either of these set
configure archivelog deletion policy to applied on all standby;
configure archivelog deletion policy to shipped to all standby;
There's an RMAN best Practices for Data Guard here that details very well :