Oracle Db 19.15.0
RAC 2 nodes
Oracle Linux 8
Hello Team,
I am working on a script to delete archivelogs once space reaches 60%
I found a similar script
Shell script to monitor asm diskgroup usage (0 Bytes)How can I modify it to add rman deletion command? I guess it is the last part I modify
SELECT distinct name group_name , state state , type type ,
round(total_mb/1024) TOTAL_GB , round(free_mb/1024) free_gb ,
round((total_mb - free_mb) / 1024) used_gb ,
round((1- (free_mb / total_mb))*100, 2) pct_used from
v$asm_diskgroup where round((1- (free_mb / total_mb))*100, 2) > 60 ORDER BY name;
spool off
exit
EOF
count=`cat $logfile|wc -l`
#echo $count
if [ $count -ge 4 ];
then
rman target / <<EOF
delete noprompt archivelog until time 'sysdate-1';
fi
Thanks,
Roshan