Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Oracle on Unix/Linux >> Cron job

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Cron job
 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






 
thanks a lot!

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar856
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gitesh Trivedi322
  Gopu Gopi281
  neeraj sharma254
  Ramesh Jois245
  Bishal Khetan207






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software