Using the Windows Job Scheduler SCHTASKS.EXE
The SCHTASKS
command was introduced in Windows XP and Windows 2003 as a
more flexible and slightly more verbose replacement for the
AT command.
The AT command is still available for backwards
compatibility, but it is no longer the preferred command
line scheduling method.
The
SCHTASKS
command provides a command line API for situations in which
a command line approach is preferable.
The usage notes for the
SCHTASKS
command are very comprehensive and include examples as well
as basic syntax. The
top-level usage notes are displayed below with examples
indicating how more parameter specific usage notes can be
obtained.
C:\>SCHTASKS /?
SCHTASKS /parameter [arguments]
Description:
Enables an administrator to create,
delete, query, change, run
and
end scheduled tasks on a local or
remote system. Replaces AT.exe.
Parameter List:
/Create
Creates a new scheduled task.
/Delete
Deletes the scheduled task(s).
/Query
Displays all scheduled tasks.
/Change
Changes the properties of scheduled task.
/Run
Runs the scheduled task immediately.
/End
Stops the currently running scheduled task.
/?
Displays this help/usage.
Examples:
SCHTASKS
SCHTASKS /?
SCHTASKS /Run /?
SCHTASKS /End /?
SCHTASKS /Create /?
SCHTASKS /Delete /?
SCHTASKS /Query
/?
SCHTASKS /Change /?
To schedule a job that runs the
c:\jobs\MyJob.bat script at 9:00 p.m. on
Mondays, Tuesdays, Thursdays and Fridays, the following
commands would be used:
SCHTASKS /Create /TN MyJob /TR
C:\Jobs\MyJob.bat /ST 21:00:00 /SC weekly /D MON,TUE,THU,FRI
The task will be created under
current logged-on user name ("tim_hall").
Please enter the run as password for
tim_hall: ******
SUCCESS: The scheduled task "MyJob" has
successfully been created.
Once a task is created, it can be viewed by issuing the
SCHTASKS
command with no parameters:
TaskName
Next Run Time
Status
====================================
========================
MyJob
21:00:00, 04/06/2004
Tasks that are no longer needed can be deleted using the
/delete option:
C:\>SCHTASKS /delete /TN MyJob
WARNING: Are you sure you want to remove
the task "MyJob" (Y/N )? y
SUCCESS: The scheduled task "MyJob" was
successfully deleted.
INFO: There are no scheduled tasks
present in the system.
Since some of the external schedulers available on the most
common operating systems have been presented, the following
section will focus on the internal schedulers provided by
the Oracle database.
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|