Select PreparedStatement execution slowdown overtime - Oracle 10.2.0.1

This is a very confusing issue. We have a batch type application built on Hibernate using Oracle JDBC 10.2.0.1 drivers. Currently using a Spring configured connection pool (don't think this is the issue). Basically, the first step of the process involved looking up Subscriber information and related objects. This results in Hibernate pumping out lots and lots of sql, executing using PreparedStatement. I've profiled the code and the time is being spent in the execution of the SQL, post executeQuery call.
At the beginning performance is great, but over time, after about 50,000 invocations of the Subscriber search, the execution time starts to increase eventually to the point where it is taking 5 times as long to do a search as it did at the beginning. I have checked the usual suspects (polling for a resource, memory consumption etc..) and they all appear to be fine. And as I said, it is actually on the call to PreparedStatement.executeQuery that the time seems to grow. I created a test harness using a set of 100,000 Subscriber ids, replicated 40 times, and I can really get the application to slow down.
I've had a thought that it was maybe the size of TCP/IP buffer that maybe Hibernate was saturating the buffer.. I would prefer not to go playing with this, but I will if it's the way to go.
Has anyone come across this before. Is there some Oracle database kernal setting that I should be looking at here? I could really do with a little here so any advise given is much appreciated.
Jay

At the risk of stating the obvious...
UAT and Prod both use 10.2.0.3 and both work correctly. The 10.2.0.3 patchset has not yet been applied on dev, so dev is using an outdated version of Oracle. Why wouldn't you apply the 10.2.0.3 patchset to the dev environment and see if that solves the problem?
More generally, it seems very wrong to be running a later version of the database in UAT and in Prod than in dev. It seems particularly wrong to have a 10.1 development environment for a 10.2 production environment. It's also rather odd to have the development environment using Windows when the production environment is on Unix since that means any operating system dependent issues have to be discovered during UAT, which isn't particularly helpful.
Justin

Similar Messages

  • Difference in select for update of - in Oracle Database 10g and 11g

    Hi, I found out that Oracle Database 10g and 11g treat the following PL/SQL block differently (I am using scott schema for convenience):
    DECLARE
      v_ename bonus.ename%TYPE;
    BEGIN
      SELECT b.ename
        INTO v_ename
        FROM bonus b
        JOIN emp e ON b.ename = e.ename
        JOIN dept d ON d.deptno = e.deptno
       WHERE b.ename = 'Scott'
         FOR UPDATE OF b.ename;
    END;
    /While in 10g (10.2) this code ends successfully (well NO_DATA_FOUND exception is raised but that is expected), in 11g (11.2) it raises exception "column ambiguously defined". And that is definitely not expected. It seems like it does not take into account table alias because I found out that when I change the column in FOR UPDATE OF e.empno (also does not work) to e.mgr (which is unique) it starts working. So is this some error in 11g? Any thoughts?
    Edited by: Libor Nenadál on 29.4.2010 21:46
    It seems that my question was answered here - http://stackoverflow.com/questions/2736426/difference-in-select-for-update-of-in-oracle-database-10g-and-11g

    The behaviour seems like it really is a bug and can be avoided using non-ANSI syntax. (It makes me wonder why Oracle maintains two query languages while dumb me thinks that this is just a preprocessor matter and query engine could be the same).

  • Select DBase (.dbf) data from Oracle on Linux

    How to select DBase (.dbf) data from Oracle on Linux ?
    dbf files connected to Linux form NetWare server as 'ncpmount'.
    Oracle has access as oracle 'Directory' object.

    If you have an ODBC driver for it and are using Oracle 10g you can use Generic Connectivity. For more information on Generic Connectivity refer to the Chap 7 of the Heterogeneous Connectivity Administrator's Guide.
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10764/gencon.htm#1005900

  • Select DBASE IV data from Oracle on Linux

    Can I select DBASE IV data from Oracle on Linux

    You can connect to DBase IV from Oracle by configuring Oracle Heterogenous Services. That will let you create a database link from Oracle to a non-Oracle database. Since there isn't a specific DBASE IV gateway, though, I believe you'll have to use the ODBC gateway, which would probably imply the necessity of a Windows box hosting Heterogenous Services.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Limitation on SQL executing select statement from ADO and Oracle 8.1.7.1 OleDB Driver

    Hi,
    we are running a query with a big dunamic select statement from VB code using ADO command object. When Execute method is called system hangs and control won't return back to the application. it seems to be that there is some type limitation on Query string length. Please tell us if there is any?
    we are running Oracle 8.1.7 Server on Windows 200 Server and connecting from a W2K professional, ADO 2.6 and Oracle OLEDB 8.1.7.1 OLEDB Driver.
    Sample code:
    Dim rs As ADODB.Recordset
    Dim cmd As ADODB.Command
    Set cmd = New Command
    With cmd
    .CommandText = ' some text with more than 2500 characters
    .CommandType = adCmdText
    Set rs = .Execute
    End With
    when i debug using VB6 and when .Execute line is called system hangs or return a message method <<somemethod> of <<some class name>> failed error.
    Any help is appreciated.
    Thanks,
    Anil

    A stored procedure would only slow you down here if it was poorly written. I suspect you want to use the translate function. I'm cutting & pasting examples from the documentation-- a search at tahiti.oracle.com will give you all the info you'll need.
    Examples
    The following statement translates a license number. All letters 'ABC...Z' are translated to 'X' and all digits '012 . . . 9' are translated to '9':
    SELECT TRANSLATE('2KRW229',
    '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    '9999999999XXXXXXXXXXXXXXXXXXXXXXXXXX') "License"
    FROM DUAL;
    License
    9XXX999
    The following statement returns a license number with the characters removed and the digits remaining:
    SELECT TRANSLATE('2KRW229',
    '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789')
    "Translate example"
    FROM DUAL;
    Translate example
    2229
    Also, LIKE '%<string>%' is going to be rather expensive simply because it has to compare the entire string and because it forces full table scans, rather than using indexes. You could speed this sort of query up by using interMedia Text (Oracle Text now in 9i). If you can eliminate one of the '%' options, you could also improve things.
    My guess is that your stored procedure is inefficient and that's causing the problem-- 5k rows per table should be pretty trivial.
    If you post your query over on the PL/SQL forum, there are better performance tuners than I that might have more hints for you. To get really good advice, though, you'lllikely have to get at least the execution plan for this statement and may need to do some profiling to identify the problem areas.
    Justin

  • PreparedStatement not working with Oracle

    Hi All,
    I am using preparedStatement in my JDBC code to fetch/insert values from oracle9i database.
    I am checking condition like if a given record does not exist then insert it else update it.
    First time it works when there is no row in database, however for subsequent run it's not able to return me the result though that row exist in database and this resulting in DuplicateKeyException becuase it try to create the row in db again.
    The code is working fine for MySQL DB2 and SQLServer but doesn't work in case oracle 9i
    Here is mycode
    //problem is here 1st time it works next time it is not retunring true though record is there in DB.
    if(isItemExist("1","CORP"))
    updateItem("1","CORP","DESC1");
    else
    insertItem("1","CORP","DESC1");
    public boolean isItemExist(String itemid, String storeid)
    String FIND_SQL = "SELECT item_desc from item where item_id = ? and store_id = ? ";          
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    rs = ps.executeQuery();
    if(rs.next()){
         return true;
    utils.close(c, ps, rs);
    else{
         return false;
    utils.close(c, ps, rs);
    public void createItem(String itemid, String storeid, String item_desc)
    String INSERT_SQL = "INSERT INTO item(item_id,store_id,item_desc)values(?, ?, ?)";
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, itemid);
    ps.setString(i++, storeid);
    ps.setString(i++, item_desc);
    ps.executeUpdate();
    utils.close(c, ps, null);
    public void updateItem(String itemid, String storeid, String item_desc)
    String INSERT_SQL = "UPDATE item SET item_desc = ?, store_id=? WHERE item_id = ?";
    c = utils.getConnection();
    ps = c.prepareStatement();
    int i = 1;
    ps.setString(i++, item_desc);
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    ps.executeUpdate();
    utils.close(c, ps, null);
    Kindly suggest what's wrong with code. because same code works with other databse like SQL Server, MySQL but it is not working with oracle9i.

    if(isItemExist("1","CORP"))
    updateItem("1","CORP","DESC1");
    else
    insertItem("1","CORP","DESC1");
    String FIND_SQL = "SELECT item_desc from item where item_id = ? and store_id = ? ";
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);
    String INSERT_SQL = "INSERT INTO item(item_id,store_id,item_desc)values(?, ?, ?)";
    ps.setString(i++, itemid);
    ps.setString(i++, storeid);
    ps.setString(i++, item_desc);
    String INSERT_SQL = "UPDATE item SET item_desc = ?, store_id=? WHERE item_id = ?";
    ps.setString(i++, item_desc);
    ps.setString(i++, storeid);
    ps.setString(i++, itemid);My first guess, looking at the above snippets, would be that the item_id field is a number and not a string and so you should be calling ps.setInt instead of ps.setString when setting that parameter.
    This is only a guess, however, since you have not posted what the actual error is, which will probably give a hint to what the actual error is.

  • For r in (select) loop: execution plan question

    Hi there,
    I have a procedure which does the following (on Oracle 11.1.0.7):
    begin
      for r in (select col1,max(col2) as col2 from tab@remote_db group by col1 ) loop
        update tab2
           set col_a = r.co1
           where col_b = r.col2;
        commit;
      end loop;
    end;The subselect from the remote table delivers about 4000 rows.
    When executing fast, the procedure runs about 20 seconds, the trace shows that the select is executed 1 time, fetches 49 times. The update executes 4000 times.
    When executing slow, the procedure runs about 20 minutes (!), the trace shows that the select is executed 1 times, fetches 4000 times. The update executes 4000 times.
    This happens without changing the code, from the same client (sqlplus on the server, same version as database).
    Can anyone probably give me a clue how I could track down the plsql execution steps like the optimizer trace that let you see why a certain sqlplan was not taken or what might cause that change in behavior?
    I cannot produce that behavior at will - most times the procedure runs fast.
    thanks,
    Heimo

    Hi again,
    regarding the "faulty test" and what is fastest: user tested both versions and came up with the for-loop to satisfy him best. I would, of course, utilize event 10046 and tkprof and a repeatable dataset to have solid data. Sorry for not setting enough emphasis on my real question, which is described in the following.
    But, and that is what is really causing awkward feelings for me: when doing plain sql, I can use events 10046, 10053 and learn from the tracefiles why a decision was taken (now that is making me feel good, actually). But when it comes to plsql, I have not yet such a handy toolset that helps me understand what influences the plsql-engine to go this or that way.
    Thus, I valued the posts pointing to dbms_trace and plsql_optimization_level as helpful answers.
    Because of that I learned about the views %_PLSQL_OBJECT_SETTINGS and remembered to check for other plsql-initora settings.
    I also verified that neither the 10046 nor the 10053 trace files contain any reference to plsql-parameters/settings, and that the 10053 trace only shows the subselect and update, but no info if it would "bulkify" or not.
    Meanwhile I did start to utilize dbms_trace (which causes the statement to go the unbulkifyed by the way) and maybe I can learn from that output or from following posts?
    best regards
    Heimo

  • Very different execution plan in Oracle 10g vs. 9i

    Good afternoon,
    A few days ago I migrated an Oracle database 9i to 10g.
    Right now I have an exact copy of the 9i instance running on another machine.
    I noticed that the time for some queries take much more. For example, when comparing the execution plan for this query on the instance with Oracle 9i and Oracle 10g instance, I see that the cost in 10g is 94981765382, while in 9i is 120106.
    Any idea what might be happening?
    Execution Plan Oracle 9: http://blog.davidlozanolucas.com/uploads/execution_plan_Oracle_9i.jpg
    Execution Plan Oracle 10g: http://blog.davidlozanolucas.com/uploads/execution_plan_Oracle_10g.jpg
    Edited by: david_lozano_lucas on Dec 14, 2011 4:54 PM

    Sorry,
    Here are the details.
    For Oracle 9i:
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Pstart| Pstop | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 16M| 3675M| | 120K (0)| | | | | |
    |* 1 | FILTER | | | | | | | | | | |
    |* 2 | HASH JOIN | | 16M| 3675M| | 120K (0)| | | 03,09 | P->S | QC (RAND) |
    | 3 | TABLE ACCESS FULL | ORG_LOC_DM | 2261 | 13566 | | 8 (0)| | | 03,01 | S->P | HASH |
    |* 4 | HASH JOIN OUTER | | 16M| 3582M| 1023M| 120K (0)| | | 03,08 | P->P | HASH |
    |* 5 | HASH JOIN OUTER | | 16M| 2783M| 1041M| 102K (0)| | | 03,08 | PCWP | |
    |* 6 | HASH JOIN OUTER | | 16M| 2521M| 715M| 69515 (0)| | | 03,08 | PCWP | |
    | 7 | PARTITION RANGE ALL | | | | | | 1 | 14 | 03,08 | PCWP | |
    | 8 | TABLE ACCESS FULL | SURT_SKU_LD_DM | 16M| 1922M| | 60988 (0)| 1 | 14 | 03,04 | P->P | HASH |
    | 9 | VIEW | | 909K| 33M| | | | | 03,05 | P->P | HASH |
    | 10 | SORT GROUP BY | | 909K| 19M| 62M| 1553 (0)| | | 03,05 | PCWP | |
    |* 11 | HASH JOIN | | 909K| 19M| | 164 (0)| | | 03,05 | PCWP | |
    |* 12 | TABLE ACCESS FULL| ORG_LOC_DM | 1131 | 6786 | | 8 (0)| | | 03,00 | S->P | HASH |
    |* 13 | TABLE ACCESS FULL| INV_MOVE_SKU_LCM_DM | 909K| 13M| | 154 (0)| 60 | 60 | 03,02 | P->P | HASH |
    |* 14 | TABLE ACCESS FULL | SURT_SKU_LCM_DM | 16M| 260M| | 6457 (0)| 59 | 59 | 03,06 | P->P | HASH |
    | 15 | VIEW | | 1795K| 89M| | | | | 03,07 | P->P | HASH |
    | 16 | SORT GROUP BY | | 1795K| 63M| 233M| 4565 (0)| | | 03,07 | PCWP | |
    |* 17 | TABLE ACCESS FULL | SLS_SKU_LCM_DM | 1795K| 63M| | 599 (0)| 60 | 60 | 03,03 | P->P | HASH |
    | 18 | NESTED LOOPS | | 1 | 16 | | 7 (15)| | | | | |
    | 19 | TABLE ACCESS FULL | MAINT_LOAD_DT | 1 | 8 | | 1 (0)| | | | | |
    |* 20 | INDEX RANGE SCAN | DAY_IDNT_I1 | 1 | 8 | | 1 (0)| | | | | |
    Predicate Information (identified by operation id):
    1 - filter("SYS_ALIAS_1"."DAY_IDNT"= (SELECT /*+ */ :B1 FROM "RDW91_DM"."MAINT_LOAD_DT" "Y","RDW91_DM"."TIME_DAY_DM" "X" WHERE
    "X"."DAY_DT"="Y"."CURR_LOAD_DT"))
    2 - access("SYS_ALIAS_1"."LOC_KEY"="G"."LOC_KEY")
    4 - access("SYS_ALIAS_1"."LOC_KEY"="I"."LOC_KEY"(+) AND "SYS_ALIAS_1"."SKU_KEY"="I"."SKU_KEY"(+))
    5 - access("SYS_ALIAS_1"."LOC_KEY"="B"."LOC_KEY"(+) AND "SYS_ALIAS_1"."SKU_KEY"="B"."SKU_KEY"(+))
    6 - access("SYS_ALIAS_1"."LOC_KEY"="J"."LOC_KEY"(+) AND "SYS_ALIAS_1"."SKU_KEY"="J"."SKU_KEY"(+))
    11 - access("A"."LOC_KEY"="B"."LOC_KEY")
    12 - filter("B"."LOC_TYPE_CDE"='W')
    13 - filter("A"."CMTH_IDNT"=201112)
    14 - filter("B"."CMTH_IDNT"(+)=201111)
    17 - filter("SLS_SKU_LCM_DM"."CMTH_IDNT"=201112)
    20 - access("X"."DAY_DT"="Y"."CURR_LOAD_DT")
    For 10g:
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost | Pstart| Pstop | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 16M| 3685M| | 94G| | | | | |
    | 1 | FILTER | | | | | | | | | | |
    | 2 | PX COORDINATOR | | | | | | | | | | |
    | 3 | PX SEND QC (RANDOM) | :TQ10008 | 16M| 3685M| | 94G| | | Q1,08 | P->S | QC (RAND) |
    | 4 | BUFFER SORT | | 16M| 3685M| | | | | Q1,08 | PCWP | |
    | 5 | NESTED LOOPS OUTER | | 16M| 3685M| | 94G| | | Q1,08 | PCWP | |
    | 6 | HASH JOIN | | 16M| 3424M| | 201K| | | Q1,08 | PCWP | |
    | 7 | BUFFER SORT | | | | | | | | Q1,08 | PCWC | |
    | 8 | PX RECEIVE | | 2261 | 13566 | | 8 | | | Q1,08 | PCWP | |
    | 9 | PX SEND HASH | :TQ10001 | 2261 | 13566 | | 8 | | | | S->P | HASH |
    | 10 | TABLE ACCESS FULL | ORG_LOC_DM | 2261 | 13566 | | 8 | | | | | |
    | 11 | PX RECEIVE | | 16M| 3332M| | 201K| | | Q1,08 | PCWP | |
    | 12 | PX SEND HASH | :TQ10007 | 16M| 3332M| | 201K| | | Q1,07 | P->P | HASH |
    | 13 | HASH JOIN OUTER BUFFERED | | 16M| 3332M| 982M| 201K| | | Q1,07 | PCWP | |
    | 14 | HASH JOIN OUTER | | 16M| 2733M| 735M| 127K| | | Q1,07 | PCWP | |
    | 15 | PX RECEIVE | | 16M| 1934M| | 75785 | | | Q1,07 | PCWP | |
    | 16 | PX SEND HASH | :TQ10004 | 16M| 1934M| | 75785 | | | Q1,04 | P->P | HASH |
    | 17 | PX BLOCK ITERATOR | | 16M| 1934M| | 75785 | 1 | 14 | Q1,04 | PCWC | |
    | 18 | TABLE ACCESS FULL | SURT_SKU_LD_DM | 16M| 1934M| | 75785 | 1 | 14 | Q1,04 | PCWP | |
    | 19 | PX RECEIVE | | 1450K| 71M| | 3892 | | | Q1,07 | PCWP | |
    | 20 | PX SEND HASH | :TQ10005 | 1450K| 71M| | 3892 | | | Q1,05 | P->P | HASH |
    | 21 | VIEW | | 1450K| 71M| | 3892 | | | Q1,05 | PCWP | |
    | 22 | SORT GROUP BY | | 1450K| 53M| 188M| 3892 | | | Q1,05 | PCWP | |
    | 23 | PX RECEIVE | | 1450K| 53M| | 562 | | | Q1,05 | PCWP | |
    | 24 | PX SEND HASH | :TQ10002 | 1450K| 53M| | 562 | | | Q1,02 | P->P | HASH |
    | 25 | PX BLOCK ITERATOR | | 1450K| 53M| | 562 | 60 | 60 | Q1,02 | PCWC | |
    | 26 | MAT_VIEW ACCESS FULL| SLS_SKU_LCM_DM | 1450K| 53M| | 562 | 60 | 60 | Q1,02 | PCWP | |
    | 27 | PX RECEIVE | | 652K| 24M| | 1150 | | | Q1,07 | PCWP | |
    | 28 | PX SEND HASH | :TQ10006 | 652K| 24M| | 1150 | | | Q1,06 | P->P | HASH |
    | 29 | VIEW | | 652K| 24M| | 1150 | | | Q1,06 | PCWP | |
    | 30 | SORT GROUP BY | | 652K| 14M| | 1150 | | | Q1,06 | PCWP | |
    | 31 | HASH JOIN | | 652K| 14M| | 128 | | | Q1,06 | PCWP | |
    | 32 | BUFFER SORT | | | | | | | | Q1,06 | PCWC | |
    | 33 | PX RECEIVE | | 1131 | 6786 | | 8 | | | Q1,06 | PCWP | |
    | 34 | PX SEND HASH | :TQ10000 | 1131 | 6786 | | 8 | | | | S->P | HASH |
    | 35 | TABLE ACCESS FULL | ORG_LOC_DM | 1131 | 6786 | | 8 | | | | | |
    | 36 | PX RECEIVE | | 652K| 10M| | 118 | | | Q1,06 | PCWP | |
    | 37 | PX SEND HASH | :TQ10003 | 652K| 10M| | 118 | | | Q1,03 | P->P | HASH |
    | 38 | PX BLOCK ITERATOR | | 652K| 10M| | 118 | 60 | 60 | Q1,03 | PCWC | |
    | 39 | MAT_VIEW ACCESS FULL| INV_MOVE_SKU_LCM_DM | 652K| 10M| | 118 | 60 | 60 | Q1,03 | PCWP | |
    | 40 | PARTITION RANGE SINGLE | | 1 | 17 | | 8609 | 59 | 59 | Q1,08 | PCWP | |
    | 41 | TABLE ACCESS FULL | SURT_SKU_LCM_DM | 1 | 17 | | 8609 | 59 | 59 | Q1,08 | PCWP | |
    | 42 | NESTED LOOPS | | 1 | 16 | | 6 | | | | | |
    | 43 | TABLE ACCESS FULL | MAINT_LOAD_DT | 1 | 8 | | 1 | | | | | |
    | 44 | INDEX RANGE SCAN | DAY_IDNT_I1 | 1 | 8 | | 5 | | | | | |
    Note
    - 'PLAN_TABLE' is old version
    - cpu costing is off (consider enabling it)

  • Select query is working on oracle 10.1.0 but its not working in 10.2.0

    select query is working and retrieving some data from oracle database server 10.1.0.2.0, but same query is not working in 10.2.0.1.0 database server, its throws(ORA-00942: table or view does not exist)
    But schema related tables and relevant details are same in 10.2.0.1.0 database server, so don't think that table is missing on that schema.
    Note: Query length is upto 480 line
    I have validate all the things, everything is fine, i don't why that query is not executing in different version.
    I am in helpless in this situation?, anybody faced this issue?
    Thanks in advance

    Validated means all the tables and and columns are verified, i just running in sqlprompt,
    Say for example:
    sql> select * from table1;
    One thing i observed while executing the query its showed error in one location of select sql. i mean particular word in select sql.
    After that i combined some three lines of huge select sql into single then i am getting error in different location i mean different word...
    My question is how same query executing in Oracle 10g Release 1, same dump (its exported from Release1) imported into oracle 10g release 2 is not executing. its shows Table or view doesn't exit.

  • Can select, but cannot insert into oracle tables using php.

    I am having trouble inserting data into a tables in oracle using PHP. I can insert into the tables using baninst1, but nothing else. I can't even insert using the tables' owner. Every time I try I get the ORA-00492 error of table or view does not exist. However, I can run a select statement just fine. So far, baninst1 is the only user that can actually do inserts. I've triple checked all the table grants and everything is fine. Also, I can copy/paste the exact insert statement into SQL*Plus and it works with the correct user. It doesn't have to be baninst1. I've tried everything I can think of. I've tried putting the table name in quotes, adding the schema name to the table, checking public synonyms, but everything appears to be ok. I would greatly appreciate any suggestions others may have.
    I'm using PHP 5.2.3 with an oracle 9i DB.

    Here is the code that doesn't work. It works only with baninst1, no other username will work and all I do is change the my_username/my_password to something different. This is one example function where I try to do an insert, but it doesn't work on any of the tables I try.
    Thanks for looking.
    class Oracle {
         private $oracleUser = "my_username";
         private $oraclePassword = "my_password";
         private $oracleDB = "MY_DB";
         private $c = null;
         function Connect() {
              if ( !($this->c = ocilogon( $this->oracleUser, $this->oraclePassword, $this->oracleDB ) ) )
                   return false;
              return true;
         function AddNewTest($testName, $course, $section, $term, $maxAttempts, $length, $startDate, $startTime, $endDate, $endTime)
              $result = "";
              if( $this->c == null )
                   $this->Connect();     
              $splitIndex = strpos($course, " ");
              $subjectCode = substr($course, 0, $splitIndex);
              $courseNumber = substr($course, $splitIndex + 1);
              $insertStatment = "insert into szbtestinfo(szbtestinfo_test_name,
                                                                szbtestinfo_course_numb,
                                                           szbtestinfo_section,
                                                                szbtestinfo_max_attempts,
                                                                szbtestinfo_length_minutes,
                                                                szbtestinfo_start,
                                                                szbtestinfo_end,
                                                                szbtestinfo_id,
                                                                szbtestinfo_subj_code,
                                                                szbtestinfo_eff_term)
                                                                values( '" . $testName .
                   "', '" . $courseNumber .
                   "', '" . $section .
                   "', " . $maxAttempts .
                   ", " . $length .
                   ", to_date('" . $startDate . " " . $startTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", to_date('" . $endDate . " " . $endTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", szsnexttest.nextval" .
                   ", '" . $subjectCode .
                   "', '" . $term . "')";
              //return $insertStatment;
              $s = OCIParse($this->c, $insertStatment);
              try
                   $result = OCIExecute($s);
              catch(exception $e)
              return $result;
         }

  • Select option in time using oracle

    i attach an excel file in oracle, i have a time field in my table, i give the select option in time ie, i select the time 4:00:00 - 6:00:00 in that time period data will display,
    for example html format ie, output format.

    Hi
    No!
    U need to find a way to convert a range of select-option to a range for Native SQL, probably it should be better doesn't use a select-option for the date but two parameters: one for date from and one for date to.
    Max

  • Multiple Row selection in JSP using checkbox - Oracle BPM 10gR3

    Dear BPM Experts,
    Has anyone invoked JSP from Oracle BPM 10gR3 screen flow that has the following UI requirement.
    1. When UI is loaded user is presented with multiple rows of pre-populated data(each column of the row represents attributes of a BPM object) with checkbox against each of the rows for user to select one, many and all rows.
    2. User has option to select one, many and all rows and submit the form.
    3. Upon submission, the all data related to selected rows only should made available to a BPM process(either using Global Creation or Global Interactive activity)
    I was able to have the JSP created with FTL tags but unable to transmit the data back to BPM process. Same has been accomplished using BPM Presentation. Can any one please help me with the JSP implementation? It is little urgent, so your early intervention is much solicited and coveted.
    I will send you guys the code I have in case you need to review.
    Regards,
    Subho

    Hi friends
    I need to do the same feature, select elements, but in a tree object. I've followed the same approach - using a selectBooleanCheckBox in each node of the Tree. But, when I submit the page, the boolean property of my TreeNode object isnt changed.
    An Idea?
    thanks a lot!

  • Select count(*) from table in oracle 11g with direct path read takes time

    select count(*) from table takes long time, even more than couple of hours..
    direct path read is the wait event which is almost is at 99%..
    can u someone provide some info on this.. on solution.. thankx

    knowledgespring wrote:
    table has millions of records... 130 millions..
    select count(*) from BIG_SIZE_TABLE; --- executed in sql plus command prompt.
    Rows     Execution Plan
    0  SELECT STATEMENT   MODE: ALL_ROWS
    0   SORT (AGGREGATE)
    0    TABLE ACCESS   MODE: ANALYZED (FULL) OF 'BIG_SIZE_TABLE' (TABLE)
    Elapsed times include waiting on following events:
    Event waited on                             Times   Max. Wait  Total Waited
    ----------------------------------------   Waited  ----------  ------------
    SQL*Net message to client                       1        0.00          0.00
    enq: KO - fast object checkpoint                1        0.01          0.01
    Disk file operations I/O                       18        0.00          0.00
    direct path read                            58921        0.34        418.54direct path read time waited is : 58921 total time waited: 418.54
    That 418 seconds - not the hours you reported earlier. Is it possible that your connection to the database broke ?
    On a typical system, by the way, you can usually turn one direct read for tablescan into 1MB, so your scan seems to have covered about 59 GB, which seems to be in the right sort of ballpark for 130M rows.
    we have another query and when we test the query execution using v$sql, is_bind_sensitive =N, how to make is_bind_sensitive=Y all the time.. There is a hint /*+ bind_aware */ - I'd have to check whether or not it's documented at present. It might help.
    I would be interested in hearing why you think the hint should be bind sensitive when the optimizer doesn't.
    Regards
    Jonathan Lewis

  • PreparedStatement execution cause OutOfMemoryException

    Hello,
    I use PreparedStatement for getting data from database. It works well unless there is much data to get. If the result set has many rows (over 1000000) I get OutOfMemory error. I tried use Statement instead of PreparedStatement and tried to set my parameters value manually, but it doesn't work (in postgre database):
    sqlQuery = select * from employee_tmp where hire_date > ?; PreparedStatement st = connection.prepareStatement(sqlQuery); st.setDate(1, myDate); ResultSet rs = st.executeQuery();
    Result is OK, but for much data I get OutOfMemory error.
    sqlQuery = select * from employee_tmp where hire_date > myDate.toString(); Statement st = connection.createStatement(); ResultSet rs = st.executeQuery(sqlQuery);
    Getting data from database is fast, but I get all records, not only these from the first case.
    Thank you for any help in advanced.
    Agata

    agad wrote:
    Hello,
    I use PreparedStatement for getting data from database. It works well unless there is much data to get. If the result set has many rows (over 1000000) I get OutOfMemory error. I tried use Statement instead of PreparedStatement and tried to set my parameters value manually, but it doesn't work (in postgre database):
    sqlQuery = select * from employee_tmp where hire_date > ?;
    PreparedStatement st = connection.prepareStatement(sqlQuery);
    st.setDate(1, myDate);
    ResultSet rs = st.executeQuery();Result is OK, but for much data I get OutOfMemory error.
    sqlQuery = select * from employee_tmp where hire_date > myDate.toString();
    Statement st = connection.createStatement();
    ResultSet rs = st.executeQuery(sqlQuery);Getting data from database is fast, but I get all records, not only these from the first case.
    Thank you for any help in advanced.
    AgataThe PreparedStatement itself should definately not cause an OutOfMemoryException. Are you maybe looping through the ResultSet and storing the rows in an List or something? If it is truely the Driver throwing it, then ask at a PostGreSQL Driver forum, and probably post a bug report (to PostGreSQL, not Sun).

  • SELECT from MySQL, INSERT into Oracle

    Hallo,
    I am new to Java.
    My task is to collect data from about 30 tables inside MySQL database and then insert it to similar tables in Oracle.
    Script should copy data one a day, during the night.
    Number of rows in each table is about 30,000.
    MySQL version 5.1
    Oracle version 11.1.7
    Both of them are installed on really fast servers.
    The way i would do it is:
    1. connect to MySQL
    2. connect to Oracle
    3. select data from MySQL table and insert it to Oracle table.
    repeat this step for each table
    More precise about SELECT and INSERT:
    handle_one = "SELECT a, b, c FROM mysql_table1";
    while(handle_one is true)
    INSERT a, b, c INTO oracle_table1;
    4. close MySQL connection
    5. close Oracle connection
    Is it best way?
    Best Regards
    slk

    slkLinuxUser wrote:
    Script should copy data one a day, during the night.
    Number of rows in each table is about 30,000.There are variations on the above depending on what the above two statements mean.

Maybe you are looking for

  • Just upgraded my iPad Mini software and now it is stuck in a reboot and won't come on.  Please help!

    Hello. I just noticed that a software update was available.  I think it was iOS7.  Did not really take note of what it was.  But now my iPad Mini won't come on.  it is stuck in a reboot and has been that way for at least an hour.  Just tried to attac

  • Vendor Text / Internal notes during Invoice creation

    Hello, We can create user ID for a Vendor contact using "Employee for Business partner" under "Manage Business partner" option. With this user ID, while trying to create an Invoice, Vendor text / Internal notes drop down does not appear under "Docume

  • How can I change the plotting options in an xy-graph?

    I am trying to plot an xy-graph, such that the data points are plotted as circles and connected by lines that stay horizontal at the level of the data point and then go up vertically at the next datapoint. In the properties menu for xy-graphs this op

  • Capturing action Event in the Embedding View

    Hi Experts,               I embedded View B in the View A through View UI Element Container, Now through the WDMODIFYVIEW we are creating elements in the View B. Now  we need to create elements based upon the Actions performed in the View A. How to c

  • Why won't my Photoshop Elements 11 install?

    After entering the Serial # and my Adobe ID, I get to the Options tab on the installation. There is a grey checkmark next to Adobe Photoshop Element... which I can't click, I also can't click on All Components at the top, but, I can choose the Locati