View Single Post
  #3 (permalink)  
Old 01-05-04, 11:43
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,229
Quote:
Originally posted by fla5do
Hi,
I dont know how to use crontab exactly on AIX. But I think it is realy the same as SCO Unix.

unload your crontab by using "crontab -l > mycron"
Now edit the file mycron and append following row.
30 1 * * 1 /usr/myProc/procSample.sql
It means : execute the procSample.sql every Monday at 1:30 .
...only it won't work since you can't ask shell to execute an sql script. You'll need to invoke sqlplus to run the script.

1) type "crontab -e" to edit cron table: this will launch your visual editor (I guess default would be vi)
2) create an entry in it similar to this:
30 1 * * 1 . /home/yourloginid/.profile;sqlplus @/usr/myProc/procSample.sql
3) save the cron table
4) enjoy.

Please note that you have to execute your profile explicitly before attempting to run sqlplus (assuming your profile contains all necessary Oracle environment variables).
Reply With Quote