Home » RDBMS Server » Server Administration » Scheduling shell script with 10g OMS
Scheduling shell script with 10g OMS [message #196447] Thu, 05 October 2006 06:47
Messages: 21
Registered: July 2006
Location: Delhi
Junior Member

I've a shell script which clears the trace files from all the dump_dest directories which are older than 7 days, and one more which clears the audit logs older than 2 days.

Issue is when I execute the script at the prompt its working fine I am able to delete the trace files, now when I try to configure it with OMS it's not working. The status I see is succeeded but it didn't delete any trace files.

Please let me know how can this be done, as till now I've been doing these kind of stuffs using CRON.

The script which I am using:
set +o errexit

if [[ -n $KSH_DEBUG ]] ; then
set -vx

sqlplus /nolog <<EOF
conn sys/ as sysdba
spool $HOME/dump_dest_tmp.lst
select value from v\$parameter where name like '%dump_dest' escape '\';
spool off

grep "/oracle/" $HOME/dump_dest_tmp.lst >> $HOME/dump_dest.lst
rm ~/dump_dest_tmp.lst

for path in `cat $HOME/dump_dest.lst`
find $path -name "*.trc" -mtime +7 -type f -exec /bin/rm {} \;

rm ~/dump_dest.lst
exit 0

Previous Topic: Global database Name
Next Topic: How do we find archive log is on or off
Goto Forum:

Current Time: Sun Oct 23 19:05:24 CDT 2016

Total time taken to generate the page: 0.09221 seconds