How to get status of last execution of a scheduler job

Hi,
I am trying to write a pl/sql code that can manually the scheduler job (one time type/ not a repetitive) which are in retry scheduled state.
even after execution is successfull job is not dropped even if i set auto_drop to true.
I need some way to capture execution status of dbms_scheduler.run_job('job_name');. based on which i can manually drop the job if it is successfull.
taking the value from dba_scheduler_job_run_details doesn't seem to be good option as there may be multiple logs and we don't what time interval we need to match.
can anybody help me in this.
Thanks in advance.

Hi,
I'm a little confused at what is happening. It sounds like the following is the case
- You have created a run-once job and set restartable to TRUE and auto-drop to TRUE. It has failed a few times and is now in the RETRY SCHEDULED STATE .
- Now you have fixed the issue and want to force a rerun and drop the job if it has succeeded.
If this is the case you have several options.
- just wait until the job has retried itself, you can see the next scheduled date in the dba_scheduler_jobs view
- use dbms_scheduler.run_job(use_current_session=>false) . You will have to monitor dba_scheduler_job_run_details to see the status of the job run but you can easily use log_date to figure out which row is your row. Just select the row with log_date > sysdate when you called run_job. If that run succeeds, you will manually need to call drop_job.
- use dbms_scheduler.run_job(use_current_session=>true) . Because this runs the job action in the foreground it will hang until the job action has finished. Any error will be thrown as a foreground PL/SQL error. If there is no error, the action has succeeded and you can go ahead and do a drop_job.
Hope this helps,
Ravi.

