Windows Oracle Job Schedulers examples
Oracle Database Tips by Donald Burleson
Oracle Windows Job Schedulers examples
The AT command can be used to schedule commands
and programs on Windows NT, Windows 2000, Windows XP and Windows
2003. For the command to work, the scheduler service must be
running. On Windows 2000, this can be done using the services
dialog (Start à Programs
à Administrative Tools
à Services) or from the
command line using the net command:
stop "Task Scheduler"
start "Task Scheduler"
The at /? command produces the following:
AT [\\computername] [ [id]
[/DELETE] | /DELETE [/YES]]
AT [\\computername] time
[ /EVERY:date[,...] | /NEXT:date[,...]]
\\computername Specifies a
remote computer. Commands are scheduled on the
computer if this parameter is omitted.
id Is an
identification number assigned to a scheduled
/delete Cancels a
scheduled command. If id is omitted, all the
commands on the computer are canceled.
/yes Used with
cancel all jobs command when no further
the time when command is to run.
/interactive Allows the
job to interact with the desktop of the user
logged on at the time the job runs.
/every:date[,...] Runs the
command on each specified day(s) of the week or
date is omitted, the current day of the month
/next:date[,...] Runs the
specified command on the next occurrence of the
example, next Thursday). If date is omitted, the
of the month is assumed.
"command" Is the
Windows NT command, or batch program to be run.
A couple of simple examples of its use include:
C:> at 21:00 /every:m,t,th,f
Added a new job with job ID = 1
C:> at 6:00 /next:20 "c:\jobs\MyJob.bat"
Added a new job with job ID = 2
The first example schedules a job which runs the
c:\jobs\MyJob.bat script at 9:00 p.m. on Mondays, Tuesdays,
Thursdays and Fridays. The second example schedules a job that runs
the script at 6:00 a.m. on the next 20th of the month.
The current list of jobs can be displayed by
issuing the at command with no parameters:
Day Time Command Line
M T Th F 21:00 PM c:\jobs\MyJob.bat
20 06:00 AM c:\jobs\MyJob.bat
Jobs can be deleted using the
C:\>at 1 /delete
C:\>at 2 /delete
There are no
entries in the list.
The AT scheduler has been at the heart of
Windows scheduling for some years, but recent Windows versions have
introduced simpler and more flexible alternatives, which will be
covered in the following section.
For more details, see the book
Oracle Job Scheduling:
Creating robust task
management with dbms_job and Oracle 10g dbms_scheduler, by
Dr. Timothy Hall