one line command to delete archive log older than 10 days for all instance currently running on the machine.
This is useful on machines that run non-production instance and there is no specific naming convention for the SID's.
ps -ef | grep ora_pmon | grep -v grep | awk '{print $8}' | awk '{gsub(/ora_pmon_/,"export ORACLE_SID=");}1' | grep -v awk | awk '{print $0,"; echo \"delete noprompt archivelog until time \x27 sysdate - 7 \x27 ;\" | rman target /;";} > del_arch.sh ; sh del_arch.sh
Regards
Manoj
This is useful on machines that run non-production instance and there is no specific naming convention for the SID's.
ps -ef | grep ora_pmon | grep -v grep | awk '{print $8}' | awk '{gsub(/ora_pmon_/,"export ORACLE_SID=");}1' | grep -v awk | awk '{print $0,"; echo \"delete noprompt archivelog until time \x27 sysdate - 7 \x27 ;\" | rman target /;";} > del_arch.sh ; sh del_arch.sh
Regards
Manoj