Linux Operating System (MOSC)

MOSC Banner

crontab for sql script

edited May 24, 2013 1:39AM in Linux Operating System (MOSC) 10 commentsAnswered
Hi,I need set crontab for script below, but the crontab don't run for script. Can you help me!

script clear_sniped.sh with content:

touch /usr/oracle/clearsniped.log
tmpfile=/usr/oracle/clearsniped.log
sqlplus /nolog << EOF
connect hcmpmd/DBa#123456qwe
spool $tmpfile
select p.spid from v\$process p,v\$session s
where s.paddr=p.addr
and s.status='SNIPED';
spool off
EOF
for x in `cat $tmpfile | grep "^[0123456789]"`
do
kill -9 $x
done
rm $tmpfile
 
Thanks
DuyPM

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center