Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

asm bash script

RobeenNov 26 2022

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

Comments
Post Details
Added on Nov 26 2022
0 comments
240 views