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
ramakris
Messages: 21
Registered: July 2006
Location: Delhi
Junior Member
Hi-

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.

FYI-
The script which I am using:
--------------
del_dest_trace
--------------
set +o errexit

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

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
EOF

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

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

rm ~/dump_dest.lst
exit 0


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


Current Time: Thu Dec 08 16:37:59 CST 2016

Total time taken to generate the page: 0.09169 seconds