Creating job, ran successfuly, but not seen on dba_scheduler_jobs

555329
    Hello working on 10g standard Edition on windows, I'm created an inline job but to execute an OS commend, but this doesn't show up why?

    conn dev@souceb


    Example:
    begin
    dbms_scheduler.create_job(job_name =>'EXEMPLE',job_type =>'executable',enabled => true,start_date => SYSTIMESTAMP,job_action =>'c:\temp\cp.cmd');
    end;
    PL/SQL procedure successfully completed.


    SQL> select job_name from dba_scheduler_jobs;

    JOB_NAME
    ------------------------------
    AUTO_SPACE_ADVISOR_JOB
    GATHER_STATS_JOB
    FGR$AUTOPURGE_JOB
    PURGE_LOG
    RLM$SCHDNEGACTION
    RLM$EVTCLEANUP
    RS_RESTRICT_ACCESS_90DAYS_JOB


    the job EXEMPLE doesn't show up, and when Itry to launch the job, I have the following error

    EXEC DBMS_SCHEDULER.RUN_JOB('EXEMPLE',TRUE);

    ERROR at line 1:
    ORA-27475: "DEV.EXEMPLE" 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

    Could someone helps me for this?

    Thanks
      • 1. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
        OrionNet
        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).
        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');
        Regards

        Edited by: OrionNet on May 6, 2009 3:28 PM
        • 2. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
          677340
          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
            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
              does this exist: 'c:\temp\cp.cmd'?
              • 5. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
                OrionNet
                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
                  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
                    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
                      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
                        Hello,

                        Once again your job create/failed and dropped

                        Try this
                        BEGIN
                           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;
                        Edited by: OrionNet on May 6, 2009 4:15 PM
                        • 10. Re: Creating job, ran successfuly, but not seen on dba_scheduler_jobs
                          555329
                          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
                            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
                              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
                                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
                                  have you given CREATE EXTERNAL JOB to the user trying to run the job? Maybe try that and see if it makes any difference.
                                  1 2 上一个 下一个