Maintain transaction using DBMS JOB

Hi,
How, can I maintain a transaction in DBMS SUBMIT JOB
Suppose, I have parent and 2 children.... when 1 child raise and exception the other child's data should not be committed.

user8650395 wrote:
Currently, Java triggers the stored procedures and we do not have COMMIT in any of our procedures. Each Java node has COMMIT once the process is completed it commits the data.What Java? Your original post says child jobs are submitted via DBMS_JOB. Anyway, assuming child job is java, modify java code. First of all you need to pass run_id to java. Then, at each commit point do the following:
1. Execute autonomous transaction SP that updates run table with:
UPDATE run_table SET status = 'SUCCESS' where run_id = passed_run_id and job = 'ChildN_Job';2. Loop until all other jobs for same run id set their status:
3. Check if at least one status is FAILURE. If so, rollback. Othherwise, commit.
And at each rollback point you call autonomous transaction SP to set job run id status to FAILURE.
SY.

Similar Messages

  • RAC and DBMS jobs

    We have 4 node 9iRAC and running majority of our jobs using DBMS jobs scheduler.
    I was wondering, how does oracle do load balancing for DBMS jobs.
    Some time I see node one taking the most of the load ?
    Thanks
    -Ashok

    In 10g it's the dbms_scheduler which is service name aware. Just define the job_class and associate it with a specified service.
    DBMS_JOB.INSTANCE or DBMS_JOB.CHANGE is about the only built in tools that you have to work with in the 9I version.

  • Transaction used for maintaining condition record for contract

    Hi All,
    In one of the issue user is not able to print contract,we have noticed that default printer is set for user.I need to check what condition record is maintained for user.
    Can anyone let me know what is the transaction used for maintaining condition record for contract output.
    Regards,
    Dharmesh

    Hi
    MN01 Create Message: RFQ
    MN04 Create Message: PO
    MN07 Create Message: Outline Agreement
    MN10 Create Message: Schd. Agmt. Schedul
    MN13 Create Message: Service Entry Sheet
    MN21 Create Condition: Inventory Mgmt
    MN24 Create Message: Shipping Notif.
    MN27 Create message: rough goods receipt
    MN10 / MN11 - Scheduling Agreement Delivery Schedule
    Vijay

  • DBMS Job failing with "active autonomous transaction detected"

    Hi,
    I am posting this for a customer issue. I posted this in the PL/SQL forum and was suggested to post it in this forum as this is a portal provided code.
    DBMS Job WWV_context is failing after install of 10.1.2.0.2 MR Repo install
    ORA-12012: error on auto execute of job 357~ORA-06510: PL/SQL: unhandled user-defined exception~ORA-06512: at "PORTAL.WWERR_API_EXCEPTION", line 71~ORA-06512: at "PORTAL.WWV_CONTEXT", line 1757~ORA-06510: PL/SQL: unhandled user-defined exception~ORA-06512: at "PORTAL.WWERR_API_EXCEPTION", line 71~ORA-06512: at "PORTAL.WWV_CONTEXT", line 1837~ORA-06519: active autonomous transaction detected and rolled back~ORA-06512: at line 1
    Thanks
    Sathya

    Hi,
    I am posting this for a customer issue. I posted this in the PL/SQL forum and was suggested to post it in this forum as this is a portal provided code.
    DBMS Job WWV_context is failing after install of 10.1.2.0.2 MR Repo install
    ORA-12012: error on auto execute of job 357~ORA-06510: PL/SQL: unhandled user-defined exception~ORA-06512: at "PORTAL.WWERR_API_EXCEPTION", line 71~ORA-06512: at "PORTAL.WWV_CONTEXT", line 1757~ORA-06510: PL/SQL: unhandled user-defined exception~ORA-06512: at "PORTAL.WWERR_API_EXCEPTION", line 71~ORA-06512: at "PORTAL.WWV_CONTEXT", line 1837~ORA-06519: active autonomous transaction detected and rolled back~ORA-06512: at line 1
    Thanks
    Sathya

  • How to get rid of maintaining transaction IDX2

    Hy everybody,
    is there a way to get rid of maintaining transaction IDX2, when an IDoc structure changes?
    Thanks a lot,
    Thomas

    I have done some investigations and found the part in the idx2 where the structure is deleted...
          delete from idxsload where port    eq i_idxsload-port
                               and   idoctyp eq i_idxsload-idoctyp
                               and   cimtyp  eq i_idxsload-cimtyp.
          delete from idxidocsyn where port    eq i_idxsload-port
                                 and   idoctyp eq i_idxsload-idoctyp
                                 and   cimtyp  eq i_idxsload-cimtyp.
    Do you think it is crazy to write a program which uses this lines of code?
    Regards,
    Thomas

  • How to call a stored procedure on time basis with out using sql job and GOTO

    Hi,
       I wanted to call a stored proc, on time basis ,
    please tel me how it can be done with out using sql job , goto .
    1) That is, is there any timer aviable in sqlserver.
    q2) And which one is better GOTO or sql job.
    yours sincerley

    Raj, Check if my explanation helps you:
    Your job runs every 10 seconds.
    Lets say first time you are scheduling and running your job at 12:00:00 PM
    Now your proc will start executing.
    Say it got finished at 12:00:07.
    Now the next schedule time is 12:00:10 PM.
    The moment this time hits, the job will get invoked and start executing the proc.
    Lets say this time it finished at 12:00:22 PM (It took 2 extra seconds)
    This time the scheduled time is already gone (12:00:20 PM), thus it'll now run at the next schedule that is 12:00:30 PM.
    Thus if anytime your job takes more than 10 seconds to run, it'll just miss those particular schedules overlapping with execution time. Otherwise you are good to go. 
    PS: A job is the best way to handle this, in your problem statement you don't need a job but that would be wrong. You have another way to do that, if you keep running your procedure all the time and the moment your timestamp hits a multiple of 10
    seconds you can run your logic and then returning to the timer. But this is extremely wrong for a system. Even if your requirement is extremely transactional and complex, I would not suggest this. If the job is taking more than 10seconds (which it might if
    your logics inside are complex), you should optimize your code and table architecture.
    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
    The climb is all there is.

  • Dbms job change in schedule time

    Hi
    Just not sure about the dbms jobs reschedule on oracle 11g on linux ..
    I have a dbms job running every day by hour 20 now i want to change it to 23 hours for today and again back to normal hour 20.
    can some one help me in the working steps for this to happen .
    Thanks in advance
    Edited by: 790072 on 12/06/2012 19:02

    >
    I have a dbms job running every day by hour 20 now i want to change it to 23 hours for today and again back to normal hour 20.
    >
    Use the DBMS_JOB.CHANGE procedure to change the next job time.
    See the example in the DBMS_JOB chapter of the packages and types doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_job.htm
    Search for CHANGE Procedure and follow the example
    >
    Usage Notes
    •You must issue a COMMIT statement immediately after the statement.
    •The parameters instance and force are added for job queue affinity. Job queue affinity gives users the ability to indicate whether a particular instance or any instance can run a submitted job.
    •If the parameters what, next_date, or interval are NULL, then leave that value as it is.
    Example
    BEGIN
    DBMS_JOB.CHANGE(14144, null, null, 'sysdate+3');
    COMMIT;
    END;

  • Use of JOBS folder under root directory

    Hi,
    We have Backup, Binn, DATA, Install, JOBS, Log, repldata directories under the instance root directory, as of now I heard the JOBS directory is used for jobs information, but I never see any jobs related information is captured under JOBS, Can someone please
    explain the purpose of this directory and what kind of jobs information stored here if any.
    Thanks & Regards,
    Kasi

    It is just a default directory that SQL installation creates. It is not being used in the latest SQL versions (you can rename it and restart SQLAgent without any problems). However, in SQL 2000, it used to maintain a registry key called working directory
    for this path and SQLAgent was dependent on this folder even though it is just a default directory (I haven't seen any usage of it though)
    Satish Kartan http://www.sqlfood.com/

  • Maintaining transaction sequence when End system is down

    Dear All,
    <b>Maintaining transaction sequence when systems are down.</b>
    Scenario:
    SAP(IDocs)--> XI --> DB
    DB is up & running, so messages (msg1, msg2) sent by XI have been processed successfully by DB.
    At a particular instance, DB is down and the messages (msg3, msg4) failed at receiver Adapter. With SP15, we got the feature of restarting these messages after a specific period of time. (Let’s say after every 1hour).
    After 5 minutes the DB is up and messages (msg5, msg6) sent by XI have been successfully processed by DB.
    After 1 hour, the receiver adapter restarts the failed messages (msg3, msg4) and they get processed successfully.
    Now the order in which messages have been processed on the DB:
    Msg1, Msg2, Msg5, Msg6, Msg3,Msg4
    As messages have not been processed in the sequence they have come from the source system, this would lead to DB inconsistencies.
    Kindly suggest how we can overcome this in XI. I don't want to use another Message Oriented Middlware(MOM) like MSMQ, MQSI for this.
    Regards,
    Siva M

    Hi Siva,
    Please can you go through this blog which might help you resolve this issue
    /people/vasanthakumar.balasubramani2/blog/2005/12/21/complete-reference-for-idoc-queuing-and-monitoring
    Regards
    Vijaya

  • PLSQL DBMS JOB - how to schedule ?

    Hi, I came across the process type "PLSQL DBMS JOB" - how can I schedule it within APEX?
    I understood using PLSQL DBMS JOB it just executes once and thats it.
    I like to use the process PLSQL DBMS JOB to execute once a day and call a procedure I have defined already. A code example wud be v.m. appreciated.
    TIA
    Bernhard

    First you need to make sure your init.ora has the following things defined<br><br>
    job_queue_processes=2<br>
    job_queue_interval=10<br>
    <br>the value above are recommended by Oracle<br><br>when I did this and restarted the database with the new init.ora (or pfile) it said something was no longer used so what I am suggesting above may not be entirely required but it seems to have worked for me...
    <br><br>
    then its just a case of executing the following<br><br>
    declare<br>
    jobno number;<br>
    BEGIN<br>
    dbms_job.submit(JobNo, 'begin my_thing_to_execute; end;', SYSDATE,
    'SYSDATE + 1/24');<br>
    COMMIT;<br>
    dbms_output.put_line(jobno);<br>
    END;<br>
    <br>
    the first sysdate is when to run next, the second sysdate+1/24 is how often to run so this is saying run hourly. if you want daily then it would be just +1.<br><br>that should get ya going to start with anyway. it can pay to put a little insert into a dummy table in your code that you want the dbmsjob to execute so then you know for sure that its working.<br><br>if you are talking about a dbms job thing in APEX then this is probably irrelevant as this is a dbmsjob in the database, not through APEX

  • TRANSACTION을 ROLLBACK SEGMENT에 할당하는 방법(SET TRANSACTION USE)

    제품 : ORACLE SERVER
    작성날짜 : 2003-04-04
    TRANSACTION을 ROLLBACK SEGMENT에 할당하는 방법
    ==============================================
    (SET TRANSACTION USE ROLLBACK SEGMENT)
    Purpose
    Batch job 등을 사용할 때 특별히 크게 만든 rollback segment를 사용하도록
    할 수가 있다. transaction에 특정한 rbs를 지정하는 방법을 알아보자.
    Explanation
    Oracle은 다음과 같은 규칙에 의해 각 Transaction이 사용하는 Rollback
    segment를 결정한다.
    1. Active Transaction의 수가 가장 작은 Rollback Segment에 할당한다.
    2. 만약 1의 조건에 만족하는 Rollback segment가 하나 이상이면, 가장
    마지막에 할당된 rbs 다음의 rbs를 할당한다. 이것은 undo 기능을 더
    오래 지속시키도록 해 준다.
    그러나, Application이 큰 rollback segment가 필요하다면 위와 같이
    자동적인 rollback segment의 할당이 아닌 Manual하게 특정 rollback
    segment를 할당 가능하다.
    다음의 방법을 사용한다.
    1) 큰 rollback segment를 만든다. 큰 rollback segment 를 만들기
    위해서는 rbs tablespace에 영역이 충분히 커야 하므로 필요할 경우
    tablespace를 확장하는 작업을 한다.
    <tablespace 확장>
    $ sqlplus system/manager
    sql> alter tablespace rbs add datafile '?/rbs1SID.dbf' size 100m;
    <rollback segment 생성>
    sql> create rollback segment big_rbs storage(initial 10m next 10m)
    tablespace rbs;
    sql> alter rollback segment big_rbs online;
    2) Transaction 를 assign 한다.
    <sqlplus>
    SQL> set transaction use rollback segment big_rbs;
    <pro*c>
    exec sql commit work;
    exec sql set transaction use rollback segment big_rbs;
    <forms>
    dbms_transaction.use_rollback_segment('big_rbs');
    이와 같이 지정하면 이후에 commit 또는 rollback이 일어날 때까지
    한 transaction에만 해당된다.

  • How to Reschedule the DBMS jobs after Cloning

    Hi ,
    Before Cloning , i took the backup of dbms jobs using the command
    SELECT job, what, next_date, next_sec FROM dba_jobs;
    After the clone is done , how should I resubmit the job?. Do we need to submit the job using the plsql block with commit in like below
    VARIABLE jobno NUMBER
    BEGIN
    DBMS_JOB.SUBMIT(:jobno,
    what=>'statspack_alert.sql;',
    next_date=>sysdate,
    interval=>'sysdate+1' );
    COMMIT;
    END;
    or
    Can I submit the jobs directly like below
    Execute dbms_job.submit(
    what=>'statspack_alert.sql;',
    next_date=>sysdate,
    interval=>'sysdate+1');
    In the plsql block , can i hard code the job number?.
    If we are using the bind variable, when the job is sumbitted , does it get assigned with job number?
    Do we need to submit the job as the owner of that job or sysdba can submit the job on behalf of the owner?
    Please address my questions
    Thanks
    Naveen

    Can I submit the jobs directly like below
    Execute dbms_job.submit(
    what=>'statspack_alert.sql;',
    next_date=>sysdate,
    interval=>'sysdate+1');What happens when you actually do it?
    Why ask us rather than do it yourself?
    PROCEDURE SUBMIT
    Argument Name               Type               In/Out Default?
    JOB                    BINARY_INTEGER          OUT
    WHAT                    VARCHAR2          IN
    NEXT_DATE               DATE               IN     DEFAULT
    INTERVAL               VARCHAR2          IN     DEFAULT
    NO_PARSE               BOOLEAN           IN     DEFAULT
    INSTANCE               BINARY_INTEGER          IN     DEFAULT
    FORCE                    BOOLEAN           IN     DEFAULT
    In the plsql block , can i hard code the job number?.NO
    If we are using the bind variable, when the job is sumbitted , does it get assigned with job number?yes, see above
    Do we need to submit the job as the owner of that job or sysdba can submit the job on behalf of the owner?No option to assign OWNER, so need to CONNECT as desired owner before DBMS_JOB.SUMBIT

  • APEX_PLSQL_JOB.SUBMIT_PROCESS /  Process Type "PLSQL DBMS JOB"

    Has anyone got APEX_PLSQL_JOB.SUBMIT_PROCESS to work? I've seen several threads which my exact problem but am unsure if anyone has got it to work.
    Here is my process:
    declare
      jobnumber number;
    begin
    IF apex_plsql_job.jobs_are_enabled THEN
        jobnumber := apex_plsql_job.submit_process(
              p_sql => 'insert into temp_jobtest
                        values (''APEX PLSQL Job'',sysdate); 
                        commit;');
    END IF;
    end;Process runs and APEX_PLSQL_JOBS shows SYSTEM_STATUS as "COMPLETE" but no rows are ever added to the temp_jobtest table. I tried submitting directly using dbms_job and it worked as expected.
    I have read: Background jobs
    I really wish we could still create a process type of (PLSQL DBMS JOB). If this functionality has been deprecated then why is it still referenced in the User Guide?
    From the APEX User Guide, Release 2.2, B28550-01, July 2006; page 13-15; heading - "Using a Process to Implement Background PL/SQL"
    The simplest way to implement the APEX_PLSQL_JOB package is to create a page
    process that specifies the process type PLSQL DBMS JOB. By selecting this process
    type, Application Builder will submit the PL/SQL code you specify as a job.

    "Ok, I do see it.....if I was still working in a version pre 2.0"
    Which is exactly what I have done. I had access to a HTMLDB 1.5 environment.
    --I create a new application in 1.5 with 1 page. 
    --Added a page process with a process type of  "PL/SQL DBMS JOB". 
    --Exported the application.
    --Import the application into APEX 2.2 environment
    --copy page from imported application to my application
    --copied the process from my copied page to the page in my application where I want the process
    So far it is working just as I expected.
    Thanks Jeleeb! I present you with a silver medal.

  • How to get DBMS JOB history?

    HI All
    is there anyway I can get the DBMS JOB [ not the dbms scheduler job] run time history details from either Oracle DB or from Oracle Grid repository database? please advice
    regards
    Santhosh

    The local Database scheduler DBMS_SCHEDULER is the preferred schedule package to be used.
    Based on this package you will find all your job information in the local database page.
    Switch from DBMS_JOBS to DBMS_SCHEDULER and benefit from this and several other advantages.
    Regards
    Rob

  • Maintaining Transactions Across JSP Pages

    Hi,
    I have a multi page Registration (3 steps). On each step data submitted is taken
    to the database via an EJB component (Session Bean). How do I maintain a transaction
    across these JSP pages (i.e. either in the EJB or in the jsp) so that the data
    in the database is consistent? So if there is a problem in the 3rd step the data
    submitted in the first two steps should be rolled back.
    Can I use a statefull session beans, which will maintain a database connection
    created during the first step, so that I can use the same connection for steps
    2 & 3. In the first step after getting the database connection I will begin a
    transaction and insert the first part of the data, then this connection will be
    maintained by the statefull session and used for steps 2 & 3. At the end I will
    commit the transaction. Will this work?
    How do I maintain transaction across multiple pages? Is there is any standards
    for this scenario where the transaction is maintained across multiple pages. I
    cannot carry data across the jsp pages because of the complex data collected.
    Any help appreciated.
    Regards
    -MohanRaj

    You can not and should not do it the way that you are proposing. Keeping a transaction
    open across any interaction with the user is a big mistake. Transactions are scarce
    resources. They need to be short. You will need to collect the data from the three
    pages in the servlet itself. You can use the HTTPSession, or hidden fields in
    the forms. Only after all of the data is collected should you begin a transaction
    and update the database. Alternatively, you could store the partial data in a
    temporary database table, and move it to a permanent table when all of the data
    has been provided.

Maybe you are looking for

  • XML Error while registering a portlet

    I am getting this error in 9i Portal Release 2 on a Solaris 8 platform. Does anyone have any insight into this error? : An error occurred when attempting to call the providers register function. (WWC-43134) An unexpected error occurred: java.io.IOExc

  • Using Assoc Arrays in OBPM 10GR3 for 25 million comparisons

    Can we use Associative arrays in OBPM 10GR3 to do 25 million comparisons or even more than that? I have two assoc arrays which I compare with each other 25 million times by looping them one inside the other. For e.g. for(int i = 0; i < 5000; i++) for

  • Set PO to HOLD status

    Hi Guys, I am using SRM 4.0. I have added a custom field in Shopping Cart & based on this field value I need to set the PO Status to "HOLD", while the PO is being created from shopping cart. first of all can we do that ?? if yes how?? Thanks in advan

  • Skype suddenly started crashing - Mac OS X 10.7.5

    Skype suddenly started crashing immediately upon launch, I don't even get to see the login screen. I've never had any issues with Skype before and honestly it doesnt make much sense cos I havent even installed anything new latety, all I do is the sof

  • How to get physycal SQL from usase tracking

    Please suggest from which table I can directly get physical query from usasge traking.