Deadlock detected in one single insert

          We have a deadlock problem in our application, we are using
          weblogic server 6 and Oracle 8 database, when running to a
          ceartain time, oracle will detect a deadlock problem, actually
          from the stack trace, it is when EntityBean using
          ejbCreate to create new record, oracle server threw an
          ORA-00060 SQLException, complaining about deadlock detected.
          The enitty Bean has its own transaction. Could anyone tell me
          a scenario that when inserting a record will have deadlock?
          Since our entity bean has its own transaction and inside this
          transaction, it only creates a new record, also it does not hold
          other resource, why deadlock porblem pop up?
          Thanks for your help.
          Following is the exception trace:
          (null)/java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
          java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
               at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
               at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
               at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
               at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
               at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738)
               at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
               at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
               at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
               at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
               at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1805)
               at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:322)
               at weblogic.jdbcbase.jts.Statement.executeUpdate(Statement.java:345)
               at glog.util.jdbc.SqlUpdate.resetArguments(SqlUpdate.java:94)
               at glog.util.jdbc.SqlUpdate.execute(SqlUpdate.java:60)
               at glog.util.remote.BeanManagedEntityBean.executeUpdate(BeanManagedEntityBean.java:499)
               at glog.util.remote.BeanManagedEntityBean$1.execute(BeanManagedEntityBean.java:144)
               at glog.util.remote.BeanManagedEntityBean.dbModify(BeanManagedEntityBean.java:777)
               at glog.util.remote.BeanManagedEntityBean.doCreate(BeanManagedEntityBean.java:141)
               at glog.util.remote.BaseEntityBean$1.doIt(BaseEntityBean.java:376)
               at glog.util.remote.BaseEntityBean.ejb(BaseEntityBean.java:651)
               at glog.util.remote.BaseEntityBean.ejbCreator(BaseEntityBean.java:374)
               at glog.ejb.orderbase.db.ObLineBeanDB.ejbCreate(ObLineBeanDB.java:64)
               at glog.ejb.orderbase.ObLineBeanImpl.ejbCreate(ObLineBeanImpl.java:1273)
               at java.lang.reflect.Method.invoke(Native Method)
               at weblogic.ejb20.manager.ExclusiveEntityManager.create(ExclusiveEntityManager.java:446)
               at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:353)
               at glog.ejb.orderbase.ObLineBeanHomeImpl.create(ObLineBeanHomeImpl.java:133)
               at java.lang.reflect.Method.invoke(Native Method)
               at glog.util.remote.BeanBaseInvoker.invoke(BeanBaseInvoker.java:24)
               at glog.util.remote.EntityBeanHomeInvoker.create(EntityBeanHomeInvoker.java:49)
               at glog.util.persistence.PersistenceListener.insertPerformed(PersistenceListener.java:114)
          

try this please
INSERT ALL
INTO RD_CARRY_NEW1 VALUES
    SSM_ID,
    ROLLDOWN,
    OAS,
    carry,
    finance_rate,
    price_drop,
    heldby_pco_sw,
    rolldown_bk1,
    rolldown_bk2,
    r_srm_flag,
    o_srm_flag,
    c_srm_flag,
    F_SRM_FLAG,
    rolldown_method
INTO RD_FINANCE_NEW1 VALUES
    SSM_ID,
    ROLLDOWN,
    OAS,
    carry,
    finance_rate,
    price_drop,
    heldby_pco_sw,
    rolldown_bk1,
    rolldown_bk2,
    r_srm_flag,
    o_srm_flag,
    c_srm_flag,
    F_SRM_FLAG,
    rolldown_method
INTO PCO_OWN.RD_ROLLDOWN_NEW1 VALUES
    SSM_ID,
    ROLLDOWN,
    OAS,
    carry,
    finance_rate,
    price_drop,
    heldby_pco_sw,
    rolldown_bk1,
    rolldown_bk2,
    r_srm_flag,
    o_srm_flag,
    c_srm_flag,
    F_SRM_FLAG,
    rolldown_method
SELECT s.ssm_id,
  NVL(srm.rolldown,0) AS rolldown,
  v_zero              AS oas,
  v_zero              AS carry,
  v_zero              AS finance_rate,
  v_zero              AS price_drop,
  sw.heldby_pco_sw,
  v_zero            AS rolldown_bk1,
  v_zero            AS rolldown_bk2,
  'Y              ' AS r_srm_flag,
  'Y              ' AS o_srm_flag,
  'Y              ' AS c_srm_flag,
  'Y              ' AS f_srm_flag,
  'SRM'             AS rolldown_method
FROM sec_tab_sdb s,
  sr_measures srm,
  sec_sw sw
WHERE s.ssm_id = srm.ssm_id
AND s.ssm_id   = sw.ssm_id;

