Job execution problem

Hi,
I have procedure p1.
I want to execute it through scheduler where interval could be daily.
BEGIN
DBMS_SCHEDULER.create_job
( job_name => 'emp_job',
job_type => 'PLSQL_BLOCK',
job_action => 'begin pack.p1;commit;end;',
repeat_interval => 'FREQ=daily',
enabled => TRUE,
comments => 'Auto Refresh'
END;
it executed successfully but pack.p1 not executed but if i run exec pack.p1 it is working fine ]
Please help me what is missing here.
Regards

Can you please run this below snippet
BEGIN
   DBMS_SCHEDULER.create_job (job_name => 'emp_job',
                              job_type          => 'PLSQL_BLOCK',
                              job_action        => 'begin pack.p1;commit;end;',
                              repeat_interval   => 'FREQ=DAILY; BYHOUR=6;',
                              enabled           => TRUE,
                              comments          => 'Auto Refresh');
END;
Check what you see as output with the below query.
select state from dba_scheduler_jobs where job_name = 'EMP_JOB';
If it shows 'Scheduled' then its fine.. All this stuff is beatifully depicted in the link I gave u in my earlier post.
To run the job right away and check, execute the below:
BEGIN
   DBMS_SCHEDULER.run_job ('emp_job', FALSE);
END;
Also can you add a proper exception handler in that job_action block.
Cheers,
Manik.

