Windows usage
On Windows, this is a little easier with regard to file system security. The OracleJobscheduler
service must exist in a running state, and the user who runs this service should have the Logon as batch job
privilege.
A .bat
file cannot be run directly, but should be called as an argument of cmd.exe
, for example:
--/ BEGIN DBMS_SCHEDULER.create_job ( job_name => 'env_windows', job_type => 'EXECUTABLE', number_of_arguments => 2, job_action => 'C:\windows\system32\cmd.exe', auto_drop => FALSE, enabled => FALSE ); DBMS_SCHEDULER.set_job_argument_value('env_windows',1,'/c'); DBMS_SCHEDULER.set_job_argument_value('env_windows',2, 'd:\temp\test.bat'); end; /
This job named env_windows
calls cmd.exe
, which eventually runs the script named test.bat
that we created in d:\temp\
. When the script we want to call needs arguments, they should be listed from argument number 3
onwards.