Wednesday, October 24, 2007

HOW TO RUN A SQL PLUS SCRIPT FROM A CRON JOB

PURPOSE:
========
HOW TO RUN A SQL PLUS SCRIPT FROM A CRON JOB.

SCOPE & APPLICATION:
=====================
This article is intended for an audience having knowledge about unix and sql.

EXPLANATION:
============
Cron is a mechanism for planning and scheduling batch jobs. The daemon "crond" is started automatically on system boot up. It runs one check per minute to see if there are any jobs to execute. The list of jobs to execute is created by the program "crontab".

Entering the command "crontab -l" will display a list of current entries. By default, only entries owned by the logged in user will be displayed.
Existing lists can be removed/deleted with command "crontab -r".

To create a new list, it is recommended to read the entries from a file using the command

"crontab filename".

To run a sql script, create a file (for ex: script1.ksh) containing the sql commands. Now use the following crontab entry.

#The following entry will execute the script 1.ksh every hour.
0 12 * * * $ORACLE_BASE/admin/scripts/snap.ksh

This entry consists of six parameters. The first five parameters define the time schedule, whereas the sixth parameter contains the command for executing the job.
This command consists of:

- the full path and file name of the script - an argument

Parameters defining the time schedule are:

minute(0-59)
hour(0-23)
day of month(1- 31)
month(1-12)
day of week(0-6) 0 = Sun

Hence, the above sample entry: 0 12 * * * can be translated as:

If Minute = 0 and Hour = 12, the script will be executed.

Because the last three scheduling parms are defined by the wildcard character
"*", the job will be executed every day.

REFERENCES:
===========
For further explanations under Unix enter the following commands:

man crontab
man 5 crontab
man cron

28 comments:

Anonymous said...

Can anyone recommend the robust Remote Management tool for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: [url=http://www.n-able.com] N-able N-central software monitoring
[/url] ? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

Hi there! Do you know if they make any plugins to safeguard against hackers?
I'm kinda paranoid about losing everything I've worked
hard on. Any tips?

Here is my page: planet fitness gym
Also see my web site > fitness quest ab lounge 2 Abdominal exerciser

Anonymous said...

whoah this weblog is magnificent i like reading your articles.
Stay up the great work! You recognize, lots of individuals are hunting around for this information, you can help
them greatly.

my web site: exercises to improve vertical

Anonymous said...

Ahaa, its pleasant discussion concerning this article at this place at this blog, I have read
all that, so at this time me also commenting here.

my web page ... workouts to improve vertical jump

Anonymous said...

Just desire to say your article is as amazing. The clarity
for your publish is just great and that i can assume you are an expert on this subject.
Fine with your permission allow me to snatch your feed to stay up to date with coming near near post.
Thanks a million and please carry on the enjoyable work.

Visit my webpage: designer kleidung billig

Anonymous said...

I loved as much as you'll receive carried out right here. The sketch is attractive, your authored subject matter stylish. nonetheless, you command get bought an shakiness over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this increase.

my web site ... best Affiliate networks

Anonymous said...

Way cool! Some very valid points! I appreciate you
penning this write-up plus the rest of the website is also really
good.

my web site - private consolidation student loans

Anonymous said...

Great article.

Feel free to visit my page; find a home loan with bad credit

Anonymous said...

Way cool! Some very valid points! I appreciate you writing this write-up plus the rest of the website is extremely
good.

Also visit my homepage - marken mode billig

Anonymous said...

I do not even know how I ended up here, but I thought this
post was great. I do not know who you are but definitely you're going to a famous blogger if you aren't already ;) Cheers!


Feel free to surf to my weblog 100 ltv home equity loan

Anonymous said...

I visited multiple sites except the audio feature for audio songs
current at this site is truly marvelous.

My homepage: http://www.breakthroughthemovie.com/community/members/mollypark/activity/82654

Anonymous said...

I could not reѕist commenting. Verу wеll written!


Hеre is my wеb blog: bad credit long term loans

Anonymous said...

I ωill immеdiately clutch your rss as
I cаn nоt іn finԁing yоur еmaіl subѕcгiptіоn link oг newslеtter sегvісе.
Dο you've any? Kindly permit me recognise so that I may subscribe. Thanks.

Also visit my site; long term loans for people with poor credit

Anonymous said...

Whoa! This blog looks exactly like my old one! It's on a totally different topic but it has pretty much the same layout and design. Superb choice of colors!

Here is my web blog ... waist to hip ratio

Anonymous said...

I sеriοusly love your ωebsitе.
. Great сolours & theme. Did уou create this web ѕitе yourѕelf?
Plеase reply back as I'm attempting to create my own website and would like to learn where you got this from or what the theme is called. Many thanks!

Visit my site http://dl.free.fr

Anonymous said...

hello!,Ι гeally like your writing sο
so much! Cаn we κeep in touch more regarding your
аrticle οn digg? I requіre аn expert оn this spacе
tо unravеl my prοblem. Mаybe that's you! Taking a look ahead to look you.

Have a look at my blog post - columbo.in

Anonymous said...

If you wish for to grow your know-how simply keep visiting this site and be updated with the most recent information posted here.


Feel free to surf to my weblog Adorna Breast Enhancement Supplement

Anonymous said...

