This content has been marked as final.
Show 18 replies
-
1. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
OrionNet May 6, 2009 7:30 PM (in response to 555329)Hello,
You need to changed start_date to some future date e..g sysdate + 1. As you are scheduling with current time stamp and it fails and drops (AUTO_DROP=TRUE).
Regardsexec dbms_scheduler.create_job(job_name =>'EXEMPLE',job_type =>'executable',enabled => true, auto_drop=> FALSE, start_date => SYSDATE+1,job_action =>'c:\temp\cp.cmd');
Edited by: OrionNet on May 6, 2009 3:28 PM -
2. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
677340 May 6, 2009 7:29 PM (in response to 555329)I think because as you said, it is an inline creation and no schedule. You should still be able to see your results in the run details if you want to monitor for completion. -
3. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
555329 May 6, 2009 7:40 PM (in response to 677340)I tried this ans it was ok.
exec dbms_scheduler.create_job(job_name =>'EXEMPLE',job_type =>'executable',enabled => true, auto_drop=> FALSE, start_date => SYSDATE+1,job_action =>'c:\temp\cp.cmd');
But when I ran the job I got the following error:
SQL>
SQL> EXEC DBMS_SCHEDULER.RUN_JOB('EXEMPLE',TRUE);
BEGIN DBMS_SCHEDULER.RUN_JOB('EXEMPLE',TRUE); END;
*
ERROR at line 1:
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing execution agent failed with
status: 2
ORA-27301: OS failure message: The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
What may be the reason?
Thanks again -
4. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
677340 May 6, 2009 7:43 PM (in response to 555329)does this exist: 'c:\temp\cp.cmd'? -
5. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
OrionNet May 6, 2009 7:46 PM (in response to 555329)Hello,
This is an external job and you have to use *"cmd" and pass your script as an argument.*
Regards -
6. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
555329 May 6, 2009 7:48 PM (in response to OrionNet)yes the c:\temp\cp.cmd really exist, and I don't know why it's not seen? -
7. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
677340 May 6, 2009 7:55 PM (in response to 555329)Ok..OrionNet got it...here is an example...tailor it to your stuff and give it a try.
begin
dbms_scheduler.create_job('myjob',
job_action=>'C:\WINDOWS\SYSTEM32\CMD.EXE',
number_of_arguments=>1,
job_type=>'executable', enabled=>False);
dbms_scheduler.set_job_argument_value('myjob',1,'c:\temp\test.bat');
dbms_scheduler.enable('myjob');
end;
/ -
8. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
555329 May 6, 2009 8:09 PM (in response to 677340)This is what I'm getting as error, any idea?
SQL> begin
2 dbms_scheduler.create_job('myjob',
3 job_action=>'C:\WINDOWS\SYSTEM32\CMD.EXE',
4 number_of_arguments=>1,
5 job_type=>'executable', enabled=>False);
6 dbms_scheduler.set_job_argument_value('myjob',1,'c:\temp\cp.bat');
7 dbms_scheduler.enable('myjob');
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> EXEC DBMS_SCHEDULER.RUN_JOB ('myjob');
BEGIN DBMS_SCHEDULER.RUN_JOB ('myjob'); END;
*
ERROR at line 1:
ORA-27475: "DEV.MYJOB" must be a job
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
Thanks -
9. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
OrionNet May 6, 2009 8:15 PM (in response to 555329)Hello,
Once again your job create/failed and dropped
Try this
Edited by: OrionNet on May 6, 2009 4:15 PMBEGIN DBMS_SCHEDULER.create_job ('myjob', job_action => 'C:\WINDOWS\SYSTEM32\CMD.EXE', number_of_arguments => 1, start_date=> sysdate+1, auto_drop=>FALSE, job_type => 'executable', enabled => FALSE ); DBMS_SCHEDULER.set_job_argument_value ('myjob', 1, 'c:\temp\cp.bat'); DBMS_SCHEDULER.enable ('myjob'); END;
-
10. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
555329 May 6, 2009 8:31 PM (in response to OrionNet)Thank you very much, but when i run the job it ran fine:
SQL> EXEC DBMS_SCHEDULER.RUN_JOB ('MYJOB',TRUE);
PL/SQL procedure successfully completed.
but there is no result on what I'm seeking, the following is the contents of the cp.bat
copy c:\temp\sqlnet.log c:\temp\temp\
there is a reason for that?
Thanks enough -
11. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
OrionNet May 6, 2009 8:37 PM (in response to 555329)Hello,
Check the failure_count for this job under user_scheduler_jobs and run your script manually to see if it really work and suppose to do what it's in there.
Hope this helps.
Regards -
12. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
555329 May 6, 2009 9:11 PM (in response to OrionNet)I don't what really is going on with my system but the creation of the job works fine, but I'm getting this error:
SQL> EXEC DBMS_SCHEDULER.RUN_JOB ('MYJOB');
BEGIN DBMS_SCHEDULER.RUN_JOB ('MYJOB'); END;
*
ERROR at line 1:
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing execution agent failed with
status: 2
ORA-27301: OS failure message: The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
other reason gotten from the dba_scheduler_job_run_details:
select status,run_duration,session_id,additional_info from dba_SCHEDULER_JOB_RUN_DETAILS where job_name='MYJOB';
ORA-27370: job slave failed to launch a job of type
EXECUTABLE
ORA-27300: OS system dependent operation:accessing
execution agent failed with status: 2
ORA-27301: OS failure message:
The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cann
ot find the file specified.
Any tips?
Thanks -
13. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
555329 May 6, 2009 9:13 PM (in response to OrionNet)I'm getting the following errors:
SQL> EXEC DBMS_SCHEDULER.RUN_JOB ('MYJOB');
BEGIN DBMS_SCHEDULER.RUN_JOB ('MYJOB'); END;
*
ERROR at line 1:
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing execution agent failed with
status: 2
ORA-27301: OS failure message: The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
select status,run_duration,session_id,additional_info from dba_SCHEDULER_JOB_RUN_DETAILS where job_name='MYJOB';
ORA-27370: job slave failed to launch a job of type
EXECUTABLE
ORA-27300: OS system dependent operation:accessing
execution agent failed with status: 2
ORA-27301: OS failure message:
The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cann
ot find the file specified.
Any tips?
Thanks -
14. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
677340 May 7, 2009 12:51 PM (in response to 555329)have you given CREATE EXTERNAL JOB to the user trying to run the job? Maybe try that and see if it makes any difference.