Similar Messages

  • One single insert for multiple inserts if the tables in from are same

    Hi all,
    Can I have a single insert for below 3 insert stm.
    declare
    v_z number;
    begin
    v_z :=0.0;
    INSERT INTO rd_carry_new1
    SELECT  s.ssm_id,
         s.ssm_id as adjusted_cusip,
         v_z as rolldown, --= @zero,                     
         v_z as oas, --=@zero,                     
         nvl(srm.carry_rate, 0.0) as carry,
         v_z as finance_rate, --= @zero,                           
         v_z as price_drop, --= @zero,
         sw.heldby_pco_sw,
         v_z as carry_bk1, --= @zero,        -- place holders for interim results
         v_z as carry_bk2, --= @zero,
         'Y              ' AS r_srm_flag,     --r_srm_flag     = "Y              ", /*-- Indicates value from SRM, stale these should not be updated at any point*/
         'Y              ' AS o_srm_flag,     --o_srm_flag     = "Y              ",
         'Y              ' AS c_srm_flag,     --c_srm_flag     = "Y              ",
         'Y              ' AS f_srm_flag,     --f_srm_flag     = "Y              "
         'SRM' AS oas_method                         --,          oas_method='SRM'
    FROM  sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    WHERE s.ssm_id = srm.ssm_id
    AND   s.ssm_id = sw.ssm_id;
    insert into rd_finance_new1
    select  s.ssm_id,
         v_z as rolldown,                     
         v_z as oas,                     
         v_z as carry,                        
         nvl(srm.financing_rate,0) as finance_rate,    
         v_z as price_drop,
         sw.heldby_pco_sw,
         v_z as rolldown_bk1,        -- place holders for interim results
         v_z as rolldown_bk2,
         'SRM'  as finance_method, -- audit for financing_rate queries
         'Y              ' as r_srm_flag,    -- Indicates value from SRM, stale these should not be updated at any point
         'Y              ' as o_srm_flag,
         'Y              ' as c_srm_flag,
         'Y              ' as f_srm_flag
    from  sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    where s.ssm_id = srm.ssm_id
    and   s.ssm_id = sw.ssm_id;
    insert into  pco_on.rd_rolldown_new1
    select s.ssm_id,
            nvl(srm.rolldown,0) as rolldown,    
            v_z as oas,                     
            v_z as carry,                          
            v_z as finance_rate,                           
            v_z as price_drop,
            sw.heldby_pco_sw,
            v_z as rolldown_bk1,             -- place holders for interim results
            v_z as rolldown_bk2,
            'Y              ' as r_srm_flag,   -- Indicates value from SRM, stale these should not be updated at any point
            'Y              ' as o_srm_flag,     
            'Y              ' as c_srm_flag,     
            'Y              ' as f_srm_flag,     
            'SRM'        as  rolldown_method
    from  sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    where s.ssm_id = srm.ssm_id
    and   s.ssm_id = sw.ssm_id;
    end;

    try this please
    INSERT ALL
    INTO RD_CARRY_NEW1 VALUES
        SSM_ID,
        ROLLDOWN,
        OAS,
        carry,
        finance_rate,
        price_drop,
        heldby_pco_sw,
        rolldown_bk1,
        rolldown_bk2,
        r_srm_flag,
        o_srm_flag,
        c_srm_flag,
        F_SRM_FLAG,
        rolldown_method
    INTO RD_FINANCE_NEW1 VALUES
        SSM_ID,
        ROLLDOWN,
        OAS,
        carry,
        finance_rate,
        price_drop,
        heldby_pco_sw,
        rolldown_bk1,
        rolldown_bk2,
        r_srm_flag,
        o_srm_flag,
        c_srm_flag,
        F_SRM_FLAG,
        rolldown_method
    INTO PCO_OWN.RD_ROLLDOWN_NEW1 VALUES
        SSM_ID,
        ROLLDOWN,
        OAS,
        carry,
        finance_rate,
        price_drop,
        heldby_pco_sw,
        rolldown_bk1,
        rolldown_bk2,
        r_srm_flag,
        o_srm_flag,
        c_srm_flag,
        F_SRM_FLAG,
        rolldown_method
    SELECT s.ssm_id,
      NVL(srm.rolldown,0) AS rolldown,
      v_zero              AS oas,
      v_zero              AS carry,
      v_zero              AS finance_rate,
      v_zero              AS price_drop,
      sw.heldby_pco_sw,
      v_zero            AS rolldown_bk1,
      v_zero            AS rolldown_bk2,
      'Y              ' AS r_srm_flag,
      'Y              ' AS o_srm_flag,
      'Y              ' AS c_srm_flag,
      'Y              ' AS f_srm_flag,
      'SRM'             AS rolldown_method
    FROM sec_tab_sdb s,
      sr_measures srm,
      sec_sw sw
    WHERE s.ssm_id = srm.ssm_id
    AND s.ssm_id   = sw.ssm_id;

  • ORA-00060: deadlock detected while waiting for resource CLOSE cursor

    Hi,
    I am a new member of this forum. I am working with a problem we got a few weeks ago. It is from a Pro C batch executable running on 10 threads dealing with >800 data accessed from multiple tables. The error as reported came from a package.function call.
    This is the error I encountered:
    process_item~G****, D***~-60~ORA-00060: deadlock detected while waiting for resource~PACKAGE ERROR = CLOSE cursor C_***** in package R***.I*** 7641
    The cursor is a simple SELECT cursor without Table or Record locking.
    My questions are:
    *Upon the occurrence of this error, is the execution already at the CLOSE cursor line or did the error occurred between the OPEN cursor and the CLOSE cursor? There are several lines of code in between OPEN and CLOSE:
    - one that calls for a package.function that simply stores parameter values to a variable
    - another one which fetches the cursor. The group that holds the cursor values is only used by a single function in the package
    *Is it possible for this CLOSE cursor to cause a deadlock? What could have caused this?
    *From what I know, Oracle deals with deadlocks by aborting the deadlocking process while others continue, but this deadlock caused our program to hang. How is this possible? Could the root cause of the deadlock be from our threading program? This is a rare occurrence and happened only twice this year.
    Thanks,
    Raf

    Raf Serrano wrote:
    Hi,
    I am a new member of this forum. I am working with a problem we got a few weeks ago. It is from a Pro C batch executable running on 10 threads dealing with >800 data accessed from multiple tables. The error as reported came from a package.function call.
    This is the error I encountered:
    process_item~G****, D***~-60~ORA-00060: deadlock detected while waiting for resource~PACKAGE ERROR = CLOSE cursor C_***** in package R***.I*** 7641
    The cursor is a simple SELECT cursor without Table or Record locking.
    My questions are:
    *Upon the occurrence of this error, is the execution already at the CLOSE cursor line or did the error occurred between the OPEN cursor and the CLOSE cursor? There are several lines of code in between OPEN and CLOSE:
    - one that calls for a package.function that simply stores parameter values to a variable
    - another one which fetches the cursor. The group that holds the cursor values is only used by a single function in the package
    *Is it possible for this CLOSE cursor to cause a deadlock? What could have caused this?
    *From what I know, Oracle deals with deadlocks by aborting the deadlocking process while others continue, but this deadlock caused our program to hang. How is this possible? Could the root cause of the deadlock be from our threading program? This is a rare occurrence and happened only twice this year.
    Thanks,
    RafSELECT (without FOR UPDATE) statements are never involved in ORA-00060.
    only DML statements throw ORA-00060 error

  • Getting deadlock detected while waiting for resource error for select Query.....

    Hi all,
    i am getting a below error whenever executing the below select query....
    some times it will show dead lock detected while waiting for resource and terminated...
    some times it executes and gives result..
    but all the time it writes an alert to alert log
    Plesae suggest how to resolve the issue..........
    Thanks in advance
    Env: Linux / Oracle 11.2.0.3.3
    Error from alert log:
    Errors in file /u01/oracle/oracle/diag/rdbms/bdrdb/bdrdb/trace/bdrdb_p017_6076.trc:
    ORA-00060: deadlock detected while waiting for resource
    ORA-10387: parallel query server interrupt (normal)
    Trace file info... bdrdb_p017_6076.trc:
    Trace file /u01/oracle/oracle/diag/rdbms/bdrdb/bdrdb/trace/bdrdb_p017_6076.trc
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORACLE_HOME = /u01/oracle/oracle/product/11.2.0/dbhome_1
    System name:    Linux
    Node name:      bdrdb.cteplindia.com
    Release:        2.6.18-308.el5PAE
    Version:        #1 SMP Fri Jan 27 17:40:09 EST 2012
    Machine:        i686
    Instance name: bdrdb
    Redo thread mounted by this instance: 1
    Oracle process number: 92
    Unix process pid: 6076, image: [email protected] (P017)
    *** 2013-11-04 23:18:57.915
    *** SESSION ID:(423.59970) 2013-11-04 23:18:57.915
    *** CLIENT ID:() 2013-11-04 23:18:57.915
    *** SERVICE NAME:(bdrdb) 2013-11-04 23:18:57.915
    *** MODULE NAME:() 2013-11-04 23:18:57.915
    *** ACTION NAME:() 2013-11-04 23:18:57.915
    *** 2013-11-04 23:18:57.915
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    Deadlock graph:
                           ---------Blocker(s)--------  ---------Waiter(s)---------
    Resource Name          process session holds waits  process session holds waits
    PS-00000001-00000011        92     423     S             33     128     S     X
    BF-2ed08c01-00000000        33     128     S             92     423     S     X
    session 423: DID 0001-005C-00081126     session 128: DID 0001-0021-00067D23
    session 128: DID 0001-0021-00067D23     session 423: DID 0001-005C-00081126
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    Deadlock graph:
                           ---------Blocker(s)--------  ---------Waiter(s)---------
    Resource Name          process session holds waits  process session holds waits
    PS-00000001-00000011        92     423     S             33     128     S     X
    BF-2ed08c01-00000000        33     128     S             92     423     S     X
    session 423: DID 0001-005C-00081126     session 128: DID 0001-0021-00067D23
    session 128: DID 0001-0021-00067D23     session 423: DID 0001-005C-00081126
    Rows waited on:
      Session 423: no row
      Session 128: obj - rowid = 00021DC1 - AAAh3BAAVAAAQL/AAA
      (dictionary objn - 138689, file - 21, block - 66303, slot - 0)
    ----- Information for the OTHER waiting sessions -----
    Session 128:
      sid: 128 ser: 46176 audsid: 1836857 user: 102/DBLOCAL
        flags: (0x8000041) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
        flags2: (0x40009) -/-/INC
      pid: 33 O/S info: user: oracle, term: UNKNOWN, ospid: 31611
        image: [email protected]
      client details:
        O/S info: user: masked, term: masked, ospid: 5924:568
        machine: masked program: Toad.exe
        application name: TOAD background query session, hash value=526966934
      current SQL:
        application name: TOAD background query session, hash value=526966934
      current SQL:
      SELECT  DISTINCT B_FP_TEST.TEST_ID
      FROM B_FP_TEST,
           B_USER_INFO,
           J_FP_INVESTIGATOR,
           L_TEST_STATUS,
           L_ATMS_TEST_TYPE,
           j_op_test_anml
    WHERE     B_FP_TEST.TEST_ID = J_FP_INVESTIGATOR.TEST_ID
           AND B_FP_TEST.TEST_TYPE_ID = L_ATMS_TEST_TYPE.ATMS_TEST_TYPE_ID
           AND B_USER_INFO.B_USER_INFO_ID = J_FP_INVESTIGATOR.INVESTIGATOR_ID
           AND B_FP_TEST.STATUS_ID = L_TEST_STATUS.STATUS_ID
           AND B_FP_TEST.IS_DELETED = :"SYS_B_00"
           AND B_FP_TEST.TEST_NUM NOT IN (:"SYS_B_01", :"SYS_B_02", :"SYS_B_03")
           AND L_ATMS_TEST_TYPE.IS_DELETED = :"SYS_B_04"
           AND J_FP_INVESTIGATOR.is_pi = :"SYS_B_05"
           AND L_TEST_STATUS.STATUS IN (:"SYS_B_06", :"SYS_B_07", :"SYS_B_08")
           AND j_op_test_anml.test_id = B_FP_TEST.TEST_ID
    ----- End of information for the OTHER waiting sessions -----
    *** 2013-11-04 23:18:57.916
    dbkedDefDump(): Starting a non-incident diagnostic dump (flags=0x0, level=3, mask=0x0)
    ----- Error Stack Dump -----
    ORA-00060: deadlock detected while waiting for resource
    ORA-10387: parallel query server interrupt (normal)
    ----- SQL Statement (None) -----
    Current SQL information unavailable - no cursor.
    ----- Call Stack Trace -----
    calling              call     entry                argument values in hex
    location             type     point                (? means dubious value)
    More......
    Query:
    SELECT DISTINCT B_FP_TEST.TEST_ID
      FROM B_FP_TEST,
           B_USER_INFO,
           J_FP_INVESTIGATOR,
           L_TEST_STATUS,
           L_ATMS_TEST_TYPE,
           j_op_test_anml
    WHERE     B_FP_TEST.TEST_ID = J_FP_INVESTIGATOR.TEST_ID
           AND B_FP_TEST.TEST_TYPE_ID = L_ATMS_TEST_TYPE.ATMS_TEST_TYPE_ID
           AND B_USER_INFO.B_USER_INFO_ID = J_FP_INVESTIGATOR.INVESTIGATOR_ID
           AND B_FP_TEST.STATUS_ID = L_TEST_STATUS.STATUS_ID
           AND B_FP_TEST.IS_DELETED = 0
           AND B_FP_TEST.TEST_NUM NOT IN (1, 2, 99)
           AND L_ATMS_TEST_TYPE.IS_DELETED = 0
           AND J_FP_INVESTIGATOR.is_pi = 1
           AND L_TEST_STATUS.STATUS IN ('Scheduled', 'In-Progress', 'Completed')
           AND j_op_test_anml.test_id = B_FP_TEST.TEST_ID
           AND (   (j_op_test_anml.end_date BETWEEN TO_DATE ('28-Oct-2013') - 1
                                                AND TO_DATE ('04-Nov-2013') + 1)
                OR (j_op_test_anml.start_date BETWEEN TO_DATE ('28-Oct-2013') - 1
                                                  AND TO_DATE ('04-Nov-2013') + 1)
                OR (TO_DATE ('28-Oct-2013') BETWEEN j_op_test_anml.start_date
                                                AND j_op_test_anml.end_date)
                OR (TO_DATE ('04-Nov-2013') BETWEEN j_op_test_anml.start_date
                                                AND j_op_test_anml.end_date))
           AND L_ATMS_TEST_TYPE.IS_DELETED = 0
           AND B_FP_TEST.DATASOURCE_ID = 9
    Query Exp plan:
    Plan hash value: 3398228788
    | Id  | Operation                                          | Name                | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT                                   |                     |  1501 |   102K|  1929   (1)| 00:00:24 |       |       |        |      |            |
    |   1 |  HASH UNIQUE                                       |                     |  1501 |   102K|  1929   (1)| 00:00:24 |       |       |        |      |            |
    |   2 |   CONCATENATION                                    |                     |       |       |            |          |       |       |        |      |            |
    |   3 |    PX COORDINATOR                                  |                     |       |       |            |          |       |       |        |      |            |
    |   4 |     PX SEND QC (RANDOM)                            | :TQ30005            |   241 | 16870 |   800   (1)| 00:00:10 |       |       |  Q3,05 | P->S | QC (RAND)  |
    |*  5 |      HASH JOIN                                     |                     |   241 | 16870 |   800   (1)| 00:00:10 |       |       |  Q3,05 | PCWP |            |
    |   6 |       PX RECEIVE                                   |                     |   246 | 15990 |   797   (1)| 00:00:10 |       |       |  Q3,05 | PCWP |            |
    |   7 |        PX SEND HASH                                | :TQ30004            |   246 | 15990 |   797   (1)| 00:00:10 |       |       |  Q3,04 | P->P | HASH       |
    |*  8 |         HASH JOIN                                  |                     |   246 | 15990 |   797   (1)| 00:00:10 |       |       |  Q3,04 | PCWP |            |
    |   9 |          PX RECEIVE                                |                     |   573 | 29223 |   793   (1)| 00:00:10 |       |       |  Q3,04 | PCWP |            |
    |  10 |           PX SEND HASH                             | :TQ30003            |   573 | 29223 |   793   (1)| 00:00:10 |       |       |  Q3,03 | P->P | HASH       |
    |* 11 |            HASH JOIN                               |                     |   573 | 29223 |   793   (1)| 00:00:10 |       |       |  Q3,03 | PCWP |            |
    |  12 |             BUFFER SORT                            |                     |       |       |            |          |       |       |  Q3,03 | PCWC |            |
    |  13 |              PX RECEIVE                            |                     |       |       |            |          |       |       |  Q3,03 | PCWP |            |
    |  14 |               PX SEND BROADCAST                    | :TQ30000            |       |       |            |          |       |       |        | S->P | BROADCAST  |
    |  15 |                NESTED LOOPS                        |                     |       |       |            |          |       |       |        |      |            |
    |  16 |                 NESTED LOOPS                       |                     |   485 | 20855 |   781   (0)| 00:00:10 |       |       |        |      |            |
    |  17 |                  TABLE ACCESS BY GLOBAL INDEX ROWID| J_OP_TEST_ANML      |   485 | 10185 |   296   (0)| 00:00:04 | ROWID | ROWID |        |      |            |
    |* 18 |                   INDEX RANGE SCAN                 | IDX$$_2D190001      |   485 |       |     4   (0)| 00:00:01 |       |       |        |      |            |
    |* 19 |                  INDEX UNIQUE SCAN                 | FT_TEST_ID_PK       |     1 |       |     0   (0)| 00:00:01 |       |       |        |      |            |
    |* 20 |                 TABLE ACCESS BY GLOBAL INDEX ROWID | B_FP_TEST           |     1 |    22 |     1   (0)| 00:00:01 | ROWID | ROWID |        |      |            |
    |  21 |             PX BLOCK ITERATOR                      |                     | 70382 |   549K|    11   (0)| 00:00:01 |       |       |  Q3,03 | PCWC |            |
    |* 22 |              TABLE ACCESS FULL                     | J_FP_INVESTIGATOR   | 70382 |   549K|    11   (0)| 00:00:01 |       |       |  Q3,03 | PCWP |            |
    |  23 |          BUFFER SORT                               |                     |       |       |            |          |       |       |  Q3,04 | PCWC |            |
    |  24 |           PX RECEIVE                               |                     |     3 |    42 |     3   (0)| 00:00:01 |       |       |  Q3,04 | PCWP |            |
    |  25 |            PX SEND HASH                            | :TQ30001            |     3 |    42 |     3   (0)| 00:00:01 |       |       |        | S->P | HASH       |
    |* 26 |             TABLE ACCESS FULL                      | L_TEST_STATUS       |     3 |    42 |     3   (0)| 00:00:01 |       |       |        |      |            |
    |  27 |       BUFFER SORT                                  |                     |       |       |            |          |       |       |  Q3,05 | PCWC |            |
    |  28 |        PX RECEIVE                                  |                     |    30 |   150 |     3   (0)| 00:00:01 |       |       |  Q3,05 | PCWP |            |
    |  29 |         PX SEND HASH                               | :TQ30002            |    30 |   150 |     3   (0)| 00:00:01 |       |       |        | S->P | HASH       |
    |* 30 |          TABLE ACCESS FULL                         | L_ATMS_TEST_TYPE    |    30 |   150 |     3   (0)| 00:00:01 |       |       |        |      |            |
    |  31 |    NESTED LOOPS                                    |                     |       |       |            |          |       |       |        |      |            |
    |  32 |     NESTED LOOPS                                   |                     |     3 |   210 |   329   (1)| 00:00:04 |       |       |        |      |            |
    |  33 |      NESTED LOOPS                                  |                     |     3 |   195 |   329   (1)| 00:00:04 |       |       |        |      |            |
    |* 34 |       HASH JOIN                                    |                     |     2 |   114 |   325   (1)| 00:00:04 |       |       |        |      |            |
    |  35 |        NESTED LOOPS                                |                     |       |       |            |          |       |       |        |      |            |
    |  36 |         NESTED LOOPS                               |                     |     6 |   258 |   322   (1)| 00:00:04 |       |       |        |      |            |
    |  37 |          PARTITION RANGE SINGLE                    |                     |     6 |   126 |   316   (1)| 00:00:04 |     7 |     7 |        |      |            |
    |* 38 |           TABLE ACCESS FULL                        | J_OP_TEST_ANML      |     6 |   126 |   316   (1)| 00:00:04 |     7 |     7 |        |      |            |
    |* 39 |          INDEX UNIQUE SCAN                         | FT_TEST_ID_PK       |     1 |       |     0   (0)| 00:00:01 |       |       |        |      |            |
    |* 40 |         TABLE ACCESS BY GLOBAL INDEX ROWID         | B_FP_TEST           |     1 |    22 |     1   (0)| 00:00:01 | ROWID | ROWID |        |      |            |
    |* 41 |        TABLE ACCESS FULL                           | L_TEST_STATUS       |     3 |    42 |     3   (0)| 00:00:01 |       |       |        |      |            |
    |* 42 |       TABLE ACCESS BY INDEX ROWID                  | J_FP_INVESTIGATOR   |     1 |     8 |     2   (0)| 00:00:01 |       |       |        |      |            |
    |* 43 |        INDEX RANGE SCAN                            | FI_TEST_ID_PK       |     1 |       |     1   (0)| 00:00:01 |       |       |        |      |            |
    |* 44 |      INDEX UNIQUE SCAN                             | L_ATMS_TEST_TYPE_PK |     1 |       |     0   (0)| 00:00:01 |       |       |        |      |            |
    |* 45 |     TABLE ACCESS BY INDEX ROWID                    | L_ATMS_TEST_TYPE    |     1 |     5 |     1   (0)| 00:00:01 |       |       |        |      |            |
    |  46 |    PX COORDINATOR                                  |                     |       |       |            |          |       |       |        |      |            |
    |  47 |     PX SEND QC (RANDOM)                            | :TQ20003            |       |       |            |          |       |       |  Q2,03 | P->S | QC (RAND)  |
    |  48 |      NESTED LOOPS                                  |                     |       |       |            |          |       |       |  Q2,03 | PCWP |            |
    |  49 |       NESTED LOOPS                                 |                     |    33 |  2310 |   399   (2)| 00:00:05 |       |       |  Q2,03 | PCWP |            |
    |* 50 |        HASH JOIN                                   |                     |    33 |  2145 |   397   (2)| 00:00:05 |       |       |  Q2,03 | PCWP |            |
    |  51 |         PX RECEIVE                                 |                     |    78 |  3978 |   393   (1)| 00:00:05 |       |       |  Q2,03 | PCWP |            |
    |  52 |          PX SEND HASH                              | :TQ20002            |    78 |  3978 |   393   (1)| 00:00:05 |       |       |  Q2,02 | P->P | HASH       |
    |* 53 |           HASH JOIN                                |                     |    78 |  3978 |   393   (1)| 00:00:05 |       |       |  Q2,02 | PCWP |            |
    |  54 |            BUFFER SORT                             |                     |       |       |            |          |       |       |  Q2,02 | PCWC |            |
    |  55 |             PX RECEIVE                             |                     |       |       |            |          |       |       |  Q2,02 | PCWP |            |
    |  56 |              PX SEND BROADCAST                     | :TQ20000            |       |       |            |          |       |       |        | S->P | BROADCAST  |
    |  57 |               NESTED LOOPS                         |                     |       |       |            |          |       |       |        |      |            |
    |  58 |                NESTED LOOPS                        |                     |    66 |  2838 |   382   (1)| 00:00:05 |       |       |        |      |            |
    |  59 |                 PARTITION RANGE SINGLE             |                     |    66 |  1386 |   316   (1)| 00:00:04 |     7 |     7 |        |      |            |
    |* 60 |                  TABLE ACCESS FULL                 | J_OP_TEST_ANML      |    66 |  1386 |   316   (1)| 00:00:04 |     7 |     7 |        |      |            |
    |* 61 |                 INDEX UNIQUE SCAN                  | FT_TEST_ID_PK       |     1 |       |     0   (0)| 00:00:01 |       |       |        |      |            |
    |* 62 |                TABLE ACCESS BY GLOBAL INDEX ROWID  | B_FP_TEST           |     1 |    22 |     1   (0)| 00:00:01 | ROWID | ROWID |        |      |            |
    |  63 |            PX BLOCK ITERATOR                       |                     | 70382 |   549K|    11   (0)| 00:00:01 |       |       |  Q2,02 | PCWC |            |
    |* 64 |             TABLE ACCESS FULL                      | J_FP_INVESTIGATOR   | 70382 |   549K|    11   (0)| 00:00:01 |       |       |  Q2,02 | PCWP |            |
    |  65 |         BUFFER SORT                                |                     |       |       |            |          |       |       |  Q2,03 | PCWC |            |
    |  66 |          PX RECEIVE                                |                     |     3 |    42 |     3   (0)| 00:00:01 |       |       |  Q2,03 | PCWP |            |
    |  67 |           PX SEND HASH                             | :TQ20001            |     3 |    42 |     3   (0)| 00:00:01 |       |       |        | S->P | HASH       |
    |* 68 |            TABLE ACCESS FULL                       | L_TEST_STATUS       |     3 |    42 |     3   (0)| 00:00:01 |       |       |        |      |            |
    |* 69 |        INDEX UNIQUE SCAN                           | L_ATMS_TEST_TYPE_PK |     1 |       |     0   (0)| 00:00:01 |       |       |  Q2,03 | PCWP |            |
    |* 70 |       TABLE ACCESS BY INDEX ROWID                  | L_ATMS_TEST_TYPE    |     1 |     5 |     1   (0)| 00:00:01 |       |       |  Q2,03 | PCWP |            |
    |  71 |    PX COORDINATOR                                  |                     |       |       |            |          |       |       |        |      |            |
    |  72 |     PX SEND QC (RANDOM)                            | :TQ10003            |       |       |            |          |       |       |  Q1,03 | P->S | QC (RAND)  |
    |  73 |      NESTED LOOPS                                  |                     |       |       |            |          |       |       |  Q1,03 | PCWP |            |
    |  74 |       NESTED LOOPS                                 |                     |    33 |  2310 |   399   (2)| 00:00:05 |       |       |  Q1,03 | PCWP |            |
    |* 75 |        HASH JOIN                                   |                     |    34 |  2210 |   397   (2)| 00:00:05 |       |       |  Q1,03 | PCWP |            |
    |  76 |         PX RECEIVE                                 |                     |    78 |  3978 |   393   (1)| 00:00:05 |       |       |  Q1,03 | PCWP |            |
    |  77 |          PX SEND HASH                              | :TQ10002            |    78 |  3978 |   393   (1)| 00:00:05 |       |       |  Q1,02 | P->P | HASH       |
    |* 78 |           HASH JOIN                                |                     |    78 |  3978 |   393   (1)| 00:00:05 |       |       |  Q1,02 | PCWP |            |
    |  79 |            BUFFER SORT                             |                     |       |       |            |          |       |       |  Q1,02 | PCWC |            |
    |  80 |             PX RECEIVE                             |                     |       |       |            |          |       |       |  Q1,02 | PCWP |            |
    |  81 |              PX SEND BROADCAST                     | :TQ10000            |       |       |            |          |       |       |        | S->P | BROADCAST  |
    |  82 |               NESTED LOOPS                         |                     |       |       |            |          |       |       |        |      |            |
    |  83 |                NESTED LOOPS                        |                     |    66 |  2838 |   382   (1)| 00:00:05 |       |       |        |      |            |
    |  84 |                 PARTITION RANGE SINGLE             |                     |    66 |  1386 |   316   (1)| 00:00:04 |     7 |     7 |        |      |            |
    |* 85 |                  TABLE ACCESS FULL                 | J_OP_TEST_ANML      |    66 |  1386 |   316   (1)| 00:00:04 |     7 |     7 |        |      |            |
    |* 86 |                 INDEX UNIQUE SCAN                  | FT_TEST_ID_PK       |     1 |       |     0   (0)| 00:00:01 |       |       |        |      |            |
    |* 87 |                TABLE ACCESS BY GLOBAL INDEX ROWID  | B_FP_TEST           |     1 |    22 |     1   (0)| 00:00:01 | ROWID | ROWID |        |      |            |
    |  88 |            PX BLOCK ITERATOR                       |                     | 70382 |   549K|    11   (0)| 00:00:01 |       |       |  Q1,02 | PCWC |            |
    |* 89 |             TABLE ACCESS FULL                      | J_FP_INVESTIGATOR   | 70382 |   549K|    11   (0)| 00:00:01 |       |       |  Q1,02 | PCWP |            |
    |  90 |         BUFFER SORT                                |                     |       |       |            |          |       |       |  Q1,03 | PCWC |            |
    |  91 |          PX RECEIVE                                |                     |     3 |    42 |     3   (0)| 00:00:01 |       |       |  Q1,03 | PCWP |            |
    |  92 |           PX SEND HASH                             | :TQ10001            |     3 |    42 |     3   (0)| 00:00:01 |       |       |        | S->P | HASH       |
    |* 93 |            TABLE ACCESS FULL                       | L_TEST_STATUS       |     3 |    42 |     3   (0)| 00:00:01 |       |       |        |      |            |
    |* 94 |        INDEX UNIQUE SCAN                           | L_ATMS_TEST_TYPE_PK |     1 |       |     0   (0)| 00:00:01 |       |       |  Q1,03 | PCWP |            |
    |* 95 |       TABLE ACCESS BY INDEX ROWID                  | L_ATMS_TEST_TYPE    |     1 |     5 |     1   (0)| 00:00:01 |       |       |  Q1,03 | PCWP |            |
    Predicate Information (identified by operation id):
       5 - access("B_FP_TEST"."TEST_TYPE_ID"="L_ATMS_TEST_TYPE"."ATMS_TEST_TYPE_ID")
       8 - access("B_FP_TEST"."STATUS_ID"="L_TEST_STATUS"."STATUS_ID")
      11 - access("B_FP_TEST"."TEST_ID"="J_FP_INVESTIGATOR"."TEST_ID")
      18 - access("J_OP_TEST_ANML"."START_DATE">=TO_DATE(' 2013-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-11-05
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
      19 - access("J_OP_TEST_ANML"."TEST_ID"="B_FP_TEST"."TEST_ID")
      20 - filter("B_FP_TEST"."DATASOURCE_ID"=9 AND "B_FP_TEST"."IS_DELETED"=0 AND "B_FP_TEST"."TEST_NUM"<>1 AND "B_FP_TEST"."TEST_NUM"<>2 AND
                  "B_FP_TEST"."TEST_NUM"<>99)
      22 - filter("J_FP_INVESTIGATOR"."IS_PI"=1)
      26 - filter("L_TEST_STATUS"."STATUS"='Completed' OR "L_TEST_STATUS"."STATUS"='In-Progress' OR "L_TEST_STATUS"."STATUS"='Scheduled')
      30 - filter("L_ATMS_TEST_TYPE"."IS_DELETED"=0)
      34 - access("B_FP_TEST"."STATUS_ID"="L_TEST_STATUS"."STATUS_ID")
      38 - filter("J_OP_TEST_ANML"."END_DATE">=TO_DATE(' 2013-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "J_OP_TEST_ANML"."END_DATE"<=TO_DATE(' 2013-11-05
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND (LNNVL("J_OP_TEST_ANML"."START_DATE">=TO_DATE(' 2013-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR
                  LNNVL("J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-11-05 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))))
      39 - access("J_OP_TEST_ANML"."TEST_ID"="B_FP_TEST"."TEST_ID")
      40 - filter("B_FP_TEST"."DATASOURCE_ID"=9 AND "B_FP_TEST"."IS_DELETED"=0 AND "B_FP_TEST"."TEST_NUM"<>1 AND "B_FP_TEST"."TEST_NUM"<>2 AND
                  "B_FP_TEST"."TEST_NUM"<>99)
      41 - filter("L_TEST_STATUS"."STATUS"='Completed' OR "L_TEST_STATUS"."STATUS"='In-Progress' OR "L_TEST_STATUS"."STATUS"='Scheduled')
      42 - filter("J_FP_INVESTIGATOR"."IS_PI"=1)
      43 - access("B_FP_TEST"."TEST_ID"="J_FP_INVESTIGATOR"."TEST_ID")
      44 - access("B_FP_TEST"."TEST_TYPE_ID"="L_ATMS_TEST_TYPE"."ATMS_TEST_TYPE_ID")
      45 - filter("L_ATMS_TEST_TYPE"."IS_DELETED"=0)
      50 - access("B_FP_TEST"."STATUS_ID"="L_TEST_STATUS"."STATUS_ID")
      53 - access("B_FP_TEST"."TEST_ID"="J_FP_INVESTIGATOR"."TEST_ID")
      60 - filter("J_OP_TEST_ANML"."END_DATE">=TO_DATE(' 2013-11-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-11-04
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND (LNNVL("J_OP_TEST_ANML"."END_DATE">=TO_DATE(' 2013-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR
                  LNNVL("J_OP_TEST_ANML"."END_DATE"<=TO_DATE(' 2013-11-05 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))) AND (LNNVL("J_OP_TEST_ANML"."START_DATE">=TO_DATE(' 2013-10-27
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR LNNVL("J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-11-05 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))))
      61 - access("J_OP_TEST_ANML"."TEST_ID"="B_FP_TEST"."TEST_ID")
      62 - filter("B_FP_TEST"."DATASOURCE_ID"=9 AND "B_FP_TEST"."IS_DELETED"=0 AND "B_FP_TEST"."TEST_NUM"<>1 AND "B_FP_TEST"."TEST_NUM"<>2 AND
                  "B_FP_TEST"."TEST_NUM"<>99)
      64 - filter("J_FP_INVESTIGATOR"."IS_PI"=1)
      68 - filter("L_TEST_STATUS"."STATUS"='Completed' OR "L_TEST_STATUS"."STATUS"='In-Progress' OR "L_TEST_STATUS"."STATUS"='Scheduled')
      69 - access("B_FP_TEST"."TEST_TYPE_ID"="L_ATMS_TEST_TYPE"."ATMS_TEST_TYPE_ID")
      70 - filter("L_ATMS_TEST_TYPE"."IS_DELETED"=0)
      75 - access("B_FP_TEST"."STATUS_ID"="L_TEST_STATUS"."STATUS_ID")
      78 - access("B_FP_TEST"."TEST_ID"="J_FP_INVESTIGATOR"."TEST_ID")
      85 - filter("J_OP_TEST_ANML"."END_DATE">=TO_DATE(' 2013-10-28 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-10-28
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND (LNNVL("J_OP_TEST_ANML"."END_DATE">=TO_DATE(' 2013-11-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR
                  LNNVL("J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-11-04 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))) AND (LNNVL("J_OP_TEST_ANML"."END_DATE">=TO_DATE(' 2013-10-27
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR LNNVL("J_OP_TEST_ANML"."END_DATE"<=TO_DATE(' 2013-11-05 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))) AND
                  (LNNVL("J_OP_TEST_ANML"."START_DATE">=TO_DATE(' 2013-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR LNNVL("J_OP_TEST_ANML"."START_DATE"<=TO_DATE(' 2013-11-05
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss'))))
      86 - access("J_OP_TEST_ANML"."TEST_ID"="B_FP_TEST"."TEST_ID")
      87 - filter("B_FP_TEST"."DATASOURCE_ID"=9 AND "B_FP_TEST"."IS_DELETED"=0 AND "B_FP_TEST"."TEST_NUM"<>1 AND "B_FP_TEST"."TEST_NUM"<>2 AND
                  "B_FP_TEST"."TEST_NUM"<>99)
      89 - filter("J_FP_INVESTIGATOR"."IS_PI"=1)
      93 - filter("L_TEST_STATUS"."STATUS"='Completed' OR "L_TEST_STATUS"."STATUS"='In-Progress' OR "L_TEST_STATUS"."STATUS"='Scheduled')
      94 - access("B_FP_TEST"."TEST_TYPE_ID"="L_ATMS_TEST_TYPE"."ATMS_TEST_TYPE_ID")
      95 - filter("L_ATMS_TEST_TYPE"."IS_DELETED"=0)

    Excellent piece of follow-up on my first suggestion.
    I nearly made a comment about how the plan doesn't show Bloom filter pruning either - and then I realised why not. The plan you've shown us comes from Explain Plan with literal values present; the trace file shows bind variables with names that are generated when cursor_sharing is set to force or similar - so the run-time plan and the plan from explain plan are almost guaranteed to be different.
    Oracle support will need you to supply the plan you get from trying to run the query and then making a call to dbms_xplan.display_cursor() - dbms_xplan in 10g | Oracle Scratchpad If you do this I think you'll find that the pstart/pstop columns contain entries like :BF0000, and you may even find operations link PX JOIN FILTER CREATE / PX JOIN FILTER USE
    A couple of generic notes:
    if a query does sufficient work to merit parallel execution, then it's usually better to supply the best possible information to the optimizer, which means using literals rather than bind variables - you could try executing the query with the hint /*+ cursor_sharing_exact */ to stop Oracle from turning your literals into binds; it might be the presence of bind variables that's making the optimizer choose a path that has to include bloom filter pruning in your case.
    Where you have the to_date() call you've used a four-digit year - which is a very good thing and helps the optimizer - but it's also a good idea to include an explicit format string as well: with a four-digit year this probably won't make any difference, but it avoids any risk of ambiguity for the optimizer.
    I made a comment about the P->S stage and bottlenecks - I spent a couple more minutes looking at the plan, and I see the optimizer has used concatentation: in effect it has run three query blocks one after the other and fed the results to the query co-ordinator - in this case the P->S would make no difference to the end-user response time there's always a final P->S to the coordinator, you just happen to have three of them.
    Regards
    Jonathan Lewis

  • Fix for ORA-00060: Deadlock detected errors

    Hello APEX community,
    in the last days we are hitting more and more frequent the ORA-00060: Deadlock detected error in one of our applications. Logged an SR with Oracle Support but so far not too much help, except pointing to some older bugs:
    Bug 6618662: APEX APPEARS TO BE CAUSING DEADLOCK - CASE COLLECTION or Bug 7587013: INSERTING AND DELETING WWV_FLOW_DATA CAUSES DEADLOCK, which do not look at all appealing as the first bug was logged in Nov 2007 and the resolution was delayed from version 3.1, to 4.0 and even to 4.1, while de second was logged in Nov 2008 and not much happened with it.
    I am curious how many other users are hitting the same issue and which workarounds found for the problem. For example yesterday I could see 12 such errors in my log, today already 3.
    Florin

    Hi John,
    here it is: http://www.moyersoen.be/auction/1442/ or http://www.moyersoen.be/pls/apex/f?p=2008:11:0::::P11_AUCTION_ID:1442. Normally the page response time is < 0.20, but from time to time it goes up to more than 20 seconds and at those times I can see also the ORA-00060: Deadlock detected errors.
    Looks like the users are clicking twice refresh for that page. I am trying now to build a testcase that reproduce the issue easily.
    Florin

  • Can I create one single  crystal report using 2 bex queries

    HI all,
    I have 2 bex queries and has to develope a single crystal report .Is it possible???? If so, than how to connect two bex queries  and develope  one single crystal report.Any other option is also fine. I mean ....no need to use crystal..( I can go for one single webi..).But need to know the approach ...
    or else...can I create universe on 1 bex and other universe on other bex ..and go for one single webi report..
    Only problem is client is particular about one single report(either crystal or webi)
    if i go for webi ...I know we can use link universe option but I dont know whether it works fro OLAP environment.
    Please let me know if I can link OLAp universes and go for 1 single webi report.
    Any help is appreciated.
    Thanks in advance,
    Mahathi

    You can use either CR or WebI.
    In CR Designer create the report using the SAP toolbar (Create report from query) based on the 1st BEx query. Then use the Database expert (first entry in the Database menu) to add an additional connection to your 2nd BEx query (+Create new connection->SAP BW DX query). You can then join the results of the 2 different queries in the database expert also.. Please note that if you do NOT want to join the result sets, then it is more efficient to use subreports. Create two different CR reports, each based on one of the BEx queries and then use one of those as your main report and insert the other one into it as subreport. Once embedded you do not have to keep the separate .rpt file of your second report.
    For Webi you must build 2 universes, each based on one of your BEx queries. In your report you can add multiple queries based on different universes. You can join the results sets here by using the Merge dimensions button in the report editor area.
    Regards,
    Stratos
    PS; Keep in mind that joining a large number of rows at report level (either in CR or WebI) can cause performance problems. If this is your requirement, how many rows do you expect to get back from each individual query?

  • JDAPI Error: ORA-04020: deadlock detected while trying to lock object

    I have written a JDAPI program to perform read-only impact analysis and report any problems.
    The following error is occurring:
    "A deadlock among DDL and parse locks is detected.
    This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
    ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
    The error refers to a procedure in a PL/SQL library.
    In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
    Any ideas?
    Thanks,
    Neville Sweet.

    I have written a JDAPI program to perform read-only impact analysis and report any problems.
    The following error is occurring:
    "A deadlock among DDL and parse locks is detected.
    This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
    ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
    The error refers to a procedure in a PL/SQL library.
    In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
    Any ideas?
    Thanks,
    Neville Sweet.

  • ORA-00060: deadlock detected while waiting for resource with Tbs Read-only

    Hi all,
    We're using Oracle 10.2.0.1 and 9.2.0.4.
    I'm testing the performing of a procedure that inserts, like this:
    CREATE OR REPLACE PROCEDURE P$TAD_TEST
    IS
    TYPE T_T1_C1          IS TABLE OF T1.C1%TYPE INDEX BY PLS_INTEGER;
    TYPE T_T1_DT           IS TABLE OF T1.DT%TYPE INDEX BY PLS_INTEGER;
    P_C1 T_T1_C1;
    P_DT T_T1_DT;
    P_RESULT NUMBER;
    BEGIN
    FOR j IN 1..4032 LOOP
    P_C1(j) := j;
    P_DT(j) := SYSDATE + (j/24/60);
    END LOOP;
    FORALL i IN P_C1.FIRST..P_C1.LAST SAVE EXCEPTIONS
    INSERT INTO T1 VALUES (P_C1(i), P_DT(i));
    EXCEPTION
    WHEN OTHERS THEN
    P_RESULT := SQLCODE;
    END;
    The table T1 is partitioned across 10 tablespaces. The test consist to take
    these tablespace read-only and perform the procedure, and analyze the results,
    like erros.
    but when I perform the procedure, The alert.log indicates the error
    ORA-00060: deadlock detected while waiting for resource.
    Why this occurs only the tablespaces are read-only?
    thank you!!!!

    Hi,
    yesterday we got this error again(in fact twice) and we were able to get the trace file. It says this is NOT oracle error. i was wrong in suspecting Oracle. This is the trace file details. i dont know how to debug this. Any help appreciated.
    *** 2010-06-15 16:24:29.243
    *** ACTION NAME:() 2010-06-15 16:24:29.231
    *** MODULE NAME:(JDBC Thin Client) 2010-06-15 16:24:29.231
    *** SERVICE NAME: 2010-06-15 16:24:29.231
    *** SESSION ID:(482.4266) 2010-06-15 16:24:29.231
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TX-00300021-0000b52d 209 482 X 247 474 S
    TX-002a0009-00011b24 247 474 X 209 482 S
    session 482: DID 0001-00D1-0000000A session 474: DID 0001-00F7-00000008
    session 474: DID 0001-00F7-00000008 session 482: DID 0001-00D1-0000000A
    Rows waited on:
    Session 474: obj - rowid = 0000CED4 - AAAM7UAAxAAAVgSAAA
    (dictionary objn - 52948, file - 49, block - 88082, slot - 0)
    Session 482: obj - rowid = 0000D8BF - AAANi/AAuAAB+z/AAA
    (dictionary objn - 55487, file - 46, block - 519423, slot - 0)
    Information on the OTHER waiting sessions:
    Session 474:
    pid=247 serial=31796 audsid=25502259 user: 62/USER
    O/S info: ....
    program: JDBC Thin Client
    application name: JDBC Thin Client, hash value=2546894660
    Current SQL Statement:
    INSERT QUERY1
    End of information on OTHER waiting sessions.
    Current SQL statement for this session:
    INSERT QUERY2
    Thanks,
    AK

  • How do I change headers and footers in one single document in Pages?

    How do I change headers and footers in one single document in Pages? I would appreciate any help as this seems to be quite frustrating. Thanks so much!!

    Why are you not sure whether you have Mavericks or not?
    And what version of Pages are you talking about?
    Insert a Section Break and uncheck the copies previous option.
    All the Headers and Footers are the same within a Section.
    Peter

  • Deadlock detected but lmd log not found

    We've an Oracle 10g RAC database. The version number is: 10.2.0.3.0. In one application sometimes we get deadlock error. When we check the alert log we see:
    Global Enqueue Services Deadlock detected. More info in file
    /oracle/product/admin/WEBCREAL/bdump/webcreal1_lmd0_27191.trc.
    But when we checkthe folder /oracle/product/admin/WEBCREAL/bdump/ we do not see any log that contains the string "lmd0". We've also checked adump, udump folders but there is no file. I've even applied below command to find all files that contains "lmd0" but I've found only some old log files:
    find / -name "*lmd*"I think there is a problem with lmd0 trace file generation but I can not find the root cause.
    Any suggestion about this problem?

    Your find statement is anyway wrong, because you should use wildcards like here:
    wcsprd@vsv1h181ps:/opt/wcsprd/ora/diag/rdbms/wcsprd/WCSPRD2 $ find . -name "lmd"-- Nothing found here
    wcsprd@vsv1h181ps:/opt/wcsprd/ora/diag/rdbms/wcsprd/WCSPRD2 $ find . -name "*lmd*"
    ./trace/WCSPRD2_lmd0_1527948.trc
    ./trace/WCSPRD2_lmd0_1634460.trm
    ./trace/WCSPRD2_lmd0_1527948.trm
    ./trace/WCSPRD2_lmd0_467134.trc
    ./trace/WCSPRD2_lmd0_467134.trm
    ./trace/WCSPRD2_lmd0_462908.trc
    ./trace/WCSPRD2_lmd0_462908.trm
    ./trace/WCSPRD2_lmd0_1478740.trc
    ./trace/WCSPRD2_lmd0_1478740.trm
    ./trace/WCSPRD2_lmd0_1634460.trc
    ./trace/WCSPRD2_lmd0_626694.trc
    ./trace/WCSPRD2_lmd0_626694.trm
    ./trace/WCSPRD2_lmd0_860250.trc
    ./trace/WCSPRD2_lmd0_860250.trmCan it be that there is a cleanup process running on your system to clean out the log/trace directories in order to save disk space??
    Otherwise the file must be there

  • Inserting multiple rows using a single Insert statement without using dual

    Hi all,
    i am trying to insert multiple rows using a single insert statement like the below one.
    The below one works fine..
    But is there any other change that can be done in the below one without using dual...
    insert all
    into ps_hd_samp (num1,num2) values (1,1)
    into ps_hd_samp (num1,num2) values (2,2)
    into ps_hd_samp (num1,num2) values (3,3)
    select 1 from dual;

    NiranjanSe wrote:
    Hi all,
    i am trying to insert multiple rows using a single insert statement like the below one.
    The below one works fine..
    But is there any other change that can be done in the below one without using dual...
    insert all
    into ps_hd_samp (num1,num2) values (1,1)
    into ps_hd_samp (num1,num2) values (2,2)
    into ps_hd_samp (num1,num2) values (3,3)
    select 1 from dual;
    SQL> create table ps_hd_samp (num1 number,num2 number);
    Table created.
    SQL> insert all
      2  into ps_hd_samp (num1,num2) values (1,1)
      3  into ps_hd_samp (num1,num2) values (2,2)
      4  into ps_hd_samp (num1,num2) values (3,3)
      5  select count(*)
      6  from ps_hd_samp;
    3 rows created.
    SQL> select * from ps_hd_samp;
          NUM1       NUM2
             1          1
             2          2
             3          3

  • DEADLOCK DETECTED == wwv_flow_data

    I was hoping (praying) someone could shed further light on why we are experiencing deadlocks in our APEX business applications. We have a number of large organisations using our business suite of apex applications (all LIVE - searches, inserts, updates, deletes) and we are currently struggling to find out what's causing deadlocks that are being generated (these are severely affecting the server performance etc). I know it's difficult to summarise what's causing without a reproducible example but unfortunately we also cannot reproduce it at our developement centre. It is currently only occuring at customer sites on a consistent basis.
    Does anyone have any idea how we can go about tracing the cause of these Deadlocks ?
    Why are they occurring - there is no specific dml against apex dictionary tables (api's are alwasy used to do things like set session state, clear cache etc)
    All we currently have is the generated trace file and some Deadlock examples are below. Why is it always the 'wwv_flow_data' table ?
    Also, the majority of them seem to be updating an item to an apex URL (bind vars separated by colons) ie :B6 || ':' || :B5 || ':' || :B4 || ':' || :B3
    An example is:
    *** 2009-09-29 10:50:24.760
    *** ACTION NAME:(PAGE 169) 2009-09-29 10:50:24.759
    *** MODULE NAME:(APEX:APPLICATION 147) 2009-09-29 10:50:24.759
    *** SERVICE NAME:(SYS$USERS) 2009-09-29 10:50:24.759
    *** CLIENT ID:(GHANZANFARJ:2261912940872031) 2009-09-29 10:50:24.759
    *** SESSION ID:(4947.3819) 2009-09-29 10:50:24.759
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TX-0089002a-00032b7e 1008 4947 X 710 3585 X
    TX-01240010-00023f5f 710 3585 X 1008 4947 X
    session 4947: DID 0001-03F0-00000028     session 3585: DID 0001-02C6-00000087
    session 3585: DID 0001-02C6-00000087     session 4947: DID 0001-03F0-00000028
    Rows waited on:
    Session 3585: obj - rowid = 0004AC08 - AABKwIAAaAAAEX1ABZ
    (dictionary objn - 306184, file - 26, block - 17909, slot - 89)
    Session 4947: obj - rowid = 0004AC08 - AABKwIAAaAAAEX1ABX
    (dictionary objn - 306184, file - 26, block - 17909, slot - 87)
    Information on the OTHER waiting sessions:
    Session 3585:
    pid=710 serial=6190 audsid=169143612 user: 6970/<none>
    O/S info: user: oracle, term: , ospid: 2113768, machine: rbisprodapp
    program: httpd@rbisprodapp (TNS V1-V3)
    client info: GHANZANFARJ
    application name: APEX:APPLICATION 147, hash value=3432819319
    action name: PAGE 169, hash value=1337406124
    Current SQL Statement:
    UPDATE WWV_FLOW_DATA SET ITEM_VALUE = :B6 || ':' || :B5 || ':' || :B4 || ':' || :B3 WHERE FLOW_INSTANCE = :B2 AND ITEM_ID = :B1
    End of information on OTHER waiting sessions.
    Current SQL statement for this session:
    DELETE FROM WWV_FLOW_DATA WHERE FLOW_INSTANCE = :B1 AND ITEM_ID IN (SELECT ID FROM WWV_FLOW_PAGE_PLUGS WHERE FLOW_ID = :B3 AND PAGE_ID = :B2 AND PLUG_SOURCE_TYPE IN ( 'SIMPLE_CHART', 'UPDATABLE_SQL_QUERY', 'DBMSSQL_CURSOR', 'FUNCTION_RETURNING_DBMSSQL_CURSOR', 'FUNCTION_RETURNING_SQL_QUERY_CACHED', 'FUNCTION_RETURNING_SQL_QUERY', 'STRUCTURED_QUERY', 'SQL_QUERY', 'DYNAMIC_QUERY'))
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    7000003679ac978 227 package body FLOWS_030100.WWV_FLOW_DISP_PAGE_PLUGS
    70000050e85efb8 10283 package body FLOWS_030100.WWV_FLOW
    7000004340cf8c0 255 procedure FLOWS_030100.F
    70000039feafba8 31 anonymous block

    This sounds like you are missing some commits in your DML.
    Deadlocks normally only occur in Oracle when two sessions try to lock the same rows for update.
    Session1: locks row A;
    Session2: locks row B;
    Session1: tries to lock row B;-- Waiting because of lock by session2
    Session2: tries to lock row A; -- Waiting because of lock by session1 / Deadlock
    This situation is highly unuasual for an Oracle application and is (almost) always a flaw in application design.
    You should try to figure out which DML is being triggered by the two locking sessions. This maybe on an APEX page, but could also be in a database trigger or procedure.
    To rule other things out: check which SESSION_ID's are being used by the application at the time of the deadlock. Maybe your users are using some bookmarks that point to the same SESSION_ID...

  • How to insert 20 rows in single insert statement

    I have one table with one column user_name. I have list of 20 users. how do I insert 20 user in a single insert statement.
    table name bp_portal_vault_users.
    user name will be like this.
    [email protected]
    [email protected]
    Thank you.

    insert into bp_portal_vault_users(yourColumn)
    select 'User1' from dual union all
    select 'User2' from dual union all
    select 'User3' from dual union all
    select 'User4' from dual union all
    select 'User5' from dual union all
    select 'User6' from dual union all
    select 'User7' from dual union all
    select 'User8' from dual union all
    select 'User9' from dual union all
    select 'User10' from dual union all
    select 'User20' from dual

  • Analytic function - two answers in one single select

    create table atest(eid varchar2(10),ukey varchar2(10),tname varchar2(40));
    insert into atest values ('eid1','ukey1','tname1');
    insert into atest values ('eid2','ukey1','tname2');
    insert into atest values ('eid3','ukey2','tname3');
    insert into atest values ('eid4','ukey2','tname3');
    insert into atest values ('eid5','ukey3','tname4');
    commit;I need one single sql, from which I want to find out 2 things
    1. find out those ukey values for which we have multiple eids (ukey1, ukey2 in our example)
    2. next, once we identify those ukeys with multiple eids, out of those, find those ukeys which have non unique tnames (in our example ukey1)
    I would like to do it using analytic functions, so far tried the following
    select eid, ukey,
    (case when count(distinct a.eid) over (partition by (a.ukey)) >  1 then
    -- do something here, above will give ukey1, ukey2, but how to identify those ukeys with non unique tnames ?
    else
    end) tsource
    from atest a;

    user650888 wrote:
    can the same be achieved with analytics ? Yes, but why? Anyway:
    select  ukey
      from  (
             select  ukey,
                     count(distinct eid) over(partition by ukey) eid_cnt,
                     count(distinct tname) over(partition by ukey) tname_cnt,
                     row_number() over(partition by ukey order by 1) rn
               from  atest
      where eid_cnt > 1
        and tname_cnt > 1
        and rn = 1
    UKEY
    ukey1
    SQL> SY.

  • Deadlock detected during SELECT FOR UPDATE - an application error?

    I have a general question about how Oracle prevents deadlocks from affecting
    applications: do I need to build support into the application for handling
    deadlocks when they occur in this particular scenario, or should Oracle handle
    this for me? I'd like to know whether this is "normal" behavior for an Oracle
    application, or if there is an underlying problem. Consider the following situation:
    Two sessions issue individual SELECT FOR UPDATE queries. Each query locates
    records in the table using a different index. These indexes point to rows in a
    different order from each other, meaning that a deadlock will occur if the two
    statement execute simultaneously.
    For illustrative purposes, consider these rows in a hypothetical table.
    ALPHABET
    alpha
    bravo
    charlie
    delta
    echo
    foxtrot
    golf
    hotel
    Index A results in traversing the table in ascending alphabetical order; index
    B, descending. If two SELECT FOR UPDATE statements concurrently execute on this
    table--one with an ascending order execution path and one in descending order--
    the two processes will deadlock at the point where they meet. If Session A
    locks alpha, bravo, charlie, and delta, while Session B locks hotel, golf,
    foxtrot, and echo, then neither process can proceed. A needs to lock echo, and
    B needs to lock delta, but one cannot continue until the other releases its
    locks.
    This execution path can be encouraged using hints. Executing queries similar to these on larger tables will generate the "collision" as described above.
    -- Session A
    select /*+ index_asc (customer) */
    from customer
    where gender = 'M'
    for update;
    -- Session B
    select /*+ index_desc (customer) */
    from customer
    where gender = 'M'
    for update;
    Oracle will recognize that both sessions are in a stand-off, and it will roll
    back the work performed by one of the two sessions to break the deadlock.
    My question pivots on whether or not, in this situation, the deadlock gets
    reported back to the application executing the queries as an ORA-00060. If
    these are the ONLY queries executed during these sessions, I would think that
    Oracle would rollback the locking performed in one of the SELECT FOR UPDATE
    statements. If I understand correctly,
    (1) Oracle silently rolls back and replays work performed by UPDATE statements
    when a deadlock situation occurs within the scope of the update statement,
    and
    (2) A SELECT FOR UPDATE statement causes Oracle, at the point in time the cursor
    is opened, to lock all rows matching the WHERE clause.
    If this is the case, then should I expect Oracle to produce an ORA-00060
    deadlock detection error for two SELECT FOR UPDATE statements?
    I would think that, for deadlock situations completely within Oracle's control,
    this should be perceived to the application invoking the SELECT FOR UPDATE
    statements as regular blocking. Since the query execution plans are the sole
    reason for this deadlock situation, I think that Oracle would handle the
    situation gracefully (like it does for UPDATE, as referenced in (1)).
    Notice, from the trace file below, that the waits appear to be from row locking,
    and not from an artificial deadlock (e.g. ITL contention).
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
    With the Partitioning option
    DEADLOCK DETECTED
    Current SQL statement for this session:
    SELECT XXX FROM YYY WHERE ZZZ LIKE 'AAA%' FOR UPDATE
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    58a1f8f18 4 anonymous block
    58a1f8f18 11 anonymous block
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TX-002f004b-000412cf 37 26 X 26 44 X
    TX-002e0044-000638b7 26 44 X 37 26 X
    session 26: DID 0001-0025-00000002     session 44: DID 0001-001A-00000002
    session 44: DID 0001-001A-00000002     session 26: DID 0001-0025-00000002
    Rows waited on:
    Session 44: obj - rowid = 0000CE31 - AAANCFAApAAAAGBAAX
    Session 26: obj - rowid = 0000CE33 - AAANCHAArAAAAOmAAM
    Thanks for your insight,
    - Curtis
    (1) "Oracle will silently roll back your update and restart it"
    http://tkyte.blogspot.com/2005/08/something-different-part-i-of-iii.html
    (2) "All rows are locked when you open the cursor, not as they are fetched."
    http://download-east.oracle.com/docs/cd/A87860_01/doc/appdev.817/a77069/05_ora.htm#2170
    Message was edited by:
    Curtis Light

    Thanks for your response. In my example, I used the indexes to force a pair of query execution plans to "collide" somewhere in the table in question by having one query traverse the table via index in an ascending order, and another in descending. This is an artificial scenario for reproducible illustrative purposes, but similar collisions could legitimately occur in real world scenarios (e.g. a full table scan and an index range scan with lookup by ROWID).
    So, with that said, I think it would be unreasonable for Oracle to report the collision as a ORA-00060 every time it occurs because:
    (1) The UPDATE statement handles this situation automatically, and
    (2) An ORA-00060 results in a 100+KB trace file being written out, only rational for truly erroneous situations.
    I agree that, when the application misbehaves and locks rows out of order in separate SQL statements, then Oracle should raise an ORA-00060, as the deadlock is outside of its control. But in this case, the problem occurs with just two individual SQL statements, each within its own transaction.

Maybe you are looking for