| du365 |
Posted: Jul 29, 2003 10:26:00 AM |
Total Post: 6
Joined: Jan, 2003
|
hi,
i need to set up a cron job on unix that'll tell oracle to update a record every sunday. does anyone know how to do it?
any help would be appreciated... thanks!
|
|
|
Sabari Nath |
| Posted: Jul 29, 2003 10:40:00 AM | |
|
Total Post: 16
Joined: Jan, 2003
|
First write your sql scripts and wrap it into the shell script.
For example
# vi test.ksh
sqlplus -s scott/tiger@test <<EOF
@test.sql
EOF
After this edit the crontab file and enter one additional entry for this.
Use crontab -l to display
Use crontab -e to edit (Please be careful when using this option. I would sugges to take the backup of the existing entries if there are any: user crontab -l > crontab.log etc..)
0 1 * * * test.ksh >/dev/null
This script will run at 0 minutes and 1 AM. Use man crontab for more detailed information about the options
Vasu
|
|
|
|
|
du365 |
| Posted: Jul 29, 2003 10:59:00 AM | |
|
Total Post: 6
Joined: Jan, 2003
|
thanks for replying!
do i replace test.sql with the name of the sql script? shall i keep the '@' there?
|
|
|
|
|
Sabari Nath |
| Posted: Jul 29, 2003 03:41:00 PM | |
|
Total Post: 16
Joined: Jan, 2003
|
Yes, you should replace test.sql with your script and '@' is also required as it need to execute the sql file.
Hope it helps.
Regards,
Vasu
|
|
|
|
|
du365 |
| Posted: Jul 29, 2003 04:19:00 PM | |
|
Total Post: 6
Joined: Jan, 2003
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |