Scalable design for long run query

It is a common problem:user execute a runtime query and
hundreds(or even more) records get found. User navigate
the result set page by page.
Design 1 - stateful
execute only one query and maintain a long live resultset
(or database cursor).
Design 2 - stateless
donnot maintain a long live cursor, each page generates a
new query follow by seek, read and close.
Which design is better?
Design 1 seems to be faster but I doubt it will scale, e.g.
the jdbc connection cannot be return to the pool because of
the pending resultset.
Design 2 seems to be more scalable and although database
should cache the execution plan and data, but there still
will be a performance hit...
I think design 2 maybe better because design 1 let the end
user control the lifecycle of the resultset, isn't that
break the basic principle?
I am wondering what is the common practice for this..
Anybody here working for Google? or the ServerSide?

It is a common problem:user execute a runtime query and
hundreds(or even more) records get found. User navigate
the result set page by page.
Design 1 - stateful
execute only one query and maintain a long live resultset
(or database cursor).
Design 2 - stateless
donnot maintain a long live cursor, each page generates a
new query follow by seek, read and close.Stateless with an optional subset cache.
Peace,
Cameron Purdy
Tangosol, Inc.
Clustering Weblogic? You're either using Coherence, or you should be!
Download a Tangosol Coherence eval today at http://www.tangosol.com/
"qing yan" <[email protected]> wrote in message
news:3ce922fb$[email protected]..
>

