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

Similar Messages

  • 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

  • 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 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>

  • 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 the list of batch jobs running in a specific application server

    Hi Team,
    I am trying to check in SM37 if there is any specific condition to get the list of batch jobs assigned to a specific target server but cant find any.
    Is there is way to find the list of batch jobs assigned to run in one specific application server.( Target server specified in SM36 while job creation)

    Hello,
    This is what you can do in SM37.
    Execute the list of batch jobs, when the result appears on the screen edit the ALV grid via CTRL+F7.
    Now add the following columns "TargetServ" and "Executing server".
    You will now have two extra columns in your result list.
    TargetServr contains the value of the application server where the job should run when you have explicitely filled it in.
    Often this is empty, this means that at runtime SAP will determine itself on which application server the job will run (depending of course where the BGD processes are defined).
    Executing server is filled in always for all executed jobs, this is the actual application server where the job has run.
    You can also add these two fields in your initial selection screen of SM37 by using the "Extended job selection" button.
    I hope this isusefull.
    Wim

  • How to get status of job submitted programatically

    Hi
    I am submitting a program by creating a job. Can anyone help me to know how can i find out programatically that a job is complete and have executed successfully.
    Regards
    Sarika

    Please have a look at the FMs starting with BP_JOB_*
    I could think of using BP_JOB_SELECT or BP_JOB_READ...
    MIKE

  • 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.

  • 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

  • How to get rid of message "Backup disk not available"?

    I use an external disk for Time Machine.
    I switch the disk on every couple of days. In the mean time, I get a warning message every hour that:
    "Time Machine could not complete the backup, The backup disk is not available".
    How can I get rid of this message? It is really becoming irritating.
    Patrick

    patrick Wursteisen wrote:
    I switch the disk on every couple of days.
    that kind of beats the purpose of TM backups, which are usually happening on an hourly basis. if you intend to continue this way, you might as well forget about TM and rather create a bootable clone of your startup disk every couple of days. Carbon Copy Cloner or SuperDuper will even allow you to do incremental clones.
    another option would be to change the frequency of TM backups using _*Time Machine Editor*_.
    happy computing !
    JGG

  • How to get contacts from personal backup assistant to business cell...

    I just received a business cell and I can access the backup assistant for that phone and sync it.  I can do the same for my personal phone.  How do I get my personal backup assistant contacts to my business phone?
    Thank you very much.

    I would export the contacts from Back-up Assistant as a CSV file and then import them to the other account.  I don't think there's any way to link them or otherwise get them to communicate directly.

Maybe you are looking for