Home » RDBMS Server » Server Administration » Cron Job
Cron Job [message #57028] Thu, 15 May 2003 07:00 Go to next message
kochunni
Messages: 17
Registered: May 2003
Junior Member
Is it possible to execute a stored procedure through a cron job?
Re: Cron Job [message #57030 is a reply to message #57028] Thu, 15 May 2003 10:29 Go to previous messageGo to next message
psmyth
Messages: 81
Registered: October 2002
Member
yup!

write a ksh script that has all the environment variables (ORACLE_HOME etc) set etc and just run it as a sqlplus command within the script.

Be aware, unless you have an OPS$ set up for the user that will run the script, you will have to hard code the username/password for the sqlplus command in the script - I prefer doing that than having OPS$ accounts, and I set 'rwx for owner only' permissions on the script which is about as secure as its gonna get.

You can add useful 'extras' like emailing the output of the execution to yourself and things like that.

And if you add your own email address to the list for the user running the script in /etc/aliases (preuming your running on solaris here), you can get emailed if the cron job fails.

Have fun!
Re: Cron Job [message #57031 is a reply to message #57028] Thu, 15 May 2003 10:30 Go to previous message
psmyth
Messages: 81
Registered: October 2002
Member
yup!

write a ksh script that has all the environment variables (ORACLE_HOME etc) set etc and just run it as a sqlplus command within the script.

Be aware, unless you have an OPS$ set up for the user that will run the script, you will have to hard code the username/password for the sqlplus command in the script - I prefer doing that than having OPS$ accounts, and I set 'rwx for owner only' permissions on the script which is about as secure as its gonna get. I have seen some people put the username/password as part of entry in the crontab, but when the job is running, a 'ps -ef' will display that for all to see.

You can add useful 'extras' like emailing the output of the execution to yourself and things like that.

And if you add your own email address to the list for the user running the script in /etc/aliases (preuming your running on solaris here), you can get emailed if the cron job fails.

Have fun!
Previous Topic: Questions to Import DB in 8.1.7.4
Next Topic: about ora-29540
Goto Forum:
  


Current Time: Fri Sep 20 11:28:30 CDT 2024