Batch Updates Using Oracle

Hi,
We are currently having problems saving data using Weblogic 6.1 sp1 and Oracle
8.1.6. we are using Weblogic JDBC Drivers for Oracle. The data we are saving is to
the extent of 25-50,00 records. When we are trying to this we are getting transaction
timeout errors since this saver process is taking more than 30 seconds which is out
rimeout limit.
Can we do this using Batch updates?? Any code snippets or pointers will be grealty
appreciated.
Thank YOu,
Sanjeev

Can you be more specific?
- What do you want to do exactly?
- What are your OS and Reports versions?
At first, it sounds a bit strange to use Reports for batch updates. A pl/sql procedure may be more suitable.
You can schedule a report in several ways, e.g. via CRON on Unix (see RWRUN command in the 9iDS Help)).
You can do the same via the database using the SRW package (see http://download-west.oracle.com/docs/html/A92102_01/pbr_evnt.htm#1005558 )
You can use the Reports Queue Manager.

Similar Messages

  • Batch Updates using JDBC 2.0

    Dear all,
    I am trying to use a PreparedStatment's batchUpdate() method. Here is the problem.
    I get an exception if there is a duplicate entry, and that blows up the entire batch. This leaves me with no room for error checking as to where this error had occurred.
    How do I know at which row I got the error? How can I make the batchUpdate() execution to ignore the error and continue?
    Thanks,
    -rrvvg

    This is a case where reading the Java documentation will help you. Here is the link to
    int[] executeBatch() throws SQLException.
    http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html#executeBatch()
    I know this isn't code showing you how to do it, but I think it does a good job of explaining how to handle your situation. The documentation clearly states that you also need to see the documentation of your specific JDBC driver because Exception behavior is defined by the driver and can be different between vendor offerings..

  • Batch Insert Using Oracle

    I am having a performance issue with network traffic. Can anyone tell me how to if possible to make batch inserts to a Oracle Database.
    Thanks

    Absolutely, It's called batching.
    There is a code sample in
    ORACLE_HOME/jdbc/demo/samples/oci8/basic-samples/SetExecuteBatch.java
    The feature is not specific to the OCI driver, it works with the KPRB driver within JServer.
    Matthieu

  • Resultset from a batch select using prepared statement

    Hi,
    Is it possible to add results of batch execute of select statements and retrieve the result set ..
    I am running select statement in a batch mode setting in value for a column.I add this to a prepared batch.
    I would like to get the reults as a batch and spin through the result set like a r.next(). Is this possible ?
    I have given the code below
    sql = "select ordervalue , orderdate from discreet_orders "+
    "where order_no = ? ";
    dbObject.prepareStatement(sql);
    dbObject.prepareStatement(sql);
    for (int i=0; i < orderNoVect.size(); i++) {
    dbObject.setString(1,(String)scnV.elementAt(i));
    dbObject.addBatchPrepared();
    r = dbObject.execPrepared();
    dbObject.clearBatchPrepared();
    I would like to do a r.getNext() process the values form the resultset.
    Is this possible ? If not is there an other way to do it ?
    Thanks
    Arnold

    Olek wrote:
    hi
    Is there a way do a batch update using prepared statement?
    I don't want to insert every row in a single query...
    regards,
    OlekPossibly the confusion here stems from the existence of two addBatch methods in PreparedStatement.
    addBatch(String sql)inherited from Statement adds a new query to the batch of SQL statements for the statement. However you don't want to use this with PreparedStatements Instead you want
    addBatch()which adds the current set of parameters to the prepared statements batch of commands.
    In this scenario you prepare your query (insert statement) and then call setXXX(x,y) for each parameter and then addBatch for each tuple. Then call executeBatch to execute all the queries based on your batched parameters.
    If this didn't answer your question I don't know what your question is exactly. I would add that you probably want to set a "reasonable" size on your batches and break them into smaller batches as is reasonable. Mainly because the implementation of batched PreparedStatements widely varies depending on the database and driver, thus there are certainly scenarios where given enough batched parameters you could have various unpleasant things visited upon your program. Like terminal slowness, running out of memory, etc.

  • Oracle 10G AS, Batch Update doesn't commit.

    Hello,
    We are using Batch uptdate to commit a set of records, but to our surprise one of the batches commits in DB and the other doesnt.
    The below pseudo code explains our scenario :
    String str1="INSERT INTO TBL1 (COL1,COL2) VALUES (?,?) ";
    String str2="UPDATE TBL2 SET COL1=? WHERE COL2=?";
    PreparedStatement pstmt1=conn.prepareStatement(str1);
    PreparedStatement pstmt2=conn.prepareStatement(str2);
    for(500 recs)
    pstmt1.addbatch();
    pstmt2.addbatch();
    On 500 Recs
    //This batch updates the DB and commits too
    pstmt1.executeBatch();
    pstmt1.clearBatch();
    con.commit();
    //The Batch executes successfully, but updates are not reflected in DB,
    //which may mean that it must not be committing in DB
    pstmt2.executeBatch();
    pstmt2.clearBatch();
    con.commit();
    - In the above, pstmt1 is an INSERT and pstmt2 is an UPDATE.
    - It so happens that at the end, DB reflects Inserts done by pstmt1, but it doesnt reflect the Updates of pstmt2.
    - We have also fired a SELECT stmt immediately after pstmt2 Execute Batch, but the updated values are not reflected.
    - Also the above scenario works absolutely fine if we use a STATEMENT instead of a PREPAREDSTATEMENT for pstmt2.
    Set up Details:
    App Server :: Oracle 10G AS for Linux 2.1,
    Database Driver :: Oracle 10G Driver which is bundled with Oracle 10G AS
    Database :: Oracle 9i
    Any ideas in this regards would be highly appreciated.
    Thanks !
    - Khyati
    Message was edited by:
    user473157

    I think this is not the right forum for this question; probably a JDBC forum or one of the Oracle AS forums.
    Kuassi

  • JDBC Batch Updates & PreparedStatement problems (Oracle 8i)

    Hi,
    we're running into problems when trying to use JDBC Batch Updates with PreparedStatement in Oracle8i.
    First of all, Oracle throws a SQLException if one of the statements in the batch fails (e.g. because of a unique constraint violation). As far as I understand, a BatchUpdateException should be thrown?
    The next problem is much worse:
    Consider this table:
    SQL> desc oktest
    ID NOT NULL NUMBER(10)
    VALUE NOT NULL VARCHAR2(20)
    primary key is ID
    When inserting in through batch updates with a PreparedStatement, I can pass 'blah' as a value for ID without getting an exception (Oracle silently converts 'blah' to zero). Only when the offending statement is the last statement in the batch, Oracle throws an exception (again, SQLException instead of BatchUpdateException).
    Any comments/suggestions are appreciated.
    E-mail me if you want to see the code...
    Thanks,
    Oliver
    Oracle version info:
    (Enterprise Edition Release 8.1.6.0.0, JServer Release 8.1.6.0.0, Oracle JDBC driver 8.1.6.0.0 and 8.1.7.0.0 (we're using the 'thin' driver)
    CLASSPATH=/opt/oracle/product/8.1.7/jdbc/lib/classes12.zip:...
    null

    Please refer
    http://www.oracle.com/technology/products/oracle9i/daily/jun07.html

  • How are JDBC batch updates implemented by Oracle?

    When you're looking to reduce commits you typically think of JDBC batch updates.
    I'm just wondering how are these implemented by Oracle and is there ever gains to be had to reducing commits in an Oracle specific way like say using VARRAYs with procedures?

    Please refer
    http://www.oracle.com/technology/products/oracle9i/daily/jun07.html

  • Oracle Batch update problem

    Hi,
    I have a queer problem with batch inserts in oracle, loaded on a sun solaris m/c.
    I'm trying to do a batch insert using the executeBatch() api of java.
    I am able to do batch insertions from my workstation i.e win2k properly . But i'm unable to do so when i run the program on the sun solaris m/c.(The data base is the same)
    Since the JVMs are different i have a feeling it could be the oracle JVM that is giving the problem.
    Please advice me as to how i can overcome this.

    I am having the same problem with a 9i installation on Win2k. My code works fine when run in the Sun JVM on a client. When I try to executeBatch in the Oracle JVM, I get "java.sql.BatchUpdateException: Internal Error: oracle.jdbc.kprb.KprbDBStatement".
    I am using what I thought was the standard preparedStatement.addBatch() and preparedStatement.executeBatch() APIs.
    I see in the SetExecuteBatch.java example the use of connection.setDefaultExecuteBatch(int) and preparedStatement.executeUpdate(). Is this usage required when running in the Oracle JVM? What if I set my batch size to 10000 but I only have 9000 rows in the last set -- how do I force the batch to execute on the smaller set?

  • How can I avoid using rollback segment for batch updates.

    I am currently trying to avoid associating a large amount of space for rollback segment as this gets filled up only during the nightly batch updates. All that space will never be used during the day. Hence want to know if there is any way of avoiding the use of rollback segment at the session level.
    Rajesh

    No, but what you can do is create a large rollback segment to use with your batch job, at the start of your batch job bring the segment online, then use set transaction to use that rollback segment, when the batch job is finished and committed, you can then bring the rollback segment offline.
    If you are really pressed for space, as an alternate plan, you could actually create the large segment before the batch job and drop it after.

  • Batch status updating using function module BAPI_BATCH_SAVE_REPLICA

    Hi,
    I want to change batch status after creating the outbound delivery through inbound idoc, i was able to create delivery , but after creation, i should update the batch status using function module BAPI_BATCH_SAVE_REPLICA, but i was unable to execute this function module correctly,
    Can any one provide details like what are minimum things that are required to update the batch status using this function module.
    In my system batches are defined at plant level.
    Please let me know the solution if any one knows this.
    With regards.
    P.Prasanth.

    Look at BAPI_INCOMINGINVOICE_POST
    Rob

  • How to update bulk no of records using  Batch Update

    i am trying to insert and update records into multiple tables using Statement addBatch() and executeBatch() method. But some times it is not executing properly. some tables records are inserting and some tables it is not inserting. But I want all the records need to excute and commit or if any error is there then all records need to rollback.
    This is the code i am using.
    public String addBatchQueryWithDB(StringBuffer quries, Connection conNew,Statement stmtNew) throws Exception {
    String success="0";
    try {         
    conNew.setAutoCommit(false);
    String[] splitquery=quries.toString().trim().replace("||","##").split("\\|");
    for(int i=0;i<splitquery.length;i++) {
    //System.out.println("query.."+i+".."+splitquery.trim().replace("##","||"));
    stmtNew.addBatch(splitquery[i].trim().replace("##","||"));
    int[] updCnt = stmtNew.executeBatch();
    for(int k=0;k<updCnt.length;k++){
    int test=updCnt[k];
    if(test>=0){
    success=String.valueOf(Integer.parseInt(success)+1);
    // System.out.println(".updCnt..."+updCnt[k]);
    System.out.println("success...length.."+success);
    if(updCnt.length==Integer.parseInt(success)){
    success="1";
    //conNew.commit();
    } catch (BatchUpdateException be) {
    //handle batch update exception
    int[] counts = be.getUpdateCounts();
    for (int i=0; i<counts.length; i++) {
    System.out.println("DB::addBatchQuery:Statement["+i+"] :"+counts[i]);
    success="0";
    conNew.rollback();
    throw new Exception(be.getMessage());
    } catch (SQLException ee) {
    success="0";
    System.out.println("DB::addBatchQuery:SQLExc:"+ee);
    conNew.rollback();
    throw new Exception(ee.getMessage());
    } catch (Exception ee) {
    success="0";
    System.out.println("DB::addBatchQuery:Exc:"+ee);
    conNew.rollback();
    throw new Exception(ee.getMessage());
    }finally {
    // determine operation result
    if(success!=null && success.equalsIgnoreCase("1")){
    System.out.println("commiting......");
    conNew.commit();
    }else{
    System.out.println("rolling back......");
    success="0";
    conNew.rollback();
    conNew.setAutoCommit(true);
    return success;
    }

    Koteshwar wrote:
    Thank you for ur reply,
    I am using single connection only, but different schemas. Then I am passing a Stringbuffer to a method, and First iam setting con.setAutoCommit(false); and then in that method i am splitting my queries in stringbuffer and adding it to stmt.addBatch(). After that I am executing the batch.after executing the batch i am commiting the connectionIf I am reading that right then you should stop using Batch.
    The intent of Batch is that you have one statement and you are going to be using it over and over again with different data.

  • More than 1 preparedStatement  object using batch update

    Hey how can I execute more than 1 preparedStatement object using batch update..Pls explain with a code(java)
    Thanks

    // turn off autocommit
    con.setAutoCommit(false);
    PreparedStatement stmt = con.prepareStatement(
         "INSERT INTO employees VALUES (?, ?)");
    stmt.setInt(1, 2000);
    stmt.setString(2, "Kelly Kaufmann");
    stmt.addBatch();
    stmt.setInt(1, 3000);
    stmt.setString(2, "Bill Barnes");
    stmt.addBatch();
    // submit the batch for execution
    int[] updateCounts = stmt.executeBatch();
    search in google for more information

  • How to Update the oracle toad column value in table by using SSRS 2008

    Hi Team,
    How to update the oracle DB table column value by using SSRS 2008.
    Can any one help me on this.
    Thanks,
    Manasa.
    Thank You, Manasa.V

    Hi veerapaneni,
    According to your description, you want to use SSRS to update data in database table. Right?
    Though Reporting Services is mostly used for rendering data, your requirement is still can be achieved technically. You need to create a really complicated stored procedure. Pass insert/delete/update and the columns we need to insert/delete/update as
    parameters into the stored procedure. When we click "View Report", the stored procedure will execute so that we can execute insert/delete/update inside of the stored procedure. Please take a reference to two related articles below:
    Update Tables with Reporting Services – T-SQL Tuesday #005
    SQL Server: Using SQL Server Reporting Services to Manage Data
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Updating RoutingServices using Oracle ESB Client Management API

    Hi,
    How to update Routing Rules of a RoutingService using Oracle ESB Client Management API.
    Is there any other way other than console.
    Any help is really appriciated.
    Thanks

    I decompiled HttpClient and ConsoleClientImpl and this is what I found --- The following URL is what is constructed,
    http://localhost:80/esb/j_security_check and these parameters are passed as POST - j_username=oc4jadmin&j_password=welcome1
    I tried
    http://localhost:80/esb/j_security_check?j_username=oc4jadmin&j_password=welcome1
    and got 404 error.
    However, this exercise confirmed that hostname=localhost and port=80 is just fine.. the problem seems to lie somewhere else

  • Deploy Java and Oracle updates using SCCM 2007 Software Updates

    Hi Team,
    I am using SCCM 2007 to deploy software updates on all my servers. Now i want deploy updates fro third party tools like Adobe, Java etc..Please suggest me on how to deploy these updates using SCCM.
    I am looking for other simple solution than SCUP 2011. Please suggest.
    Thanks
    Siva

    Hi,
    SCUP 2011 would be the way to do it or a package/program. There are commercial software solutions that plugins to configuration Manager like Secunia
    http://secunia.com/vulnerability_scanning/corporate/sc2012_plugin/ ,Solarwinds
    http://www.solarwinds.com/patch-manager.aspx and Shavlik
    http://www.shavlik.com/products/scupdates/ that offer a subscription of updates for these products for a cost of course.
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

Maybe you are looking for

  • Possible to do in Forms app?

    Hello! I would like to add a realtime peak meter system to my EqAPO GUI's. Peak meter should be able to - read the peaks from system audio output (as does here in an example: https://msdn.microsoft.com/en-us/library/windows/desktop/dd316561(v=vs.85).

  • How to view parental/content ratings in iTunes???

    I have checked the box in Parental Preferences to "Show content ratings in library". Yet, I'm not seeing those ratings anywhere - only the popularity-type ratings. Where should I be looking to see the parental content ratings of my iTunes items???

  • Getting principal data as null in Adapter Module

    Hello Everyone, I am trying to work with Attachments in my Module. The Scenario I have configured is that I have a Sender File Adapter, which picks up 2 files one as body and the second as attachment : https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pu

  • Iphone shuffle Not Working Correctly

    Since doing a full restore of my iphone which reloaded all of my songs, my shuffle doesn't work correctly any more.  I'm on 5.1.1.  I start a shuffle and 2 or max 3 songs play and then it quits.  The screen shows the next song but no sound, either wi

  • Why won't my iMac or airbook (using 10.6.8) recongnise my Samsung galaxy S3 mini when I connect it via USB?

    I'm trying to connect a Samsung Galaxy S3 mini to my iMac (using 10.6.8). I used to be able to do this easily (fairly) with a Galaxy S2, but now neither my iMac nor my Airbook recongnise with S3 mini when I plug it in. IS there something in either th