Similar Messages

  • Explain for a very long running query

    Dear gurus,
    I have an issue with a long running query which takes around 2 hrs to execute. The tables being used here pertains to 11i, so there is no scope of indexing.
    SELECT peia.expenditure_item_id, DECODE (peia.system_linkage_function, 'ST', 'TIME', 'EXP' ) AS CATEGORY,
    pea.incurred_by_person_id AS employee_id, emp.attribute6 AS q_number, NVL (emp.employee_number, npw_number) AS employee_number, emp.full_name AS employee_name, peia.project_id,
    ppa.segment1, ppa.NAME, func_get_proj_attribute (peia.project_id, NULL, 'PROJECT ENTITY NAME' ) AS project_entity,
    func_get_proj_attribute (peia.project_id, NULL, 'PROJECT MANAGER') AS project_manager,
    DECODE (ppa.distribution_rule, 'WORK/WORK', 'TM', 'WORK/EVENT', 'TM with Milestone' ) AS project_classification,
    ppa.project_type AS funding_type, func_get_proj_attribute(peia.project_id, NULL, 'CUSTOMER GROUP' ) AS customer_group,
    func_get_proj_attribute(peia.project_id, NULL, 'ACCOUNT MANAGER' ) AS account_manager,
    pt.top_task_id, func_get_task_attribute(pt.top_task_id, 'TASK NUMBER' ) AS task_number,
    func_get_task_attribute (pt.top_task_id, 'TASK NAME' ) AS task_name, peia.expenditure_item_date, peia.projfunc_raw_revenue AS func_raw_revenue,
    peia.accrued_revenue AS func_accrued_revenue, peia.projfunc_currency_code,
    DECODE (peia.project_raw_revenue, NULL,
    DECODE (peia.system_linkage_function, 'ST', peia.quantity* NVL (peia.bill_rate, func_get_emp_billrate (pea.incurred_by_person_id, peia.project_id, peia.task_id,
    peia.expenditure_item_date )
    peia.quantity
    peia.project_raw_revenue
    ( peia.accrued_revenue
    / peia.projfunc_raw_revenue
    * peia.project_raw_revenue
    ) AS project_accrued_revenue,
    ppa.project_currency_code,
    NVL(peia.bill_rate, func_get_emp_billrate (pea.incurred_by_person_id, peia.project_id, peia.task_id, peia.expenditure_item_date)
    ) AS bill_rate,
    peia.rev_dist_rejection_code, SYSDATE AS generated_date
    FROM pa_expenditures_all pea
    INNER JOIN (SELECT * FROM per_all_people_f WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date) emp ON NVL(pea.incurred_by_person_id, 61) =emp.person_id
    INNER JOIN (SELECT * FROM pa_expenditure_items_all WHERE billable_flag = 'Y' AND quantity <> 0) peia ON pea.expenditure_id =peia.expenditure_id
    INNER JOIN (SELECT * FROM pa_projects_all WHERE project_status_code = 'APPROVED' AND distribution_rule IN ('WORK/WORK', 'WORK/EVENT')) ppa ON peia.project_id =ppa.project_id
    INNER JOIN pa_tasks pt ON peia.task_id = pt.task_id;
    The explain plan for this is:
    SELECT STATEMENT CHOOSECost: 26,758 Bytes: 53,373,971 Cardinality: 245,963                          
         9 HASH JOIN Cost: 26,758 Bytes: 53,373,971 Cardinality: 245,963                     
              1 TABLE ACCESS FULL TABLE HR.PER_ALL_PEOPLE_F Cost: 67 Bytes: 546,900 Cardinality: 9,115                
              8 HASH JOIN Cost: 26,581 Bytes: 20,174,029 Cardinality: 128,497                
                   2 TABLE ACCESS FULL TABLE PA.PA_TASKS Cost: 596 Bytes: 856,370 Cardinality: 85,637           
                   7 HASH JOIN Cost: 25,691 Bytes: 18,889,059 Cardinality: 128,497           
                        3 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURES_ALL Cost: 1,524 Bytes: 5,220,330 Cardinality: 522,033      
                        6 HASH JOIN Cost: 23,701 Bytes: 17,604,089 Cardinality: 128,497      
                             4 TABLE ACCESS FULL TABLE PA.PA_PROJECTS_ALL Cost: 91 Bytes: 49,059 Cardinality: 621
                             5 TABLE ACCESS FULL TABLE PA.PA_EXPENDITURE_ITEMS_ALL Cost: 23,575 Bytes: 68,913,570 Cardinality: 1,188,165
    Can anyone suggests what can be done to improve this query?
    Thanks in advance
    SA
    Edited by: user593719 on Oct 5, 2010 10:29 AM
    Edited by: user593719 on Oct 5, 2010 10:30 AM

    1) Your inner joins are doing record selections that could be done on the Join's ON clause.
    2) Look at your functions to see if you can get performance improvements using parameterized CURSORs & adding DETERMINISTIC to the definition.
    3) Consider using WITH to first pull your data & then running your functions.
    For example:
    with
    smiths as (
    select *
    from hr.per_all_people_f papf
    where papf.first_name='Smith'
    select *
    from smiths
    where trunc(sysdate) between effective_start_date and effective_end_date;
    In general, pare down your data first. Whatever will restrict your data most, start with selecting that table/view.

  • Long running query--- included steps given by Randolf

    Hi,
    I have done my best to follow Randolf instruction word-by-word and hope to get solution for my
    problem soon. Sometime back I have posted a thread on this problem then got busy with other
    stuff and was not able to follow it. Here I am again with same issue.
    here is link for my previous post
    long running query in database 10gHere is backgroud of my requriemment.
    I am working on Oracle forms 10g which is using package given below. We want to display client information
    with order count basd on different status like Pending, Error, back Order, expedited, std shipping.
    Output will look something like.
    client name   pending    error   backorder   expedited   std shipping
    ABC            24         0       674          6789         78900
    XYZ            35         673    5700           0           798274
    .There are total 40 clients . The long running query are expedited and std shipping.
    When i run package from Oracle Form Developer it takes 3 mintues to run but when I run same query in our application using forms
    (which uses Oracle Application Server) it takes around 1 hour, which is completly unacceptable.
    User wants it be done in less than 1 mintue.
    I have tried combining Pending,error and backorder queries together but as far as I know it will not
    work in Oracle Form as we need a place holder for each status.
    Please dont think it is Forms related question, it is a Performance problem.
    PACKAGE BODY ORDER_COUNT_PKG IS
    PROCEDURE post_query IS
      BEGIN
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.PENDING
                  FROM orders o
              WHERE o.status = 'P'
                   AND (parent_order_id is null
                    OR  (order_type='G'
                         AND parent_order_id=original_order_number))
                      AND  o.client = :ORDER_STATUS.CLIENT_NUMBER;
         EXCEPTION
           WHEN OTHERS THEN
           NULL;
           END;
             BEGIN
                 SELECT  count(*)
                   INTO  :ORDER_STATUS.ERROR
                   FROM  orders o
                  WHERE  o.status = 'E'
                    AND  (parent_order_id is null
                     OR  (order_type='G'
                           AND parent_order_id=original_order_number))
                       AND  o.client = :ORDER_STATUS.CLIENT_NUMBER;
                EXCEPTION
           WHEN OTHERS THEN
           NULL;     
            END;
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.BACK_ORDER
                  FROM orders o
              WHERE o.status = 'B'
                   AND (parent_order_id is null
                    OR (order_type='G'
                         AND parent_order_id=original_order_number))
                      AND o.client = :ORDER_STATUS.CLIENT_NUMBER;
          EXCEPTION
           WHEN OTHERS THEN
           NULL;   
         END;
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.EXPEDITE
                  FROM orders o,shipment_type_methods stm
                 WHERE o.status in ('A','U')
             AND (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND (nvl(o.priority,'1') = '2'
              OR  stm.surcharge_amount <> 0)
                      AND  o.client = :ORDER_STATUS.CLIENT_NUMBER
              GROUP BY  o.client;
              EXCEPTION
           WHEN OTHERS THEN
           NULL;          
         END;           
           BEGIN
                SELECT count(*)
                  INTO :ORDER_STATUS.STD_SHIP
                  FROM  orders o,shipment_type_methods stm
                 WHERE o.status in ('A','U')
             AND  (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND nvl(o.priority,'1') <> '2'
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND stm.surcharge_amount = 0
                      AND o.client = :ORDER_STATUS.CLIENT_NUMBER
              GROUP BY o.client;
          EXCEPTION
           WHEN OTHERS THEN
           NULL;
           END;
      END post_query;
      END ORDER_COUNT_PKG;one of the query which is taking long time is
    SELECT count(*)
                   FROM  orders o,shipment_type_methods stm
                 WHERE o.status in ('A','U')
             AND  (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND nvl(o.priority,'1') <> '2'
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND stm.surcharge_amount = 0
               AND o.client = :CLIENT_NUMBER
              GROUP BY o.clientThe version of the database is 10.2.1.0.2
    SQL> alter session force parallel dml;These are the parameters relevant to the optimizer:
    SQL> show parameter user_dump_dest
    NAME                                 TYPE        VALUE
    user_dump_dest                       string      /u01/app/oracle/admin/mcgemqa/
                                                     udump
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.4
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    SQL> show parameter db_file_multi
    NAME                                 TYPE        VALUE
    db_file_multiblock_read_count        integer     16
    SQL> show parameter db_block_size
    NAME                                 TYPE        VALUE
    db_block_size                        integer     8192
    SQL> show parameter cursor_sharing
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACTHere is the output of EXPLAIN PLAN:
    SQL> explain plan for
      2  SELECT count(*)
      3         FROM  orders o,shipment_type_methods stm
      4       WHERE o.status in ('A','U')
      5           AND  (o.parent_order_id is null
      6            OR (o.order_type = 'G'
      7           AND o.parent_order_id = o.original_order_number))
      8           AND nvl(o.priority,'1') <> '2'
      9           AND o.client = stm.client
    10           AND o.shipment_class_code = stm.shipment_class_code
    11           AND stm.surcharge_amount = 0
    12     AND o.client = :CLIENT_NUMBER
    13    GROUP BY o.client
    14  /
    Explained.
    Elapsed: 00:00:00.12
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    24 rows selected.
    Elapsed: 00:00:00.86
    SQL> rollback;
    Rollback complete.
    Elapsed: 00:00:00.07Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> SELECT count(*)
      2         FROM  orders o,shipment_type_methods stm
      3       WHERE o.status in ('A','U')
      4           AND  (o.parent_order_id is null
      5            OR (o.order_type = 'G'
      6           AND o.parent_order_id = o.original_order_number))
      7           AND nvl(o.priority,'1') <> '2'
      8           AND o.client = stm.client
      9           AND o.shipment_class_code = stm.shipment_class_code
    10           AND stm.surcharge_amount = 0
    11     AND o.client = :CLIENT_NUMBER
    12    GROUP BY o.client
    13  /
    Elapsed: 00:00:03.09
    Execution Plan
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    Statistics
             55  recursive calls
              0  db block gets
           7045  consistent gets
              0  physical reads
              0  redo size
            206  bytes sent via SQL*Net to client
            238  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> The TKPROF output for this statement looks like the following:
    SELECT count(*)
           FROM  orders o,shipment_type_methods stm
         WHERE o.status in ('A','U')
             AND  (o.parent_order_id is null
              OR (o.order_type = 'G'
             AND o.parent_order_id = o.original_order_number))
             AND nvl(o.priority,'1') <> '2'
             AND o.client = stm.client
             AND o.shipment_class_code = stm.shipment_class_code
             AND stm.surcharge_amount = 0
       AND o.client = :CLIENT_NUMBER
      GROUP BY o.client
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.04       0.04          0          0          0           0
    Fetch        2      2.96       2.91          0       7039          0           1
    total        4      3.01       2.95          0       7039          0           1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 95 
    Rows     Row Source Operation
          1  SORT GROUP BY NOSORT (cr=7039 pr=0 pw=0 time=2913701 us)
         91   TABLE ACCESS BY INDEX ROWID ORDERS (cr=7039 pr=0 pw=0 time=261997906 us)
         93    NESTED LOOPS  (cr=6976 pr=0 pw=0 time=20740 us)
          1     TABLE ACCESS BY INDEX ROWID SHIPMENT_TYPE_METHODS (cr=2 pr=0 pw=0 time=208 us)
          3      INDEX RANGE SCAN U_SHIPMENT_TYPE_METHODS (cr=1 pr=0 pw=0 time=88 us)(object id 81957)
         91     INDEX RANGE SCAN ORDERS_ORDER_DATE (cr=6974 pr=0 pw=0 time=70 us)(object id 81547)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2        0.02          0.02
    ********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> variable CLIENT_NUMBER varchar2(20)
    SQL> exec :CLIENT_NUMBER := '14'
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.06
    SQL> SELECT /*+ gather_plan_statistics */ count(*)
      2         FROM  orders o,shipment_type_methods stm
      3       WHERE o.status in ('A','U')
      4           AND  (o.parent_order_id is null
      5            OR (o.order_type = 'G'
      6           AND o.parent_order_id = o.original_order_number))
      7           AND nvl(o.priority,'1') <> '2'
      8           AND o.client = stm.client
      9           AND o.shipment_class_code = stm.shipment_class_code
    10           AND stm.surcharge_amount = 0
    11     AND o.client = :CLIENT_NUMBER
    12    GROUP BY o.client
    13  /
      COUNT(*)
            91
    Elapsed: 00:00:02.85
    SQL> set termout on
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  4nfj368y8w6a3, child number 0
    SELECT /*+ gather_plan_statistics */ count(*)        FROM  orders o,shipment_type_methods stm      WHERE
    o.status in ('A','U')          AND  (o.parent_order_id is null           OR (o.order_type = 'G'
    AND o.parent_order_id = o.original_order_number))          AND nvl(o.priority,'1') <> '2'          AND
    o.client = stm.client          AND o.shipment_class_code = stm.shipment_class_code          AND
    stm.surcharge_amount = 0    AND o.client = :CLIENT_NUMBER   GROUP BY o.client
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |   1 |  SORT GROUP BY NOSORT          |                         |      1 |      1 |      1 |00:00:02.63 |    7039 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |      1 |    175K|     91 |00:03:56.87 |    7039 |
    |   3 |    NESTED LOOPS                |                         |      1 |  25300 |     93 |00:00:00.02 |    6976 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |      1 |      1 |      1 |00:00:00.01 |       2 |
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |      1 |      2 |      3 |00:00:00.01 |       1 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |      1 |    176K|     91 |00:00:00.01 |    6974 |
    Predicate Information (identified by operation id):
       2 - filter((("O"."PARENT_ORDER_ID" IS NULL OR ("O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER"))) AND NVL("O"."PRIORITY",'1')<>'
                  "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE"))
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter(("O"."STATUS"='A' OR "O"."STATUS"='U'))
    32 rows selected.
    Elapsed: 00:00:01.30
    SQL> I'm looking forward for suggestions how to improve the performance of this statement.
    Thanks
    Sandy

    Please find explain plan for No hint
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"=:CLIENT_NUMBER)
       6 - access("O"."CLIENT"=:CLIENT_NUMBER)
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    24 rows selected.
    Elapsed: 00:00:00.86Explain Plan for Parallel Hint
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 559278019
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT          |                         |     1 |    35 | 46764   (3)| 00:09:22 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID  | ORDERS                  |   175K|  3431K| 25979   (3)| 00:05:12 |
    |   3 |    NESTED LOOPS                |                         | 25300 |   864K| 46764   (3)| 00:09:22 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00
    |*  5 |      INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  6 |     INDEX RANGE SCAN           | ORDERS_ORDER_DATE       |   176K|       |  2371   (8)| 00:00:29 |
    Predicate Information (identified by operation id):
       2 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
                  AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_CODE")
       4 - filter("STM"."SURCHARGE_AMOUNT"=0)
       5 - access("STM"."CLIENT"='14')
       6 - access("O"."CLIENT"='14')
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    24 rows selected.
    Elapsed: 00:00:08.92Explain Plan for USE_Hash hint
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1465232248
    | Id  | Operation                     | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                         |     1 |    35 | 46786   (3)| 00:09:22 |
    |   1 |  SORT GROUP BY NOSORT         |                         |     1 |    35 | 46786   (3)| 00:09:22 |
    |*  2 |   HASH JOIN                   |                         | 25300 |   864K| 46786   (3)| 00:09:22 |
    |*  3 |    TABLE ACCESS BY INDEX ROWID| SHIPMENT_TYPE_METHODS   |     1 |    15 |     2   (0)| 00:00:0
    |*  4 |     INDEX RANGE SCAN          | U_SHIPMENT_TYPE_METHODS |     2 |       |     1   (0)| 00:00:01 |
    |*  5 |    TABLE ACCESS BY INDEX ROWID| ORDERS                  |   175K|  3431K| 46763   (3)| 00:09:22 |
    |*  6 |     INDEX RANGE SCAN          | ORDERS_ORDER_DATE       |   176K|       |  4268   (8)| 00:00:52 |
    Predicate Information (identified by operation id):
       2 - access("O"."CLIENT"="STM"."CLIENT" AND "O"."SHIPMENT_CLASS_CODE"="STM"."SHIPMENT_CLASS_COD
                  E")
       3 - filter("STM"."SURCHARGE_AMOUNT"=0)
       4 - access("STM"."CLIENT"='14')
       5 - filter(("O"."PARENT_ORDER_ID" IS NULL OR "O"."ORDER_TYPE"='G' AND
                  "O"."PARENT_ORDER_ID"=TO_NUMBER("O"."ORIGINAL_ORDER_NUMBER")) AND NVL("O"."PRIORITY",'1')<>'2
       6 - access("O"."CLIENT"='14')
           filter("O"."STATUS"='A' OR "O"."STATUS"='U')
    25 rows selected.
    Elapsed: 00:00:01.09
    SQL> Thanks
    Sandy

  • Alert monitor for long running background jobs

    Hello,
    I have to configure an alert moniter for long running background jobs which are running more than 20000 secs using rule based. I have created a rule based MTE and assigend MTE class CCMS_GET_MTE_BY_CLASS to virtual node but i dont find a node to specify the time.
    could any one guide me how can i do this.
    Thanks,
    Kasi

    Hi *,
    I think the missing bit is where to set the maximum runtime. The runtime is set in the collection method and not the MTE class.
    process:  rz20 --> SAP CCMS Technical Expert Monitors --> All Contexts on local application server --> background --> long-running jobs. Click on 'Jobs over Runtime Limits' then properties, click the methods tab then double click 'CCMS_LONGRUNNING_JOB_COLLECT', in the parameters tab you can then set the maximum runtime.
    If you need to monitor specific jobs, follow the process (http://help.sap.com/saphelp_nw70/helpdata/en/1d/ab3207b610e3408fff44d6b1de15e6/content.htm) to create the rule based monitor, then follow this process to set the runtime.
    Hope this helps.
    Regards,
    Riyaan.
    Edited by: Riyaan Mahri on Oct 22, 2009 5:07 PM
    Edited by: Riyaan Mahri on Oct 22, 2009 5:08 PM

  • Profiler execution plan ONLY for long running queries

    The duration only applies to specific profiler events however I'd like to capture the execution plan ONLY for queries over 10 minutes.
    Is there a way to do this using Xevents?
    Anyone knows?
    Thanks!
    Paula

    I've wanted that too but could not find a way to get it from profiler.
    But it may be possible with xevents (or without xevents!) to watch for long-running queries and then get the plan from the cache,where it will probably stick for some time, using DMVs.
    Josh

  • RZ20 - Is there an alert for long running transactions?

    In RZ20 is there an alert for long running transactions?

    http://help.sap.com/saphelp_nw04s/helpdata/en/9c/f78b3ba19dfe47e10000000a11402f/content.htm
    This document clearly explains your problem.
    "Reward points if useful"

  • Considerations for long running publication extensions

    We are considering implementing a post processing publication extension which may take several minutes to execute.   One of our concerns with this strategy is that the publication extension may bog down the Adaptive Processing Server.  
    Are there any general considerations / recommendations for long running post processing publication extensions?  
    Thanks!

    Generally creating a new thread is an expensive process. Well, everything is relative. My laptop can create & run & stop 7,000+ threads per second, test program below, YMMV. If you are dealing with thousands of thread creations per second, pooling may be sensible; if not, premature optimization is the root of all evil, etc.
    public class ThreadSpeed
        public static void main(String args[])
         throws Exception
            System.out.println("Ignore the first few timings.");
            System.out.println("They may include Hotspot compilation time.");
            System.out.println("I hope you are running me with \"java -server\"!");
         for (int n = 0; n < 5; n++)
             doit();
            System.out.println("Did you run me with \"java -server\"?  You should!");
        public static void doit()
         throws Exception
            long start = System.currentTimeMillis();
            for (int n = 0; n < 10000; n++) {
             Thread thread = new Thread(new MyRunnable());
             thread.start();
             thread.join();
            long end = System.currentTimeMillis();
            System.out.println("thread time " + (end - start) + " ms");
        static class MyRunnable
         implements Runnable
         public void run()
    }Edited by: sjasja on Jan 14, 2010 2:20 AM

  • Tracking completion status for long running DML operations

    Does anybody know:
    Is there any possibility to track a completion status for long running DML operations (for example how many rows is inserted)?
    For example if I execute an INSERT statement which is working for several hours it is very important to estimate the total time for this operation.
    Thanks forward

    I'm working with Oracle8 in present, and unfortunately this solution (V$SESSION_LONGOPS)cannot help me.
    On Oracle8 it works, but with some restrictions:
    - You must be using the cost-based optimizer
    - Set the TIMED_STATISTICS or SQL_TRACE parameter to TRUE
    - Gather statistics for your objects with the ANALYZE statement or the DBMS_STATS package.

  • Is there any time out defined for long running transaction?

    hi, 
    i have to make one big data transferring script , though transaction is not required here, but i was planning to,
    please tel me is there any time out for long running transactions.i have to run the script from database it self
    yours sincerley

    Can you show us an example of your script? You can divide the transaction into small chunks to reduce time and locking/blocking as well.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to avoid a timeout for a long-running query

    Hello,
    in my application I insert some rows in a temporary table on submit in a PL/SQL block on the page 1. Then I read these rows from the table on the page 2. Unfortunately the insert takes too long time, because I also have to make some other SELECTs etc in that block. That's why the application hits the Apache timeout for mod_plsql and HTTP error between pages 1 and 2.
    I have found some threads about this topic in this forum. There are some suggestions with meta refresh tag etc. I understand, that I have to implement some kind of processing page between the pages 1 and 2 to show a waiting message etc. But I could not find any ready "cook book" for such implementation.
    Could you please help me?
    Thanks in advance
    Andrej
    P.S. This application don't use AJAX code, so I would prefer a solution without AJAX.

    Hello Chris,
    I am not sure, how to implement this approach. So I would start on the page 1 a job (dbms_scheduler or dbms_job), which would create a temporary table in the background. The application should branch to the page 3 with a message "Please wait...". I have to poll the results of the job and branch to the page 2, when the job is ready and I can select from the created temporary table. So far I like this way very much.
    Could you please give me more details about the page 3 (polling page)? I have the following questions now:
    1. I assume I have to set the meta refresh tag on this page. But in which PL/SQL block can I poll for the running job (on load process?).
    2. How can I branch from this page to another page? If I only use refresh tag, how can I branch to another page only on the special condition (ready flag)?
    Thanks in advance
    Andrej

  • ORABPEL-05002 for long running process

    Hi everybody,
    My question is related with a long running process I have designed and which, after running for a couple of days, ends by reporting the ORABPEL-05002 error:
    ===============================================================
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.PerformMessage"; the exception is: Transaction was rolled back: timed out; nested exception is: java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:152)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    ===============================================================
    Looking in the Manual Recovery screen, I can see an Activity I can recover. It's about an assign Activity where I'm doing a single boolean assignation.
    Of course, together with the ORABPEL-05002 error I got also the 'Transaction was rolled back: time out' message. Note that I have modified the transaction-timeout value to 180000. The error occurs during the night, with no heavy load of the server.
    Recovering the assign activity brings back the process in the running state.
    My process pattern:
    while (1 == 1) {
    do activity;
    wait_timeout();
    So, I have the following questions:
    1. Which is cause of this error?
    2. How may I automatically recover this lost activity? RecoveryAgent?
    Any suggestion is appreciated.
    Regards,
    amo
    P.S: the full stack of error messages reported in domain.log:
    ===============================================================
    <2006-09-18 08:08:34,101> <ERROR> <SRH.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> failed to handle message
    javax.ejb.EJBException: Transaction was rolled back: timed out; nested exception is: java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:
    java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:
         at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:873)
         at ICubeEngineLocalBean_StatelessSessionBeanWrapper0.handleWorkItem(ICubeEngineLocalBean_StatelessSessionBeanWrapper0.java:1479)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handle(PerformMessageHandler.java:45)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.Exception: No Exception - originate from:
         at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:871)
         ... 10 more
    javax.ejb.EJBException: Transaction was rolled back: timed out; nested exception is: java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:
         at ICubeEngineLocalBean_StatelessSessionBeanWrapper0.handleWorkItem(ICubeEngineLocalBean_StatelessSessionBeanWrapper0.java:1479)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handle(PerformMessageHandler.java:45)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2006-09-18 08:08:34,129> <ERROR> <SRH.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.PerformMessage"; the exception is: Transaction was rolled back: timed out; nested exception is: java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.PerformMessage"; the exception is: Transaction was rolled back: timed out; nested exception is: java.rmi.RemoteException: No Exception - originate from:java.lang.Exception: No Exception - originate from:; nested exception is:
         java.lang.Exception: No Exception - originate from:
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:152)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2006-09-18 08:09:05,236> <ERROR> <SRH.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "activity manager": Scope not found.
    The scope "BpSwt2.30995" has not been defined in the current instance.
    ORABPEL-02094
    Scope not found.
    The scope "BpSwt2.30995" has not been defined in the current instance.
         at com.collaxa.cube.engine.core.ScopeContext.getScope(ScopeContext.java:213)
         at com.collaxa.cube.engine.core.WorkItem.setCubeInstance(WorkItem.java:259)
         at com.collaxa.cube.engine.core.WorkItemFactory.init(WorkItemFactory.java:68)
         at com.collaxa.cube.engine.core.WorkItemFactory.create(WorkItemFactory.java:58)
         at com.collaxa.cube.engine.adaptors.common.BaseWorkItemPersistenceAdaptor.load(BaseWorkItemPersistenceAdaptor.java:147)
         at com.collaxa.cube.engine.data.WorkItemPersistenceMgr.load(WorkItemPersistenceMgr.java:75)
         at com.collaxa.cube.engine.CubeEngine.load(CubeEngine.java:5185)
         at com.collaxa.cube.engine.CubeEngine.load(CubeEngine.java:5173)
         at com.collaxa.cube.engine.CubeEngine.expireActivity(CubeEngine.java:2136)
         at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:145)
         at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:116)
         at IActivityManagerLocalBean_StatelessSessionBeanWrapper52.expireActivity(IActivityManagerLocalBean_StatelessSessionBeanWrapper52.java:645)
         at com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessageHandler.handle(ExpirationMessageHandler.java:43)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2006-09-18 08:09:05,274> <ERROR> <SRH.collaxa.cube.engine.dispatch> <DispatchHelper::handleMessage> failed to handle message
    ORABPEL-02094
    Scope not found.
    The scope "BpSwt2.30995" has not been defined in the current instance.
         at com.collaxa.cube.engine.core.ScopeContext.getScope(ScopeContext.java:213)
         at com.collaxa.cube.engine.core.WorkItem.setCubeInstance(WorkItem.java:259)
         at com.collaxa.cube.engine.core.WorkItemFactory.init(WorkItemFactory.java:68)
         at com.collaxa.cube.engine.core.WorkItemFactory.create(WorkItemFactory.java:58)
         at com.collaxa.cube.engine.adaptors.common.BaseWorkItemPersistenceAdaptor.load(BaseWorkItemPersistenceAdaptor.java:147)
         at com.collaxa.cube.engine.data.WorkItemPersistenceMgr.load(WorkItemPersistenceMgr.java:75)
         at com.collaxa.cube.engine.CubeEngine.load(CubeEngine.java:5185)
         at com.collaxa.cube.engine.CubeEngine.load(CubeEngine.java:5173)
         at com.collaxa.cube.engine.CubeEngine.expireActivity(CubeEngine.java:2136)
         at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:145)
         at com.collaxa.cube.ejb.impl.ActivityManagerBean.expireActivity(ActivityManagerBean.java:116)
         at IActivityManagerLocalBean_StatelessSessionBeanWrapper52.expireActivity(IActivityManagerLocalBean_StatelessSessionBeanWrapper52.java:645)
         at com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessageHandler.handle(ExpirationMessageHandler.java:43)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2006-09-18 08:09:05,275> <ERROR> <SRH.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessage"; the exception is: Scope not found.
    The scope "BpSwt2.30995" has not been defined in the current instance.
    ORABPEL-05002
    Message handle error.
    An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.ExpirationMessage"; the exception is: Scope not found.
    The scope "BpSwt2.30995" has not been defined in the current instance.
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:152)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    ===============================================================

    These are the possible cause to the problem and their solutions:
    Poor performance of the dehydration database If you are using Oracle Lite as dehydration store, please switch to use Oracle 9i or 10g. If Oracle 9i/10g is already in use, check the database parameter 'process' and 'session' to make sure it can handle the expected throughput.
    OC4J has too few available connections to the dehydration database. Increase the maxConnection number of the BPELServerDataSource at the BPEL_HOME/integration/orabpel/system/appserver/oc4j/j2ee/home/config/data-sources.xml (for developer edition) or IAS_HOME/j2ee/OC4J_BPEL/config/data-sources.xml (mid-tier installation).
    Size of message is too big Two ways to deal with this problem:
    Increase the transaction timeout at PEL_HOME/integration/orabpel/system/appserver/oc4j/j2ee/home/config/server.xml (developer edition) or IAS_HOME/j2ee/OC4J_BPEL/config/server.xml (mid-tier installation)
    Decrease the auditLevel from BPELConsole -> Manage BPEL Domain -> Configurations tab. Doing so will reduce the amount of data saved to the dehydration store.
    Cheers
    Anirudh Pucha

  • V$session_longops not displaying a long running query

    Hi,
    There is a certain query that runs as a part of a stored procedure which when run takes about 1 and half hours to get completed and there is a hint in this query to use certain indexes on few tables.
    This time was unacceptable as it was much much longer than what it should have taken so I tried to monitor it through v$session_longops using the following query
    select * from v$session_longops where time_remaining > 0
    It shows no rows selected but the query is still running.
    When I changed the hint in the query to use the full table scan on these tables instead of the indexes it began to show up on the v$session_longops and it took like only 15 mins for the procedure execution to get completed.
    My questions are two fold
    1) Why did the first time with the Hint on the indexes not show up on v$session_longops with time_remaining > 0 and why did it show up only when i did a full table scan?
    2) Secondly is'nt a scan on a table faster using indexes if the index has unique values on the columns we are trying to get data from than the Full Table Scans. And if so then why is it behaving differently in this case.
    Thanks a lot in advance for any answers/suggestions

    1. v$session_longops only reports long running operations. The CBO assumes that the index scan is a tiny operation (nested loop joins), hence it is not displaying the query, but when you have a full table scan, the CBO assumes this to be a long operation, and hence it is visible in v$session_longops.
    2. Allow me to quote from
    "http://asktom.oracle.com/pls/ask/f?p=4950:8:17968334624783495563::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:9422487749968"
    "full scans are not evil, indexes are not good"
    "full scans are not evil, indexes are not good"
    "full scans are not evil, indexes are not good"
    Click that link for more information. :)
    The gist of it is, your CBO is smart, and hence generating a better plan than when you force it to use indexes. Yes, the plan has full table scans, but that is not a crime. What you can do is use optimizer parameters - "optimizer_index_cost_adj" to tune for a better performance, but you should not force an index unless you are sure that the index gives you a lower cost.
    You could paste the plan for you queries with and without hints and also paste the optimizer hints - show parameter optimizer.

  • Email Notification for long running session

    Dear All,
    I want to configure email notification for any long running session on my server which can be seen in SM66. Is there any possible way? Please suggest.
    Regards,
    Prem

    Hi Prem,
    I hope you doing good.
    Now, for the above query, I am not sure that we have any such MTE in CCMS for user specific session, however, a small custom code can be used to achieve such functions
    Here, you have to use some f Function Modules using CALL FUNCTION/FM in your abap code.
    These function modules are from TH* family like TH_DISPLAY_USER_LIST and TH_USER_INFO. Now the coder can file out the results based on some 'Threshold', which are in spool generated - convert this into PDF(if you want). Now schedules this custom program in background for every 10 mins, and notification will come through it on email ID or any DL.
    How to send email from job - How to email output from Background Jobs
    Regards,
    Divyanshu

  • How to change the explain plan for currently running query?

    Hi All,
    I am using Oracle enterprise 9i edition. I have a query which frames dynamically and running in the database. I noticed a table with 31147758 rows
    in the query which has no indexes and taking more time to process. I tried to create an INdex on that table. I know the query is already running with a FULL table scan. Is it possible to change the explain plan for the current running query to consider the INDEX?
    [code]
    SELECT /*+ USE_HASH (c,e,b,a) */
    d.att_fcc extrt_prod_dim_id,
    d.att_fcc compr_prod_dim_id,
      a.glbl_uniq_id glbl_uniq_id,
      to_date(c.dit_code,'RRRRMMDD')STRT_DT,
      (to_date(c.dit_code,'RRRRMMDD')+150)END_DT,
      a.pat_nbr pat_id,
      a.rxer_id       rxer_id,
      e.rxer_geog_id  rxer_geog_id,
      a.pharmy_id pharmy_id,
      a.pscr_pack_id pscr_pack_id,
      a.dspnsd_pack_id dspnsd_pack_id,
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr ORDER BY c.dit_code) daterank,
      COUNT( DISTINCT d.att_fcc ) OVER (PARTITION BY a.pat_nbr, c.dit_code) event_cnt
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
    d.att_fcc
      ORDER BY c.dit_code) prodrank,
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
    d.att_fcc
      ORDER BY c.dit_code DESC) stoprank
      FROM
      pd_dimitems c,
       pd_pack_attribs   d ,
        lrx_tmp_rxer_geog e,
        lrx_tmp_pat_daterank p,
        lrx_tmp_valid_fact_link     a
        WHERE c.dit_id = a.tm_id
        AND   e.rxer_id = a.rxer_id
        AND   a.glbl_uniq_id = p.glbl_uniq_id
        AND   p.daterank > 1
      AND   a.pscr_pack_id = d.att_dit_id
    [/code]
    The table lrx_tmp_pat_daterank is having that 31147758 rows. So I am wondering how to make the query to use the newly created index on the table?

    Why do you think using Indexes will improve the performance of the query? How many rows this query is returning? Optimizer might chose a Full table scan when it finds out that Index plan might not be useful. Why are you using /*+ USE_HASH (c,e,b,a) */ hint? This Hint will force oracle to use Full table scan instead of using the index. Try removing it and see if the plan changes.
    Regards,

  • Using MDBs for long running transactions

    Although MDBs are not the best vehicles for running long transactions, I am
              forced to use them for one such scenario (let's say for lack of a better
              pattern). In order to let my long running MDB (with Container Managed Tx)
              do it's chores I increased the time-out value to a higher number rather than
              using the default of 30 secs. Strangely, I was seeing
              IllegalStateExceptions in stdout. So I created a brand new test MDB with a
              Thread.sleep for 60 seconds, increased my MDBs timeout value to 120 secs,
              made sure there was only one MDB in the pool and ran the test again. I
              still see the below error after 30 seconds.
              I guess I should probably open a support case, but I thought I'll post here
              as well in case there's something I am missing.
              <May 27, 2003 5:26:31 PM PDT> <Notice> <EJB> <Error marking transaction for
              rollback: java.lang.IllegalStateException: Cannot m
              ark the transaction for rollback. xid=64:bea55f200db2c786, status=Rolled
              back. [Reason=weblogic.transaction.internal.TimedOutEx
              ception: Transaction timed out after 34 seconds
              Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
              esOwedOthers=0,seconds since begin=34,seconds left=
              30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
              Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
              BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
              active),OwnerTransactionManager=ServerTM[ServerCoor
              dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
              Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
              40:7501+wlcsDomain+)]
              java.lang.IllegalStateException: Cannot mark the transaction for rollback.
              xid=64:bea55f200db2c786, status=Rolled back. [Reason
              =weblogic.transaction.internal.TimedOutException: Transaction timed out
              after 34 seconds
              Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
              esOwedOthers=0,seconds since begin=34,seconds left=
              30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
              Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
              BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
              active),OwnerTransactionManager=ServerTM[ServerCoor
              dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
              Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
              40:7501+wlcsDomain+)]
              at
              weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(Tra
              nsactionImpl.java:1486)
              at
              weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImp
              l.java:466)
              at
              weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.j
              ava:255)
              at
              weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:21
              5)
              at
              weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:153)
              at
              weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117)
              at
              weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java
              :63)
              at
              com.xoriant.hm.ejb.session.HierarchyManagerBean_fzysig_EOImpl.getHierarchyId
              (HierarchyManagerBean_fzysig_EOImpl.java
              :1477)
              at
              com.ebiz.application.customerprofile.hm.CPXHMController.SynchronizeMHTH(Unkn
              own Source)
              at
              com.ebiz.application.customerprofile.hm.CPHMOrgGroupMsgBean.onMessage(Unknow
              n Source)
              at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

    Hi Adarsh,
              It may be that the transaction time-out setting in the descriptor
              is not taking effect. The tx is still timing out after
              the default 30 seconds, so the later attempt to call
              "setRollbackOnly" fails as the transaction has already
              rolled back The ignored descriptor setting is a known issue
              in some earlier SPs, but I'm not sure when and where it
              was fixed - so yes, contact customer support. The work-around
              is to set the default transaction time-out for the entire server to a
              higher value. (I'm not sure where to set this on the console,
              but the relevant JTA MBean field is "TimeoutSeconds".)
              Tom
              Adarsh Dattani wrote:
              > Although MDBs are not the best vehicles for running long transactions, I am
              > forced to use them for one such scenario (let's say for lack of a better
              > pattern). In order to let my long running MDB (with Container Managed Tx)
              > do it's chores I increased the time-out value to a higher number rather than
              > using the default of 30 secs. Strangely, I was seeing
              > IllegalStateExceptions in stdout. So I created a brand new test MDB with a
              > Thread.sleep for 60 seconds, increased my MDBs timeout value to 120 secs,
              > made sure there was only one MDB in the pool and ran the test again. I
              > still see the below error after 30 seconds.
              > I guess I should probably open a support case, but I thought I'll post here
              > as well in case there's something I am missing.
              >
              > <May 27, 2003 5:26:31 PM PDT> <Notice> <EJB> <Error marking transaction for
              > rollback: java.lang.IllegalStateException: Cannot m
              >
              > ark the transaction for rollback. xid=64:bea55f200db2c786, status=Rolled
              > back. [Reason=weblogic.transaction.internal.TimedOutEx
              >
              > ception: Transaction timed out after 34 seconds
              >
              > Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
              > esOwedOthers=0,seconds since begin=34,seconds left=
              >
              > 30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
              > Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
              >
              > BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
              > active),OwnerTransactionManager=ServerTM[ServerCoor
              >
              > dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
              > Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
              >
              > 40:7501+wlcsDomain+)]
              >
              > java.lang.IllegalStateException: Cannot mark the transaction for rollback.
              > xid=64:bea55f200db2c786, status=Rolled back. [Reason
              >
              > =weblogic.transaction.internal.TimedOutException: Transaction timed out
              > after 34 seconds
              >
              > Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
              > esOwedOthers=0,seconds since begin=34,seconds left=
              >
              > 30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
              > Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
              >
              > BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
              > active),OwnerTransactionManager=ServerTM[ServerCoor
              >
              > dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
              > Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
              >
              > 40:7501+wlcsDomain+)]
              >
              > at
              > weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(Tra
              > nsactionImpl.java:1486)
              >
              > at
              > weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImp
              > l.java:466)
              >
              > at
              > weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.j
              > ava:255)
              >
              > at
              > weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:21
              > 5)
              >
              > at
              > weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:153)
              >
              > at
              > weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117)
              >
              > at
              > weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java
              > :63)
              >
              > at
              > com.xoriant.hm.ejb.session.HierarchyManagerBean_fzysig_EOImpl.getHierarchyId
              > (HierarchyManagerBean_fzysig_EOImpl.java
              >
              > :1477)
              >
              > at
              > com.ebiz.application.customerprofile.hm.CPXHMController.SynchronizeMHTH(Unkn
              > own Source)
              >
              > at
              > com.ebiz.application.customerprofile.hm.CPHMOrgGroupMsgBean.onMessage(Unknow
              > n Source)
              >
              > at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
              >
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              >
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              >
              >
              >
              

