I am doing a POC and and attempting to to execute the following external job on a windows installation of oracle
I am on 11g r2
job_name => 'win_command_job',
job_type => 'EXECUTABLE',
number_of_arguments => 3,
job_action => 'C:\windows\system32\cmd.exe',
auto_drop => FALSE,
enabled => FALSE);
I have setup the credentials: exec dbms_scheduler.create_credential('my_cred','oracle','Test1234'); in the current schema
I am getting the following error
ORA-27369: job of type EXECUTABLE failed with exit code: -10737409
Unfortunately, Windows error codes do not list this error...
I did a test by purposely not entering the correct password and when I did that I received the following
ORA-27369: job of type EXECUTABLE failed with exit code: The storage control blocks were destroyed.
STANDARD_ERROR="Launching external job failed: Invalid username or password""
I have the OracleJobSchedulerORCL running... though when I stop it I get the same error..
I have never run an external job on a windows box - only on a UNIX server. I struggled quite a bit to get the syntax of my command correct. I would begin with the simplest command possible and get it working first. Then you will know it is not a proplem with the Credential.
I did try to run your code using my credentials. The result was no error and no directory was created either.
My conclusion is that 'create credential' is not needed while running SQL Plus since it's already running on your local machine and outside the database. If your script will not run without under your current logon credentials then try running AS SYSDBA. Also, double check your grants for user. I did and still nothing.
The script below ran on both logins for me: user/login and user/login as sysdba.
I also changed parameter auto_drop to TRUE so the job would drop from the scheduler when the job has completed.
Although not needed I deleted the directory that the script produced between login runs, one with normal login and another with AS DYSDBA login, to make sure the code worked in both runs without using credentials.
I'm currently working on using credentials within a package which seems to working somewhat. Again, credentials do not seem to be needed while using system commands like copy, move, erase. But when it comes to an executable that I created in FoxPro (test.exe) credentials are needed and currently nothing is being created from the test.exe like it should be. Again, no errors to be found.
Sorry this doesn't solve your issue. just know there are others working through this very same issue.
A few updates...
It does matter if the directory is previously existing. I checked my logs and I did get an error if the directory is preexisting: ORA-27369: job of type EXECABLE failed with exit code: Incorrect function. STANARD_ERROR="A subdirectory or file C:\TEMP\test_dir already exists."
When trying to use the credential statements I got an error in my logs: ORA-27369: job type executable failed with exit code: -10737418.