Home » Infrastructure » Windows » Scheduling Batch jobs in NT
Scheduling Batch jobs in NT [message #100226] Fri, 13 September 2002 12:09 Go to next message
Shanthi Subbarayan
Messages: 1
Registered: September 2002
Junior Member
Hi,

I am trying to schedule a Oracle SQL batch job on an NT machine. I am not sure how I can write the batch job and schedule it too. What I want is, to write a batch job to call a particular SQL script and execute it. The results need to be spooled to a text file. It would be great if I can have the result file emailed to me too. Once the batch job is written, how can I schedule it to run on NT? I have written shell scripts to run jobs on Unix crons. I dont know how to write batch jobs to run on NT. Thanks for all your help.

-Shanthi
Re: Scheduling Batch jobs in NT [message #100236 is a reply to message #100226] Mon, 16 September 2002 03:09 Go to previous messageGo to next message
Stewart Tebay
Messages: 9
Registered: September 2002
Junior Member
Create a file called run_sql.cmd in c:

Enter the following in the file

C:MSSQL7Binnisqlw.exe -SSQLSERVERNAME -dDATABASENAME -E -Usa -P -ic:test.sql -oc:test.txt

-S put in SQL server name
-d put in database name
-u SQL user (can use sa)
-P password
-i name of sql file
-o output file

In the c: drive create a sql file called test.sql and place your sql in this file.

Output file will be called test.txt in c:

In NT go to a command prompt

Type AT time /INTERACTIVE /EVERY:Date "c:run_sql.cmd"

This will run the file at whatever time you specify, play around at youe leisure.
To get the job to mail use use sendmail.

If you require any more just shout

Tell me how it goes

regards

Stewart
Re: Scheduling Batch jobs in NT [message #101054 is a reply to message #100236] Wed, 07 April 2004 08:03 Go to previous message
asamanja Chatterjee
Messages: 1
Registered: April 2004
Junior Member
i need to send an e-mail notification.
The condition is it will check Inspection_Date field....The notification has to be 28 day's before the inspection date.The email will be send to the inspector. After that a flag will be set that email has been sent.

we can use operating system feature of scheduling a batch job.Let say , you create a .sql file which will check if date meets
the criteria and send the notifaction.Now schedule this .sql file as OS(won 2000 professional) job which should run everyday at specific time.

Can u please help me ....what are the steps...
Previous Topic: How to download personal Oracle 8i
Next Topic: jrew errors !
Goto Forum:
  


Current Time: Fri Nov 22 13:45:52 CST 2024