Maybe you are looking for

  • Is it possible to change the duration of the timeline in Premiere Pro CS5.5?

    I'm used to working on Avid systems where the length of the timeline is determined by the last asset in the timeline, where it ends. I'm editing commercials and don't need or want a 10 minute timeline. Does anyone know how to change the duration of t

  • CLDC 1.1, MIDP 2.0 and JSR-75,135 in Java(TM) ME platform SDK 3.0, EA?

    Hello. I am trying to develope a "simple" MP3 playback application using "Java(TM) ME platform SDK 3.0, EA", but I have a problem. I need to write the program for a device that has CLDC 1.1 and MIDP 2.0 configuration, with optional JSR-75 and JSR-135

  • Reg. Changes in SAP AII D.C 4.0

    I am using SAP AII D.C. 4.0 and SUN RFID 3.0 middleware to find out RFID Autoid solutions. While doing tag Commission from SAP, It sends a XML message to SUN RFID middleware.  Because of SUN RFID 3.0 supports only SAP AII D.C. 2.1 XSD, I am getting X

  • Display turns black for around 10 seconds

    I just encounter this problem twice in a day, it happens without any warning: First the display of my macbook turns black suddenly without any warning and can last for around 10 seconds before wakes up again. During this time, I can hear the noise of

  • Software bank for Mac's

    Hi, I was wondering if there is an alternative for word processing and spread sheets other than Microsoft Office:Mac? I have been a windows user and have just purchased my first Mac, the PowerBook 15". Is there anything I can use for ripping my DVD's