Thanks for sharing such a fastidious opinion, article is good, thats why i have
read it completely

my web-site workouts to increase vertical

Anonymous said...

Hello to all, since I am really keen of reading this blog's post to be updated regularly. It carries pleasant information.

Take a look at my page ... canfriends.com

Anonymous said...

Hello colleagues, how is everything, and what you wish for to say about this paragraph, in my view its
in fact awesome for me.

Also visit my web blog ... vertical leap exercises

Anonymous said...

If you are going for finest contents like me, just
visit this site every day because it offers quality contents, thanks

my site; workouts to increase vertical Jump

Anonymous said...

Why visitors still make use of to read news papers when in this
technological world all is accessible on web?


Check out my website; Www.mypatroncard.com

Anonymous said...

Hello friends, its fantastic paragraph about educationand entirely explained, keep
it up all the time.

My web page :: http://articleinternet.info/Several-Good-Suggestions-For-Improving-Your-Vertical-Jump.htm

Anonymous said...

My partner and I stumbled over here by a different web address and thought I
might check things out. I like what I see so i am just following
you. Look forward to finding out about your web page
again.

My website workouts to improve vertical

Anonymous said...

Hello! I just wanted to ask if you ever have any
problems with hackers? My last blog (wordpress) was hacked and I
ended up losing several weeks of hard work due to no back up.

Do you have any methods to prevent hackers?


my web page; exercises for vertical

Anonymous said...

Thanks for sharing your thoughts on first health of the carolinas
hospitals. Regards

Also visit my web page; exercises for vertical jump

Xia Zhang said...

http://www.shopbestgoods.com/
http://www.bestcustomsonline.com/
http://www.nike-jordanshoes.com/
http://www.polo-tshirts.com/
http://www.burberry-factory.com/
http://www.kate-spades.com/
http://www.barbour-factory.com/
http://www.coachlosangeles.com/
http://www.official-coachoutlet.com/
http://www.louisvuittonas.com/
http://www.burberryoutlet2014.com/
http://www.official-mkoutlet.com/
http://www.official-pradaoutlet.com/
http://www.beatsbydreoutlet.net/
http://www.michaelkorsonlineusa.com/
http://www.northsclearance.com/
http://www.ralph-laurensale.com/
http://www.gucci-shoesuk2014.com/
http://www.michael-korsusa.com/
http://www.polo-outlets.com/
http://www.hermes-outletonline.com/
http://www.ralphslauren.co.uk/
http://www.marcjacobsonsale.com/
http://www.mcmworldwides.com/
http://www.warmbootssale.com/
http://www.salongchamppairs.com/
http://www.canada-gooser.com/
http://www.michaelkors.so/
http://www.oakley-sunglassoutlet.com/
http://www.north-faceoutlets.net/
http://www.moncler-clearance.com/
http://www.woolrich-clearance.com/
http://www.barbour-jacketsoutlet.com/
http://www.moncler-jacketsoutletonline.com/
http://www.monsterbeatsbydres.net/
http://www.lv-guccishoesfactory.com/
http://www.cheapdiscountoutlet.com/
http://www.coachsfactoryoutlet.com/
http://www.coach-blackfriday2014.com/
http://www.coach-storeoutletonline.com/
http://www.coach-factorysoutletonline.com/
http://www.coachccoachoutlet.com/
http://www.coach-factories.net/
http://www.coach-pursesoutletonline.com/
http://www.coach-outletsusa.com/
http://www.zxcoachoutlet.com/
http://www.mischristmas.com/
http://www.misblackfriday.com/
http://www.newoutletonlinemall.com/
http://www.ralphlaurenepolo.com/
http://michaelkorsoutlet.mischristmas.com/
http://mcmbackpack.mischristmas.com/
http://monsterbeats.mischristmas.com/
http://northfaceoutlet.mischristmas.com/
http://mk.misblackfriday.com/
http://coachoutlet.misblackfriday.com/
http://coachfactory.misblackfriday.com/
http://uggaustralia.misblackfriday.com/
http://coachpurses.misblackfriday.com/
http://coachusa.misblackfriday.com/
http://coach.misblackfriday.com/
http://michaelkorss.misblackfriday.com/
http://michaelkors.misblackfriday.com/
http://airmax.misblackfriday.com/
http://michael-kors.misblackfriday.com/
https://twitter.com/CoachOutlet2014
https://www.facebook.com/coachoutletstoreonline
https://www.facebook.com/ralphlaurenoutletonline

dong dong23 said...

louis vuitton handbags
coach outlet
hollister clothing
ray-ban sunglasses
adidas shoes
kevin durant shoes 8
rolex submariner
christian louboutin outlet
tiffany outlet
air max 90
gucci
michael kors handbags
cheap ray ban sunglasses
nike outlet store
louis vuitton outlet
air jordan retro
jordan 11s
jordan 3
cheap jordans
true religion
polo ralph lauren
louis vuitton outlet
tory burch outlet
louis vuitton outlet
cheap jordan shoes
louis vuitton handbags
fitflops sale clearance
jordan 8
oakley vault
hollister outlet
tiffany and co
timberland boots
coach outlet online
louis vuitton outlet
coach outlet
mont blanc pens
pandora jewelry
michael kors handbags
nike roshe runs
true religion jeans
20166.4wengdongdong