Similar Messages

  • Schedule Job Execution problem

    Hi All,
    The schedule jobs are taking more time.... to complete
    We have schdule jobs which will run for every hour,soo to execute the job sometimes it is taking 1hr and sometime 30mins
    please help me to have the Job execution total time to be constant to near 30mins.

    preethi wrote:
    Hi All,
    The schedule jobs are taking more time.... to complete
    We have schdule jobs which will run for every hour,soo to execute the job sometimes it is taking 1hr and sometime 30mins
    please help me to have the Job execution total time to be constant to near 30mins.Thread: HOW TO: Post a SQL statement tuning request - template posting
    HOW TO: Post a SQL statement tuning request - template posting

  • Error on 11g 2 during external job execution using credential

    Hi,
    I need a help from you.
    I am getting below error on 11g 2 during external job execution using credentials -
    EXTERNAL_LOG_ID="job_805812_412409",
    ORA-27369: job of type EXECUTABLE failed with exit code: Arg list too long
    STANDARD_ERROR="Launching external job failed: Invalid username or password"
    Find credentials creation & other required details -
    EXECUTE DBMS_SCHEDULER.create_credential(credential_name =>'SYS.SCRIPTS',username =>'scripts',password => 'u5342222');
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB(
    job_name => 'AUTOLOAD_JOB',
    job_type => 'EXECUTABLE',
    job_action => '/qpshell/dev/scripts/autoload.sh',
    repeat_interval => 'freq=MINUTELY;interval=5;byhour=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22;',
    enabled => true,
    auto_drop => false,
    credential_name => 'SYS.SCRIPTS');
    end;
    -rw-r--r-- 1 root oinstall 1571 Nov 11 14:42 /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/externaljob.ora
    content of externaljob.ora -
    run_user = nobody
    run_group = nobody
    run_user=scripts
    run_group=qvcscript
    -rwsr-x--- 1 root oinstall 3068424 Nov 11 13:13 extjob
    -rwxr-xr-x 1 oracle oinstall 3068424 Nov 11 13:13 extjobo
    root@knudwdbs2:/u01/app/oracle/product/11.2.0/dbhome_1/bin> ls -ltr extjob*
    -rwx------ 1 oracle oinstall 3068424 Nov 11 12:45 extjoboO
    -rwsr-x--- 1 root oinstall 3068424 Nov 11 12:45 extjobO
    -rwxr-xr-x 1 oracle oinstall 3068424 Nov 11 13:13 extjobo
    -rwsr-x--- 1 root oinstall 3068424 Nov 11 13:13 extjob
    Kindly suggest how it can be fixed. Early response much appreciated.
    Thanks
    Ajay
    --

    Hi,
    When you are logged in to the OS, can you do an "su" to the "scripts" user using this exact password (passwords are case-sensitive) ?
    Also make sure that you have libpam.so located somewhere in $LD_LIBRARY_PATH and that it points to a real file.
    external jobs with credentials use jssu, but I don't think permissions on jssu are the problem here (it should be setuid to root).
    Hope this helps,
    Ravi.

  • Background job scheduling problem

    Hai..Can anyone check the below program and correct it.
    I am unable to see the output in SP01 (SPOOL REQUEST)
    MY PROGRAM:-
    REPORT  zh_test4.
    TABLES : mara, TBTCO.
    DATA : BEGIN OF itab OCCURS 0,
          matnr LIKE mara-matnr,
          END OF itab.
    ****background data declarations
    data : job_name like TBTCO-JOBNAME.
    data : job_num like TBTCO-JOBCOUNT,
           rep like sy-repid.
    ***selection screen
    PARAMETERS : p_matnr LIKE mara-matnr default '1500-610'.
    SELECT matnr FROM mara INTO TABLE itab WHERE matnr EQ p_matnr.
    job_name = 'HARI'.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
      DELANFREP              = ' '
      JOBGROUP               = ' '
        jobname                = job_name
      SDLSTRTDT              = NO_DATE
      SDLSTRTTM              = NO_TIME
    IMPORTING
       jobcount               = job_num
    EXCEPTIONS
       CANT_CREATE_JOB        = 1
       INVALID_JOB_DATA       = 2
       JOBNAME_MISSING        = 3
       OTHERS                 = 4
    IF sy-subrc <> 0.
    write :/ ' Job opening problem'.
    else.
    write :/ 'Job succesfully opened', sy-subrc.
    ENDIF.
    MOVE SY-UNAME TO TBTCO-AUTHCKNAM.
    rep = sy-repid.
    job_name = 'HARI'.
    CALL FUNCTION 'JOB_SUBMIT'
      EXPORTING
      ARCPARAMS                         =
        authcknam                         = SY-UNAME
        jobcount                          = job_num
        jobname                           = job_name
      LANGUAGE                          = SY-LANGU
      PRIPARAMS                         = ' '
       REPORT                            = 'ZH_TEST4'
      VARIANT                           = 'VAR'
    IMPORTING
      STEP_NUMBER                       =
    EXCEPTIONS
       BAD_PRIPARAMS                     = 1
       BAD_XPGFLAGS                      = 2
       INVALID_JOBDATA                   = 3
       JOBNAME_MISSING                   = 4
       JOB_NOTEX                         = 5
       JOB_SUBMIT_FAILED                 = 6
       LOCK_FAILED                       = 7
       PROGRAM_MISSING                   = 8
       PROG_ABAP_AND_EXTPG_SET           = 9
       OTHERS                            = 10
    IF sy-subrc <> 0.
    WRITE :/ 'JOB SUBMIT PROBLEM',
              job_name,
              job_num,
              rep,
              sy-subrc.
    else.
    write :/ 'Job succesfully submitted in background', sy-subrc.
    ENDIF.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount                          = job_num
        jobname                           = job_name
      LASTSTRTDT                        = NO_DATE
      LASTSTRTTM                        = NO_TIME
      PRDDAYS                           = 0
      PRDHOURS                          = 0
      PRDMINS                           = 0
      PRDMONTHS                         = 0
      PRDWEEKS                          = 0
      PREDJOB_CHECKSTAT                 = ' '
      PRED_JOBCOUNT                     = ' '
      PRED_JOBNAME                      = ' '
      SDLSTRTDT                         = datum
      SDLSTRTTM                         = uzeit
      STARTDATE_RESTRICTION             = BTC_PROCESS_ALWAYS
       STRTIMMED                         = 'X'
      TARGETSYSTEM                      = ' '
      START_ON_WORKDAY_NOT_BEFORE       = SY-DATUM
      START_ON_WORKDAY_NR               = 0
      WORKDAY_COUNT_DIRECTION           = 0
      RECIPIENT_OBJ                     =
      TARGETSERVER                      = ' '
      DONT_RELEASE                      = ' '
      TARGETGROUP                       = ' '
    IMPORTING
      JOB_WAS_RELEASED                  = 'X'.
    EXCEPTIONS
       CANT_START_IMMEDIATE              = 1
       INVALID_STARTDATE                 = 2
       JOBNAME_MISSING                   = 3
       JOB_CLOSE_FAILED                  = 4
       JOB_NOSTEPS                       = 5
       JOB_NOTEX                         = 6
       LOCK_FAILED                       = 7
       INVALID_TARGET                    = 8
       OTHERS                            = 9
    IF sy-subrc <> 0.
    write :/ 'Unable to close the Job', rep, sy-subrc.
    else.
    write :/ 'Succesfully closed the job', sy-subrc.
    ENDIF.

    Here is an example, slightly different from your version.
    REPORT ztest.
    PARAMETERS: p_vbeln LIKE vbak-vbeln,
                p_bkrun NO-DISPLAY.
    DATA: ls_vbak LIKE vbak.
    DATA: v_answer,
          v_jobcount LIKE tbtcjob-jobcount.
      IF p_bkrun IS INITIAL.
    *-- not background processing
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
                  textline1      = 'This may time out.'
                  textline2      = 'Do you want to run in background?'
                  titel          = 'Warning!!!'
                  cancel_display = space
             IMPORTING
                  answer         = v_answer.
        IF v_answer = 'J'.
    *-- run in the background
          CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                    jobname          = 'ZTEST'
               IMPORTING
                    jobcount         = v_jobcount
               EXCEPTIONS
                    cant_create_job  = 1
                    invalid_job_data = 2
                    jobname_missing  = 3
                    OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            EXIT.
          ENDIF.
    *-- submit the program in the background
          SUBMIT ztest
            WITH p_bkrun = 'X'
            WITH p_vbeln = p_vbeln
            USER sy-uname
            VIA JOB 'ZTEST' NUMBER v_jobcount AND RETURN.
    *-- close the job
          CALL FUNCTION 'JOB_CLOSE'
               EXPORTING
                    jobcount             = v_jobcount
                    jobname              = 'ZTEST'
                    strtimmed            = 'X'
               EXCEPTIONS
                    cant_start_immediate = 1
                    invalid_startdate    = 2
                    jobname_missing      = 3
                    job_close_failed     = 4
                    job_nosteps          = 5
                    job_notex            = 6
                    lock_failed          = 7
                    OTHERS               = 8.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          EXIT.
        ELSE.
          CLEAR v_answer.
        ENDIF.
      ENDIF.
      CHECK v_answer IS INITIAL.
      SELECT SINGLE * FROM vbak
                      INTO ls_vbak
                     WHERE vbeln = p_vbeln.
      IF sy-subrc <> 0.
        WRITE:/ 'Invalid Order Id.'.
      ENDIF.
    END-OF-SELECTION.
      CHECK v_answer IS INITIAL.
      IF p_bkrun IS INITIAL.
        WRITE:/ 'Here is the result running the program in foreground.'.
      ELSE.
        WRITE:/ 'Here is the result running the program in background.'.
      ENDIF.
      WRITE:/ ls_vbak-vbeln,
              ls_vbak-vkorg.

  • Sql Server Agent Job Execution

    Hi All,
    I want to run a sql agent job (one job is execution one package) in such a way that as soon as job1 completes , it should be run again (without any time loss)
    I am folowing Below approach:
    Job 1 has 2 steps , in both the steps I am calling same package to execute . After that on Success/Failure action. I am selecting the same step.it is running in an infinite loop and continue fetching data.
    is there any dis-advantages on the above approach?
    Is there any other approach to achive the Same?
    Thanks in Advance....

    Hello,
    The two-step recursive (on success) technique should be fine.  I would just recommend the introduction of short-circuit”techniques that stops a runaway job in the event of logical issues (the “on failure” action will still catch the general error issues).
    Other patterns that are sometimes used for continual-execution requirements:
    Service Broker (for example, continually watch the queue and act on new messages)
    T-SQL home-grown job that runs in a loop and then executes the job based on some condition – and would require you to check job execution state
    For a continuously running package watching for new files in a folder, one example is detailed in the following blog post:
    Continuously watching files with WMI Event Watcher Task
    Best Regards, Joe Sack, MVP, SQL MCM | SackHQ.com

  • Enable server group in BPC job execution

    Dear Experts
    [Note 1476057 - Enable server group in BPC job execution|https://websmp130.sap-ag.de/sap/bc/bsp/spn/sapnotes/index2.htm?numm=0001476057&nlang=E]
    After upgrade, the server group logic will be :
    1, Create a correct server group with server assigned,
        job will be executed in specified server group;
    2, Create a server group without server assigned,
         job will be successfully submitted to BW,
         but will not be executed until server is assigned to the server group;
    3, Incorrectly specify a server group in web admin,
         client will get error message when run package.
    As I understand the group server is defined in BW Server. Where should I specify this group server in BPC. I could not find the parameter in BPC Web Admin - Appset Parameters or BPC Server (.Net Server) - Server Options.
    Appreciate if somebody can help ?
    Thanks
    Ashish
    Edited by: Ashish Narway on Oct 14, 2010 2:55 PM

    HI John,
    The group settings in WGM SL and Leopard are different.
    Yes, they are. I booted to my eval copy of SL Server and ran through the settings in WGM, Server Admin and Server Preferences; as you pointed out, all the mail list admin tools I could find are in the Mail service in Server Admin.
    The only thing that may be of interest that I could find is that for the group mail list, the email address for the group is group_shortname@ServerDNSname, not groupshortname@yourdomain (this is in the Mail Services Admin Guide for 10.6). This might explain why your email to the group may have been rejected?
    -Doug

  • Second Time, RFC execution Problem!

    Hi all,
    Has any one encountered this problem, when calling RFC First time fine and getting data from BAPI, when i call same RFC again, Second Time, RFC execution Problem!. Any idea!, Now i restarted server, that may cause the problem. Other than this, please give me your idea.
    Thanks
    Ravi Golla

    Hi Bhavik,
    <b>In View Controller:</b>
    public void onActionCreateProject(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionCreateProject(ServerEvent)
        wdThis.wdGetArchCompController().CreateProject();
         wdThis.wdFirePlugOutToProjectCreationResult();
        //@@end
    <b>In Custom Controller:
    </b>
    wdDoInit()
    __Arch__Arm_Project_Create_Input create = new __Arch__Arm_Project_Create_Input();
         wdContext.node__Arch__Arm_Project_Create_Input().bind(create);
    public void CreateProject( )
        //@@begin CreateProject()
         try
                             wdContext.current__Arch__Arm_Project_Create_InputElement().modelObject().execute();
                             wdContext.nodeOutput().invalidate();
                        catch(WDDynamicRFCExecuteException ex)
                             wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(ex.toString());
                             ex.printStackTrace();
        //@@end
    I am using other functional modules they all working fine, this is one only has problem
    Thanks  Bhavic.
    Regards
    Ravi

  • Got error in job execution, but the standalone procedure runs fine.

    I got error in job execution. But it runs fine as standalone procedure. Where could it be wrong?
    _>exec dbms_job.run(145373);
    BEGIN dbms_job.run(145373); END;
    ERROR at line 1:
    ORA-12011: execution of 1 jobs failed
    ORA-06512: at "SYS.DBMS_IJOB", line 481
    ORA-06512: at "SYS.DBMS_JOB", line 275
    ORA-06512: at line 1
    I checked the alert log file
    ORA-06550: line 1, column 101:
    PLS-00103: Encountered the symbol "RPTIMPORT" when expecting one of the following:
    := . ( @ % ;
    Thu May 2 12:59:34 2013
    Errors in file /oracle/admin/PDAMLPR1/udump/pdamlpr11_ora_15574.trc:
    ORA-12012: error on auto execute of job 146925
    ORA-06550: line 1, column 133:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    := . ( @ % ;
    The symbol ";" was substituted for "" to continue.
    The trace file:
    *** ACTION NAME:() 2013-05-02 12:43:48.261
    *** MODULE NAME:(SQL*Plus) 2013-05-02 12:43:48.261
    *** SERVICE NAME:(SYS$USERS) 2013-05-02 12:43:48.261
    *** SESSION ID:(1811.10644) 2013-05-02 12:43:48.261
    *** 2013-05-02 12:43:48.261
    ORA-12012: error on auto execute of job 145373
    ORA-06550: line 1, column 133:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    := . ( @ % ;
    The symbol ";" was substituted for "" to continue.
    *** ACTION NAME:(********* Schedule Job: Report C) 2013-05-02 12:47:58.178
    *** MODULE NAME:(PATIENT_REMEDIATE_JOB) 2013-05-02 12:47:58.178
    *** 2013-05-02 12:47:58.178
    ORA-12012: error on auto execute of job 145373
    ORA-06550: line 1, column 133:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    := . ( @ % ;
    The symbol ";" was substituted for "" to continue.
    *** 2013-05-02 12:52:43.409
    ORA-12012: error on auto execute of job 146924
    ORA-06550: line 1, column 101:
    PLS-00103: Encountered the symbol "RPTIMPORT" when expecting one of the following:
    := . ( @ % ;
    *** 2013-05-02 12:59:34.651
    ORA-12012: error on auto execute of job 146925
    ORA-06550: line 1, column 133:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    := . ( @ % ;
    The symbol ";" was substituted for "" to continue.
    ~
    ~
    The job was created as the following with 30 min interval:
    The job number: 145373
    DECLARE
    X NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    ( job => X
    ,what => 'RPTIMPORT.pr_exec_pop_ddl21_data_irt'
    ,next_date => to_date(sysdate)
    ,interval => '/*30:Mins*/ sysdate + 30/(60*24)'
    ,no_parse => TRUE
    SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    END;
    Thanks for help!

    the issue is resolved. I missed to put ";" at end of what statement. Thank all.

  • JOB execution fails due to Access failure to procedures and views using certificates (encryption)

    Job execution fails using SQLServerAgent account but runs successfully under another windows personal account.
    Both have same security access on server and DB.
    The Windows account is mapped to dbo on the database .
    The package uses procedures and views which are using encryption by certificates.
    Please advice on how to provide security so that job runs from the agent

    Hi Prady26,
    If the SQL Server Agent Service account and the proxy account generated based on a Windows user account have the same permissions on both the SQL Server database and the File System of the server, it may be related to the protection level of the package.
    If the package is set to encrypt with UserKey, the job will fail unless it runs under the security context of the Windows user that designs the package in BIDS/SSDT. You can check the
    ProtectionLevel of the package in the BIDS/SSDT to see if it is EncryptSensitiveWithUserKey or EncryptAllWithUserKey, if it is, re-deploy/reinstall the package and set the package protection
    level to “Relay on server storage for encryption”.
    If the issue persists, post the error message in the job history for further analysis.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Find aging of concurrent jobs execution for last one year in R12

    DB:11.2.0.3.0
    EBS: 12.1.3
    O/S: Red Hat Linux
    Hi all,
    Could anyone please share the resolution for the below question in R12 ?
    1)      Considering only 3 weeks of data is maintained in FND tables, which means we cannot use fnd_concurrent_requests to get list of jobs submitted in last one year. Is there any other way what we can get to find out aging of jobs execution for last one year?
    Thanks for your time!
    Regards,

    Locking this thread - Pl continue the discussion in your original post - Identifying customizations in R12
    Unless you have backups of the deleted data, this is not possible

  • Job executions lost in EM Grid Control

    Hello,
    We have lost all executions from the job execution pane except the backup jobs. We have lost also all scheduled jobs. Any idea about ?
    Thanks,
    Manuel.

    Did you create the email Notification Schedule?

  • Background Job execution enabled via pro-active monitoring

    Hi community,
    We're interested in CPS Redwood to help us in proactive monitoring of background jobs (Ad Hoc and Periodic) and impacts in system performance.
    The idea would be to have somehow a tool that monitor the number of available working process and system performance. When the system workload reaches a certain level, ex: 95%, this tool would intercept new jobs execution. After this, when the system workload goes down and the resources are free, the system would release all jobs to normal run again.
    Is it possible via CPS Redwood?
    Is there any other way to have something automatic like this?
    Thanks,
    Jose Antonio.

    Hi Jose,
    This is possible indeed using CPS. CPS can monitor various load metrics of your system, then adapt the scheduling logic if thresholds are exceeded.
    In your scenario, you would basically always intercept all jobs, but normally not enforce any limits so effectively that means all jobs still run immediately. If the load is too high, CPS would enforce a limit, so then jobs will be delayed until the load is lower again.
    Regards,
    Anton.

  • How to suspend (all) job execution ?

    Can I define jobs but suspend their execution (until I enable job execution again) ?
    If yes, how do I suspend them ?

    Hi,
    You can visit here:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14231/scheduse.htm#i1009724
    and also visit here:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14231/scheduse.htm#i1009725
    Adith

  • Is there a way to generate job execution scripts from the command line?

    The customer is planning to change DI production server configuraiton and needs to regenerate job execution scripts for hundreds of jobs. Their question is - instead of going through web admin and doing it one by one, is there a way to run a batch command and generate all jobs with the same job server information from one repository? I looked at the "al_engine" command but didn't find the options to do so. Did I miss something? This is for a DI 11.5.3 on HPUX.
    Thanks,
    Larry

    I also suggested that but the customer was so afraid of messing things up that they wanted to find out if there is another way. Thanks a lot for the confirmation.
    Larry

  • Notification Email/Alert - Including Job execution details(step output)

    Hi,
    I am using Oracle 10g R2 GRID Control on Windows. I would like to add the execution details to the default notification (Long)emails. Is there any possibility without adding any code in current version or later version to include step output(failed/Passed details)?
    Thaks for your help.

    I am already getting notification email/alert with just status failed/succeded. But I want to include the step output(job execution details) to that default email given by Oracle. I could write PL/SQL block to manipulate this,but looking for default way to include these details in any version?

Maybe you are looking for

  • How to search every file on a computer in java

    Hey guys, right now im writing a mac antivirus (i mostly use windows) i have the test code to search for hex code clips i have another file to use so i can replace it using a updater to make getting new virus terms more easy. but what it the way to g

  • Safari pdf does not open

    safari pdf files does not open

  • TS4196 Messages app is missing from my Mac.  What happened?

    Pretty sure I used it earlier this week. If I recall, I had a beta version.  I THOUGHT I paid a modest fee, like $1 for it later.  But now, it is missing from my Macs.  I DO have it on my iPod Touch. But there was not announcement about it being remo

  • Checkbox selects client and inserts value in table

    Hi, I have requirement where I need to create form which displays all Client Names with checkbox infront of them so that user can select client for whom they want to process orders. I have created checkboxes and trying to insert client in a table but

  • Get rid of "Ready to Start Task Sequence"

    I have several Task Sequences advertised to unknown computers. Since we got MS Surface we've had to change to boot image to 64bit. Its not an issue if we pick something with a different Boot Image, it just downloads the 32 bit Boot wim. The problem i