1 2 Previous Next 22 Replies Latest reply: Aug 1, 2014 2:39 AM by Srinivasamurthy -Oracle RSS

    DBMS SCHEDULER JOB failed

    Pramod_Sajwan

      Hi,

       

      I have created a dbms job as shown below for export backup, It was running fine on 10g. Recently I upgraded my database to 11g. since then that job is failing. Below is the error i am receiving while executing the job via toad as it is not getting triggered on time. If any 1 faced such issue kidly suggest.

       

      BEGIN
        SYS.DBMS_SCHEDULER.RUN_JOB
          (job_name             => 'SYS.EXPORT_DATAPUMP_JOB1'
          ,use_current_session  => TRUE);
      END;

      Error at line 2
      ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
      ORA-06512: at "SYS.DBMS_ISCHED", line 185
      ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
      ORA-06512: at line 2

        • 1. Re: DBMS SCHEDULER JOB failed
          Top.Gun

          ORA-27369: job of type EXECUTABLE failed with exit code: string

          Cause: A problem was encountered while running a job of type EXECUTABLE. The cause of the actual problem is identified by the exit code.

          Action: Correct the cause of the exit code and reschedule the job.

          • 2. Re: DBMS SCHEDULER JOB failed
            Top.Gun

            So what is SYS.EXPORT_DATAPUMP_JOB1?

             

            select owner, job_name, job_type, job_action

            from DBA_SCHEDULER_JOBS

            where job_name='EXPORT_DATAPUMP_JOB1';

            • 3. Re: DBMS SCHEDULER JOB failed
              Pramod_Sajwan

              SQL> select owner, job_name, job_type, job_action
                2  from DBA_SCHEDULER_JOBS
                3  where job_name='EXPORT_DATAPUMP_JOB1';

              OWNER      JOB_NAME             JOB_TYPE             JOB_ACTION
              ---------- -------------------- -------------------- -------------------------------------------------------------
              -------------
              SYS        EXPORT_DATAPUMP_JOB1 EXECUTABLE           C:\windows\system32\cmd.exe /c I:\EXPDP\SSC_EXPDP_2.bat > nul

              • 4. Re: DBMS SCHEDULER JOB failed
                GregV

                Hi,

                 

                Can you check the DBA_SCHEDULER_JOB_RUN_DETAILS view for more information?

                SELECT additional_info

                FROM DBA_SCHEDULER_JOB_RUN_DETAILS

                WHERE job_name = 'EXPORT_DATAPUMP_JOB1';

                • 5. Re: DBMS SCHEDULER JOB failed
                  Pramod_Sajwan

                  Hi,

                   

                  Please find the output

                   

                  SQL> SELECT additional_info FROM DBA_SCHEDULER_JOB_RUN_DETAILS WHERE job_name='EXPORT

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."


                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."


                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.

                  ADDITIONAL_INFO
                  --------------------------------------------------------------------------------
                  STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
                  operable program or batch file."

                  • 6. Re: DBMS SCHEDULER JOB failed
                    Top.Gun

                    Does this work from the command line?

                     

                    $ C:\windows\system32\cmd.exe /c I:\EXPDP\SSC_EXPDP_2.bat > nul

                    • 7. Re: DBMS SCHEDULER JOB failed
                      GregV

                      Hi,

                       

                      It seems the OS user executing the external job doesn't know the expdp command. Which OS user are you using to connect to the DB?

                      • 8. Re: DBMS SCHEDULER JOB failed
                        Pramod_Sajwan

                        Hi,

                         

                        $ C:\windows\system32\cmd.exe /c I:\EXPDP\SSC_EXPDP_2.bat > nul

                         

                        this command is working fine from cmd...

                        Let me  provide you detials of my configuration earlier i was using windows server 2003 and after my os and oracle 10g to 11g ugradtion  I am using windows server 2008R2 ,configuration is  same os credential is same.

                        • 9. Re: DBMS SCHEDULER JOB failed
                          GregV

                          Hi,

                           

                          What is the contents of your .bat file?

                          • 10. Re: DBMS SCHEDULER JOB failed
                            Pramod_Sajwan

                            We are using same OS user which we were using earlier on windows 2003 with all admin rights

                            • 11. Re: DBMS SCHEDULER JOB failed
                              Pramod_Sajwan

                              Contents of .Bat file

                               

                              BEGIN
                                SYS.DBMS_SCHEDULER.CREATE_JOB
                                  (
                                     job_name        => 'EXPORT_DATAPUMP_JOB'
                                    ,start_date      => TO_TIMESTAMP_TZ('2014/05/11 01:05:00.000000 +05:30','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
                                    ,repeat_interval => 'FREQ=DAILY;BYMONTHDAY=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;BYHOUR=01;BYMINUTE=5;BYSECOND=0'
                                    ,end_date        => NULL
                                    ,job_class       => 'DEFAULT_JOB_CLASS'
                                    ,job_type        => 'EXECUTABLE'
                                    ,job_action      => 'c:\windows\system32\cmd.exe /c I:\EXPDP\SSC_EXPDP_2.bat > nul'
                                    ,comments        => NULL
                                  );
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'RESTARTABLE'
                                   ,value     => FALSE);
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'LOGGING_LEVEL'
                                   ,value     => SYS.DBMS_SCHEDULER.LOGGING_OFF);
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'MAX_FAILURES');
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'MAX_RUNS');
                                BEGIN
                                  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
                                    ( name      => 'EXPORT_DATAPUMP_JOB'
                                     ,attribute => 'STOP_ON_WINDOW_CLOSE'
                                     ,value     => FALSE);
                                EXCEPTION
                                  -- could fail if program is of type EXECUTABLE...
                                  WHEN OTHERS THEN
                                    NULL;
                                END;
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'JOB_PRIORITY'
                                   ,value     => 3);
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'SCHEDULE_LIMIT');
                                SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
                                  ( name      => 'EXPORT_DATAPUMP_JOB'
                                   ,attribute => 'AUTO_DROP'
                                   ,value     => FALSE);

                                SYS.DBMS_SCHEDULER.ENABLE
                                  (name                  => 'EXPORT_DATAPUMP_JOB');
                              END;
                              /

                              • 12. Re: DBMS SCHEDULER JOB failed
                                GregV

                                This is the job's details. Can you show what is in the SSC_EXPDP_2.bat file?

                                • 13. Re: DBMS SCHEDULER JOB failed
                                  Pramod_Sajwan

                                  expdp 'sys/password@dbname as sysdba' directory=datapump1 dumpfile='EXP_%date:~7,2%-%date:~4,2%-%date:~12,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%.dmp' logfile='EXP_%date:~7,2%-%date:~4,2%-%date:~12,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%.log' full=y

                                   

                                  this is the content in SSC_EXPDP_2.bat file

                                  • 14. Re: DBMS SCHEDULER JOB failed
                                    GregV

                                    Thanks,

                                     

                                    So does it work when you run this directly from the windows command line with the same OS user as the one who starts the DB?

                                    1 2 Previous Next