Similar Messages

  • CRM document - how to get status duration?

    Dear all,
    I extract data CRM -> BI  using standard datasources: 0CRM_SRV_PROCESS_H, 0CRM_COMPLAINTS_I, etc
    I need build a report with status duration of documents
    For example, if document was processed 4 days in statuses OPEN > IN PROCESS > VALIDATION > CLOSED report should be following:
    OPEN - 1 day
    IN PROCESS - 2 days
    VALIDATION - 1 day
    Each CRM datasource has start date and last change date of the document
    But there is no fields which stores date or duration of intermediate status change
    Could you please give an advice - how to get status duration?
    Thanks in advance

    Hi Oleg,
    Please check whether following standard datasources could meet your requirements:
    0CRM_TSS_DTRACK  CRM Tracking of Document Processing Lifecycles
    0CRM_TSS_PKYF       Timestamp Service: Performance Key Figures
    You can find the documents in transaction code SBIW, through IMG path
       Settings for Application-Specific DataSources (CRM)
           -> Settings for Extracting CRM Objects
                 ->  Define Extraction to Track the Document Processing Life Cycle   
                  -> Define Performance Key Figures for Time Stamp Service Analysis
    Best Regards,
    York

  • How to get status of transaction

    Hi Gurus,
    can anyone tell me how to get status of the transaction in crm.
    regards,

    hi vijay,
    what kind of transaction did you want to get the status ?
    for order, complaint, activity, and task, you can used function modul 'CRM_ORDER_READ' for getting status of the document.
    hopes it helps
    cheers

  • How  to  get my   iphone  last locatin

    how  to   get   iphone   last  location

    If Find My iPhone is turned off, there is no way to track your device. Apple does not track phones. Your only option is Find My iPhone and you do not have that active, so you will not be able to track your phone. Take the time to report it to law enforcement and your carrier, and change any passwords for accounts that were on your device, especially if you did not have a passcode set up on the device.

  • How to get text of Last SQL Query

    Sorry if this has been covered, but the search page keeps erring on me.
    I am trying to figure out how to get the text of the last SQL statement executed (succesfully or unsuccesfully) by my current login.
    What it is, is i want in the exception handler of my procedure to be able to dump the text of the Query which was last run into the log file.
    Any help with this will be greatly appreciated!
    Thanks in advance,
    Aaron.
    [email protected]

    Well, ive been trying V$SQLTEXT in conjunction with V$SESSION and USERENV('SESSIONID'). This gets me my SQL statements, but the SQL_HASH_VALUE and PREV_HASH_VALUE, which are supposed to be the current and previous statements respectively always are the same and always point to the current statement..... is there some sort of flag you have to set to get PREV_HASH_VALUE (and PREV_SQL_ADDR) to actually point to the **PREVIOUS** statement??

  • How to get status codes of field?

    For every document type or status field which we can see on front end, there is code which is finally stored in table.
    e:g: Go to transaction /nme53n
            Select any purchase req.
            Select status tab from item.
            See – processing status field.
            These processing status saves as N,B, etc in table.
    I know there is way to see these codes followed by full description on front end screen itself. I think using personal settings, but dont know how to set this. Please let me know how to see status codes + description on front end.

    You gui status should be implemented in the main screen which the subscreen resides, all function codes should be handled at that level. I believe you will need to set the F2 funciton code in your gui status, set the function code to PICK and then handle this function code in your PAI user command module. Should work.
    subscreen cannothave their own pf-status.....so create a pf-status for a screen in which ur subscreen is called...include 'pick' or f2 as onre of the functions code for the choose option.
    to differentiate the field u have to use get cursor field fldname.
    if it is a table control field u have to use
    get cursor field <fldaname> line <n> value <fval>

  • Get Stored Procedure Last Execution time.

    Hi,
    I am looking to get last execution of store proc(My cache is flushed off). So would like to know all the store proc execution times.
    sys.dm_exec_query_stats( as I known gets from cache, now all my cache is flushed)
    Is there any way out.
    N_14
    Naveen| Press Yes if the post is useful.

    You may need to look at sys.dm_exec_procedure_stats.
    As your cache is flushed, you will be unlikely to get this information without manual logging.

  • How to get status profile (STSMA) in user exit ILOM0001

    Hi ABAPers,
    I am currently working on user exit ILOM0001 (Check before saving a functional location) and need to get information about status profile (STSMA). I have checked parameters that is imported into this user exit (DATA_IFLO, DATA_IFLO_OLD, DATA_IFLOS) and none of them have STSMA.
    Could anybody help me how to get this field STSMA into user exit ILOM0001?
    Appreciate it.
    Thanks
    Regards
    Hadi

    Dear Kolla,
    Really appreciate your answer, but
    I don't want to generate or make settlement receiver.
    I was building a script in user exit IW010009,
    And the issue is I can not capture the content of field settlement receiver.
    If we want to capture screen field, ex. equnr, we can use structure CAUFVD,
    when i see the technical detail in this field, the structure for settlement is DKOBR, field EMPGE, but i cannot call it on debug.
    Kindly need your help on this issue.

  • How to get material's last posting date of issuing to production order?

    Hi,
    In my scenario, I need to get material's last posting date of issuing to production order (e.g. mov. typ. 261).
    I tried to select the material documents whose movement type is 261, and restrict the posting date from month to month each time, until the first material document is selected.
    But this method seems quite inefficient.
    What kind of algorithm is more effient to do this?
    Thanks
    Wesley

    Hi,
    select max( budat )
      from mkpf
      into gv_budat
      where mblnr in ( select mblnr
                         from aufm
                        where aufnr = gv_aufnr "(Prod. Order)
                            and  matnr = gv_matnr "(Issued Material)
                            and bwart = '261' ).
    Edited by: Azeem Ahmed Matte on Mar 12, 2010 12:33 PM

  • How to get status of a backup job

    Hello everybody,
    I scheduled our daily RMAN backup using the DBMS_SCHEDULER package. The DB job calls an external batch file which in turns calls rman's executable and passes it a command file containing the actual backup script. Similar to what's described here:
    Problems with automated RMAN Backup in Oracle 11GR1 with DBMS_SCHEDULER
    The backup works perfectly. The problem is that if I intentially corrupt the command file (simulating a backup failure) so that the backup fails, and then query the dba_scheduler_job_log view, I always get a status of SUCCEEDED. Regardless of the actual backup outcome, the job seems to always succeed. That's a problem for me, because I'd like to set up a user defined metric which would check the status of the job in dba_scheduler_job_log. If the job wasn't successfully executed, a mail would be sent.
    Does anybody know why the job doesn't fail when it should? I also tried to execute the failing script manually and then checked the %ERRORLEVEL% environment variable. It has a value of 1, meaning error.
    Btw, I know that if I schedule the same backup with Enterprise Manager's job system (instead of DBMS_SCHEDULER), the backup failure is correctly reported (and the metric works). The issue with EM is its limited scheduling capability - I do a full backup on Sunday, a cummulative incremental backup on Wednesday and all the other days a differential incremental backup. Since now I haven't found a way to define a schedule with an appropriate repeating interval. The only solution I figured out is to have 7 jobs, one for each day of the week....
    Thanks in advance for any answers,
    Jure

    Hi,
    @alanm: I completely forgot checking that view :-) Using it is a solution, but I should probably set up a job chain to handle that (run backup & chack status in the view afterwards)....if there isn't be another solution, maye I'll do that. But then, maybe using 7 EM jobs is a simpler solution.
    @RnR: I tried to execute the batch file manually from the command line like that:
    C:\>echo %errorlevel%
    0
    C:\>rman target / cmdfile=backup_full.rcv
    Recovery Manager: Release 10.2.0.3.0 - Production on Sre Jul 2 09:46:37 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: TESTDB (DBID=2890535676)
    RMAN> RUN
    2> {
    3> aa;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "identifier": expecting one of: "allocate, alter, backup, beginline,
    blockrecover, catalog, change, copy, convert, crosscheck, configure, duplicate, debug, delete, exec
    ute, endinline, flashback, host, mount, open, plsql, recover, release, replicate, report, restore, r
    esync, set, setlimit, sql, switch, startup, shutdown, send, show, transport, validate"
    RMAN-01008: the bad identifier was: aa
    RMAN-01007: at line 3 column 1 file: backup_full.rcv
    C:\>echo %errorlevel%
    1
    So the if the script fails, I get an errorlevel of 1. Is it possible that the status isn't propagated back to the Oracle job?
    @alanm: I'm already appending to the log, but I don't see how can that affect the outcome status of the job?
    Thanks for your answers.
    Regards,
    Jure

  • How to get Status of Static Root of Trust in windows

    While implementing the static root of trust in windows system, how one can get the status of static root of trust??
    How one can do measurement of static root of trust in the system.

    Might also try them here.
    http://social.technet.microsoft.com/Forums/en-US/home?forum=mdopagpm%2Cmdopmbam&filter=alltypes&sort=lastpostdesc
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How to get status of

    I'm using a table linked with a CachedRowSetDatasetProvider
    and I have to implement the following rule :
    "the column can be edited only if the row is being appended,
    else it will be display only"
    I want to dynamicaly change the representation of a column as follow
    - a staticText if the row is already commited in the database
    - a textfield if the row is just being appended
    Is there a way to know the status of the row
    In the past, the good old PowerBuilder provided a similar method to get the status of row inside a datawindow, the returned possible values were :
    New!, DataModified!, Deleted! ...
    Thanks a lot

    Hi There,
    Making the Table row editable only for the appended row is tricky!
    The simplest solution I can think of is to display the read only rows in a table , and have seperate fields to enter the appeneded rows!
    but take a look at this tutorial
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    Its hows you how to add,update, delete rows displayed from the database.
    Hope it helps, sorry for delayed response.
    K

  • How to get status of an rs232 connection

    Hi,
    I am trying to read out the status of on RS232 connection.
    How can I do this?
    Moreover would it be great to make the handshake visible! Is there a way that I can do that?
    I would like to make a program something like where I can push a button "connect", get the status that i am connected and then make it possible to send some data....
    I would really thank you if you can help me.
    Sincerely Tim

    The more fundamental problem is that except for an indication of whether or not it has been initialized and perhaps the number of bytes in the port buffer, a serial port doesn't have any sort of real status. RS232 communications simply isn't that sophisticated. For what it's worth, unless the device you are working with is very old, monitoring the handshake lines probibly won't tell you anything because most modern serial device don't use any handshaking.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to get status of a ScheduledTask

    <p>When someone cancels a running schedule manually from the GUI,that schedule is not listed by using the listJobStatus of theScheduler class.  Even in some cases a failed schedule doesn'tappear in in the list of ExecutionStatus that we get by using thelistJobStatus of the Scheduler class. How do I get the status ofScheduledTask in those cases. There is this getLastStatus method incom.sqribe.transformer.scheduling.ScheduledTask but that is hiddenby the api and I cannot use it.</p><p> </p><p>I need to get the status of a schedule that has started running,  to find out if it has suddenly stopped. If it comes in thelist given by listJobStatus of the Scheduler class, I can find findout, when it is not listed how do I find the status.</p>

    have a look at the workflow built-in vars:
    WF_ACTION_ERROR and WF_ACTION_RESULT or WF_CASE_RESULT
    WilfredS

  • How to get status of a sub process from the parent process.

    Hi,
    I want to get the status of a subprocess from the parent process (i.e. success or failure).
    How can I get this.
    Thanks in advance.
    Bye

    have a look at the workflow built-in vars:
    WF_ACTION_ERROR and WF_ACTION_RESULT or WF_CASE_RESULT
    WilfredS

Maybe you are looking for

  • Since updating my ipad it will no longer connect to the internet

    since i've updated my software on my ipad it will no longer connect to the internet. my husbands iphone will not connect either. my laptop connects immediately and my internet signal is full strength. is there something we are missing?

  • Windows 2012 License activation (MAK)

    I have a Windows Server 2012 Std - via OpenLicense (Physical Host + DC and a VM for Exchange 2013) Needed to add Remote Desktop Services - so purchased another License for Windows 2012 Std on the OpenLicense again. Installed Windows 2012 on another P

  • Changing the output sound device when a headset is plugged in?

    I wanted to replace my clunky old Logitech USB headset with a bluetooth one and then noticed - hey! - there is a headset jack. So I tested a Skype call with an extra iPhone headset I had lying around and it worked great. The only problem is there doe

  • 70D Live View Mode Not Working

    All of a sudden Live View Mode doesn't work on my 70D.  Setting is enabled.  Pictures show on my screen for a few seconds after it's taken, but screen is black while taking pictures even when shutter release button pressed down half way.  Any ideas o

  • Temporary object deleted too late...

    #include <string> #include <memory> class A{ pubilc:    const std::string& getId() const{ return i_id;} private:    const std::string i_id; namespace{ std::auto_ptr<A> return_autoptr_object(const char* arg)   A* const ret = new A(/*arg*/);   return s