Parallel process in select query

Hi Experts
its production
stats are good
indexes are good
issue :
a select query is taking time 20min , the indexes exists on the where clause columns, I tried the query using parallel hint it gave the results iin 20 sec.
the DOP of the table set to 10, but when I run the query it picks old plan
constraints : I cannot modify the query, it needs to be tuned without modifying it
if DOP is >1 then select is expected to use parallellism in explain plan..is my understanding correct?
if I am wrong please advice how can i force the query to use the parallellism
Please advice and guide asap
THanks in advance
Ajay Kumar

user513478 wrote:
Hi Experts
its production
stats are good
indexes are good
issue :
a select query is taking time 20min , the indexes exists on the where clause columns, I tried the query using parallel hint it gave the results iin 20 sec.
the DOP of the table set to 10, but when I run the query it picks old plan
constraints : I cannot modify the query, it needs to be tuned without modifying itWhat version of Oracle?
Tuning SQL without modifying the SQL can be very hard but you may have options.
Could you use a materialized view with automatic query rewrite?
Can you use a SQL profile to affect performance?
Have you looked very+ carefully at the indexes to see if other indexes might be more efficient?
20 minutes to 20 seconds sounds too good to be true. Are you sure you aren't reading cached data and that the 2nd, faster run really is running in parallel?

Similar Messages

  • How to limit number of parallel processes for a query???

    Hi,
    I have set table parallelism to degree (4 in my case) and when i run a query on that table i see on v$session that this query is using 8 parallel processes.
    Why my query is using all this processes?? Can i limit this number?? I think this will cause poor performance if all my parallel processes stay BUSY on v$pq_slave.
    1     1     P000     BUSY     22     0     8     0     2051     10     2     15     0     79179     76884
    2     1     P001     BUSY     22     0     8     0     2054     10     2     15     0     81905     77443
    3     1     P004     BUSY     2     0     1592     0     0     0     0     1592     0     1039     3
    4     1     P005     BUSY     2     0     1592     0     0     0     0     1592     0     1038     4
    5     1     PZ99     BUSY     533     0     0     0     1     3     0     0     0     1071     1107
    6     2     P000     BUSY     14     0     8     0     2053     10     3     15     1     53014     73297
    7     2     P001     BUSY     14     0     8     0     2048     10     2     15     1     51266     73318
    8     2     P002     BUSY     14     0     8     0     2052     10     2     15     2     51043     73271
    9     2     P003     BUSY     14     0     8     0     2053     9     2     15     2     49417     73327
    10     2     P004     BUSY     13     0     8     0     2055     9     2     15     2     68428     12468
    11     2     P005     BUSY     13     0     8     0     2059     10     2     15     1     69968     12473
    12     2     PZ99     BUSY     461     0     0     0     1     3     0     0     0     921     936
    Tks,
    Paulo.

    select /*+ PARALLEL(a,4) */ ...... from owner.table a;
    Or
    ALTER SESSION FORCE PARALLEL DML PARALLEL <degree>
    (But I am not sure whether this will affect the degree of select also ?)

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Reg: SQL select Query in BPEL process flow

    <p>
    Hi,
    I am suppose to execute a SQL select query (in BPEL Process flow) as mention below in JDeveloper using Database adapter.
    </p>
    <p>
    SELECT LENGTH, WIDTH, HEIGHT, WEIGHT,
    </p>
    <p>
    LENGTH*WIDTH* HEIGHT AS ITEM_CUBE
    </p>
    <p>
    FROM CUBE
    </p>
    <p>
    WHERE ITEM= &lt;xyz&gt;
    </p>
    <p>
    AND OBJECT= (SELECT CASE_NAME FROM CUBE_SUPPLIER WHERE ITEM=&lt;xyz&gt; AND SUPP_IND = &lsquo;Y')
    <strong>Now my question is:
    1.</strong> What does this "*" refer to in the query and how can I retrieve the value of LENGTH*WIDTH* HEIGHT from the query where LENGTH,WIDTH and HEIGHT are the individual field in the table.
    2.What does this " AS" refer to? If " ITEM_CUBE " is the alies for the table name "ITEM" to retrieve the value, then query shoud be evaluated as
    </p>
    <p>
    SELECT LENGTH, WIDTH, HEIGHT, WEIGHT,
    </p>
    <p>
    LENGTH*WIDTH* HEIGHT AS ITEM_CUBE
    </p>
    <p>
    FROM CUBE
    </p>
    <p>
    WHERE <strong>ITEM_CUBE.ITEM</strong>= &lt;xyz&gt;
    </p>
    <p>
    AND <strong>ITEM_CUBE.OBJECT</strong>= (SELECT CASE_NAME FROM CUBE_SUPPLIER WHERE ITEM=&lt;xyz&gt; AND SUPP_IND = &lsquo;Y')
    Is my assumption correct?
    Please suggest asap.
    Thanks...
    </p>
    <p>
    </p>

    Hi
    Thank for your reply!
    I have a nested select query which performs on two different table as shown below:
    <p>
    SELECT LENGTH, WIDTH, HEIGHT, WEIGHT,
    </p>
    <p>
    LENGTH*WIDTH* HEIGHT AS ITEM_CUBE
    </p>
    <p>
    FROM CUBE
    </p>
    <p>
    WHERE ITEM= &lt;abc&gt;
    </p>
    <p>
    AND OBJECT= (SELECT NAME FROM SUPPLIER WHERE ITEM=&lt;Item&gt; AND SUPP_IND = &lsquo;Y')
    I am using DB adapter of Oracle JDeveloper in BPEL process flow, where I can able to select only one master table in DB adapter say SUPPLIER and its attributes at a time.But as per my requirment I need to select both the table (CUBE and SUPPLIER) in a single adapter to execute my query.
    It can be achievable by using two DB adapter , One to execute the nested query and another to execute the main qyery considering value of nested query as a parameter.But I want to achieve it by using a single one.
    Am I correct with my concept?
    Please suggest how to get it ?
    </p>
    Edited by: user10259700 on Oct 23, 2008 12:17 AM

  • CV04N takes long time to process select query on DRAT table

    Hello Team,
    While using CV04N to display DIR's, it takes long time to process select query on DRAT table. This query includes all the key fields. Any idea as to how to analyse this?
    Thanks and best regards,
    Bobby
    Moderator message: please read the sticky threads of this forum, there is a lot of information on what you can do.
    Edited by: Thomas Zloch on Feb 24, 2012

    Be aware that XP takes approx 1gb of your RAM leaving you with 1gb for whatever else is running. MS Outlook is also a memory hog.
    To check Virtual Memory Settings:
    Control Panel -> System
    System Properties -> Advanced Tab -> Performance Settings
    Performance Options -> Adavanced Tab - Virtual Memory section
    Virtual Memory -
    what are
    * Initial Size
    * Maximum Size
    In a presentation at one of the Hyperion conferences years ago, Mark Ostroff suggested that the initial be set to the same as Max. (Max is typically 2x physical RAM)
    These changes may provide some improvement.

  • Disjoint Selections in Parallel Processing Profile

    Hello All,
             I wanted to use the parallel processing profile for my DP background jobs.
    When I referred the 'Note 853142 - Consulting: Parallel processing profile for DP batch runs' it says use this parallel processing using disjoint selections (external parallel processing). Can you please explain what is the meaning of disjoint selections.
    Thanks,
    Siva.

    Hi Siva,
    With quite large background runs, the background work process can experience
    memory problems when the characteristics combinations are being imported.
    Therefore, an additional external' parallel processing (using several background jobs
    and disjoint selections) may be necessary.  Disjoint selections has no link to its
    selections made.
    Regards
    R. Senthil Mareeswaran.

  • Strange responsetime with query triggering parallel processing

    Hi,
    Are there anyone who can run this SQL below on a RAC 11g R2, and give me feedback on how long time it took?
    In my environment it takes more than a minute, and I suspect there is a problem with the database and parallel processing.
    If I collect the values from the inner select and make a list of comma-separated values, it goes fast.
    Replace SCHEMA_NAME with an existing SCHEMA_NAME on you database before running.
    SELECT sa.*
      FROM gv$sqlarea sa
      WHERE sa.sql_id in (SELECT sql_id from gv$sqlarea where parsing_schema_name like '%SCHEMA_NAME%' and rownum < 100)
    Thanks!

    You are using the hint a bit incorrectly.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#SQLRF50805
    <quote>
    The NO_PARALLEL hint overrides a PARALLEL parameter in the DDL that created or altered the table. For example:
    SELECT /*+ NO_PARALLEL(hr_emp) */ last_name
    FROM employees hr_emp;
    <quote>
    Check Metalink note 267330.1 as well.

  • Parallel processing query

    Hello all,
    I know parallel processing improves data performance when loading from source system. but how is parallel processing done in BW? how can we set up the number of parallel process on BW system? And does it have any impact on any other processes?
    Thanks

    S N
    Welcome to SDN
    please see this thread
    Re: Parallel data loading
    useful links
    http://help.sap.com/saphelp_nw04/helpdata/en/c4/3a7f1f505211d189550000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/fa/096ff6543b11d1898e0000e8322d00/frameset.htm
    Hope this helps
    Thnaks
    sat

  • 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

  • Parallel processing in background

    Hi All,
    I am processing 1 million of records in background, which takes approximately around 10 hrs. I wanted to reduce the time to less than 1 hr and tried using parallel processing. But the tasks run in Dialog workprocesses and giving abap short dumps due to time out.
    Is there any other solutions using that i can reduce total processing time.
    Please note that i cannot split. I am getting 1 million records from a select query and after processing all those records in SAP, I am sending to XI and XI will post in legacy system.
    Please note that all other performance tunings done.
    Thanks,
    Rajesh.

    Hi Rajesh,
    Refer sample code for <b>Parallel Processing</b>:
    By doing this your <b>processing</b> time will be highly optimized.
    Go thru the description given in the code at each level.
    This code Checks available WORK PROCESSes and assigns data in packets for processing. This way you save a lot of time esp when data is in Millions.
    Hope it helps.
    REPORT PARAJOB.
    Data declarations
    DATA: GROUP LIKE RZLLITAB-CLASSNAME VALUE ' ',
    "Parallel processing group.
    "SPACE = group default (all
    "servers)
    WP_AVAILABLE TYPE I, "Number of dialog work processes
    "available for parallel processing
    "(free work processes)
    WP_TOTAL TYPE I, "Total number of dialog work
    "processes in the group
    MSG(80) VALUE SPACE, "Container for error message in
    "case of remote RFC exception.
    INFO LIKE RFCSI, C, "Message text
    JOBS TYPE I VALUE 10, "Number of parallel jobs
    SND_JOBS TYPE I VALUE 1, "Work packets sent for processing
    RCV_JOBS TYPE I VALUE 1, "Work packet replies received
    EXCP_FLAG(1) TYPE C, "Number of RESOURCE_FAILUREs
    TASKNAME(4) TYPE N VALUE '0001', "Task name (name of
    "parallel processing work unit)
    BEGIN OF TASKLIST OCCURS 10, "Task administration
    TASKNAME(4) TYPE C,
    RFCDEST LIKE RFCSI-RFCDEST,
    RFCHOST LIKE RFCSI-RFCHOST,
    END OF TASKLIST.
    Optional call to SBPT_INITIALIZE to check the
    group in which parallel processing is to take place.
    Could be used to optimize sizing of work packets
    work / WP_AVAILABLE).
    CALL FUNCTION <b>'SPBT_INITIALIZE'</b>
    EXPORTING
    GROUP_NAME = GROUP
    "Name of group to check
    IMPORTING
    MAX_PBT_WPS = WP_TOTAL
    "Total number of dialog work
    "processes available in group
    "for parallel processing
    FREE_PBT_WPS = <b>WP_AVAILABLE</b>
    "Number of work processes
    "available in group for
    "parallel processing at this
    "moment
    EXCEPTIONS
    INVALID_GROUP_NAME = 1
    "Incorrect group name; RFC
    "group not defined. See
    "transaction RZ12
    INTERNAL_ERROR = 2
    "R/3 System error; see the
    "system log (transaction
    "SM21) for diagnostic info
    PBT_ENV_ALREADY_INITIALIZED = 3
    "Function module may be
    "called only once; is called
    "automatically by R/3 if you
    "do not call before starting
    "parallel processing
    CURRENTLY_NO_RESOURCES_AVAIL = 4
    "No dialog work processes
    "in the group are available;
    "they are busy or server load
    "is too high
    NO_PBT_RESOURCES_FOUND = 5
    "No servers in the group
    "met the criteria of >
    "two work processes
    "defined.
    CANT_INIT_DIFFERENT_PBT_GROUPS = 6
    "You have already initialized
    "one group and have now tried
    "initialize a different group.
    OTHERS = 7..
    CASE SY-SUBRC.
    WHEN 0.
    "Everything’s ok. Optionally set up for optimizing size of
    "work packets.
    WHEN 1.
    "Non-existent group name. Stop report.
    MESSAGE E836. "Group not defined.
    WHEN 2.
    "System error. Stop and check system log for error
    "analysis.
    WHEN 3.
    "Programming error. Stop and correct program.
    MESSAGE E833. "PBT environment was already initialized.
    WHEN 4.
    "No resources: this may be a temporary problem. You
    "may wish to pause briefly and repeat the call. Otherwise
    "check your RFC group administration: Group defined
    "in accordance with your requirements?
    MESSAGE E837. "All servers currently busy.
    WHEN 5.
    "Check your servers, network, operation modes.
    WHEN 6.
    Do parallel processing. Use CALL FUNCTION STARTING NEW TASK
    DESTINATION IN GROUP to call the function module that does the
    work. Make a call for each record that is to be processed, or
    divide the records into work packets. In each case, provide the
    set of records as an internal table in the CALL FUNCTION
    keyword (EXPORT, TABLES arguments).
    DO.
    CALL FUNCTION 'RFC_SYSTEM_INFO' "Function module to perform
    "in parallel
    STARTING NEW TASK TASKNAME "Name for identifying this
    "RFC call
    DESTINATION IN GROUP group "Name of group of servers to
    "use for parallel processing.
    "Enter group name exactly
    "as it appears in transaction
    "RZ12 (all caps). You may
    "use only one group name in a
    "particular ABAP program.
    PERFORMING RETURN_INFO ON END OF TASK
    "This form is called when the
    "RFC call completes. It can
    "collect IMPORT and TABLES
    "parameters from the called
    "function with RECEIVE.
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1 MESSAGE msg
    "Destination server not
    "reached or communication
    "interrupted. MESSAGE msg
    "captures any message
    "returned with this
    "exception (E or A messages
    "from the called FM, for
    "example. After exception
    "1 or 2, instead of aborting
    "your program, you could use
    "SPBT_GET_PP_DESTINATION and
    "SPBT_DO_NOT_USE_SERVER to
    "exclude this server from
    "further parallel processing.
    "You could then re-try this
    "call using a different
    "server.
    SYSTEM_FAILURE = 2 MESSAGE msg
    "Program or other internal
    "R/3 error. MESSAGE msg
    "captures any message
    "returned with this
    "exception.
    RESOURCE_FAILURE = 3. "No work processes are
    "currently available. Your
    "program MUST handle this
    "exception.
    YOUR_EXCEPTIONS = X. "Add exceptions generated by
    "the called function module
    "here. Exceptions are
    "returned to you and you can
    "respond to them here.
    CASE SY-SUBRC.
    WHEN 0.
    "Administration of asynchronous RFC tasks
    "Save name of task...
    TASKLIST-TASKNAME = TASKNAME.
    "... and get server that is performing RFC call.
    CALL FUNCTION 'SPBT_GET_PP_DESTINATION'
    EXPORTING
    RFCDEST = TASKLIST-RFCDEST
    EXCEPTIONS
    OTHERS = 1.
    APPEND TASKLIST.
    WRITE: / 'Started task: ', TASKLIST-TASKNAME COLOR 2.
    TASKNAME = TASKNAME + 1.
    SND_JOBS = SND_JOBS + 1.
    "Mechanism for determining when to leave the loop. Here, a
    "simple counter of the number of parallel processing tasks.
    "In production use, you would end the loop when you have
    "finished dispatching the data that is to be processed.
    JOBS = JOBS - 1. "Number of existing jobs
    IF JOBS = 0.
    EXIT. "Job processing finished
    ENDIF.
    WHEN 1 OR 2.
    "Handle communication and system failure. Your program must
    "catch these exceptions and arrange for a recoverable
    "termination of the background processing job.
    "Recommendation: Log the data that has been processed when
    "an RFC task is started and when it returns, so that the
    "job can be restarted with unprocessed data.
    WRITE msg.
    "Remove server from further consideration for
    "parallel processing tasks in this program.
    "Get name of server just called...
    CALL FUNCTION 'SPBT_GET_PP_DESTINATION'
    EXPORTING
    RFCDEST = TASKLIST-RFCDEST
    EXCEPTIONS
    OTHERS = 1.
    "Then remove from list of available servers.
    CALL FUNCTION 'SPBT_DO_NOT_USE_SERVER'
    IMPORTING
    SERVERNAME = TASKLIST-RFCDEST
    EXCEPTIONS
    INVALID_SERVER_NAME = 1
    NO_MORE_RESOURCES_LEFT = 2
    "No servers left in group.
    PBT_ENV_NOT_INITIALIZED_YET = 3
    OTHERS = 4.
    WHEN 3.
    "No resources (dialog work processes) available at
    "present. You need to handle this exception, waiting
    "and repeating the CALL FUNCTION until processing
    "can continue or it is apparent that there is a
    "problem that prevents continuation.
    MESSAGE I837. "All servers currently busy.
    "Wait for replies to asynchronous RFC calls. Each
    "reply should make a dialog work process available again.
    IF EXCP_FLAG = SPACE.
    EXCP_FLAG = 'X'.
    "First attempt at RESOURCE_FAILURE handling. Wait
    "until all RFC calls have returned or up to 1 second.
    "Then repeat CALL FUNCTION.
    WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '1' SECONDS.
    ELSE.
    "Second attempt at RESOURCE_FAILURE handling
    WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '5' SECONDS.
    "SY-SUBRC 0 from WAIT shows that replies have returned.
    "The resource problem was therefore probably temporary
    "and due to the workload. A non-zero RC suggests that
    "no RFC calls have been completed, and there may be
    "problems.
    IF SY-SUBRC = 0.
    CLEAR EXCP_FLAG.
    ELSE. "No replies
    "Endless loop handling
    ENDIF.
    ENDIF.
    ENDCASE.
    ENDDO.
    Wait for end of job: replies from all RFC tasks.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST.
    WRITE:/ 'Received task:', TASKLIST-TASKNAME COLOR 1,
    30 'Destination: ', TASKLIST-RFCDEST COLOR 1.
    ENDLOOP.
    This routine is triggered when an RFC call completes and
    returns. The routine uses RECEIVE to collect IMPORT and TABLE
    data from the RFC function module.
    Note that the WRITE keyword is not supported in asynchronous
    RFC. If you need to generate a list, then your RFC function
    module should return the list data in an internal table. You
    can then collect this data and output the list at the conclusion
    of processing.
    FORM RETURN_INFO USING TASKNAME.
    DATA: INFO_RFCDEST LIKE TASKLIST-RFCDEST.
    RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
    IMPORTING RFCSI_EXPORT = INFO
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1
    SYSTEM_FAILURE = 2.
    RCV_JOBS = RCV_JOBS + 1. "Receiving data
    IF SY-SUBRC NE 0.
    Handle communication and system failure
    ELSE.
    READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME.
    IF SY-SUBRC = 0. "Register data
    TASKLIST-RFCHOST = INFO_RFCHOST.
    MODIFY TASKLIST INDEX SY-TABIX.
    ENDIF.
    ENDIF.
    ENDFORM
    Reward points if that helps.
    Manish
    Message was edited by:
            Manish Kumar

  • Parallel processing in large_pool

    How can you set the parallel processes to use the large_pool instead of the shared_pool on an 11gR2 database? Pre 10g, parallel_automatic_tuning would set the large_pool for processing by paralel processes. Pparallel_automatic_tuning is deprecated since 10g. Also, I know that setting the PXuse_large_pool enables parallel processing in the large_pool. If PXuse_large_pool and parallel_automatic_tuning is set to FALSE and ASSM is disabled (sga_target=0), then what else can cause parallel processing to use large_pool?

    Large Pool Sizing
    Sizing the large pool can be complex. The large pool, if configured, must be at least 600 kilobytes in size. Usually, for most MTS applications, 600 is enough. However, if PQO (parallel query option) is also used in your Oracle8,Oracle8i, or Oracle9i environment, then the size of the large pool will increase dramatically. The V$SGASTAT dynamic performance view has a new column in Oracle8 called POOL. It is used to contain the pool area where that particular type of object is being stored. By issuing a summation select against the V$SGASTAT view, a DBA can quickly determine the size of the large pool area currently being used.
    SELECT name, SUM(bytes) FROM V$SGASTAT WHERE pool='LARGE POOL' GROUP BY ROLLUP(name);
    The above select should be used when an “ORA-04031:Unable to allocate 16084 bytes of shared memory (‘large pool’, ‘unknown object’, ‘large pool hea’, ‘PX large pool’)” error is received during operation with a large pool configured (the number of bytes specified may differ). When the above select is run, the resulting summary number of bytes will indicate the current size of the pool and show how close you are to your maximum, as specified in the initialization parameter LARGE_POOL_SIZE. Generally, increasing the large_pool by up to 100 percent will eliminate the ORA-04031 errors.
    In an undocumented (as of this writing) bug in 8.1.7.1 if you have large complex SQL statements, such as a 15 table join, and nothing to force large pool usage you can get excessive CPU times, ORA-04031 and ORA_01037 errors. If you get ORA-04031, or ORA-01037 errors and aren't using the large pool try turning on parallel query by setting the parallel query processes to minimum values to force use of the large pool.

  • Performance in Parallel Processing

    Hi,
    My program model is as follows:
    I have a RFC FM(ZRFC_BACKGROUND) that will be called in BACKGROUND TASK and
    This FM in turn will call a child process(another RFC FM(ZRFC_CHILD)) in parallel for packages that are created in ZRFC_BACKGROUND
    We can use around 10 work processes that belongs to one server group, for parallel processing
    Facts regarding Packaging:
    One Package has 4 retry attempts due to locking issues.if there is an error in child process, the package is held back in FM : ZRFC_BACKGROUND and re triggered after sometime
    Locking issues are frequent.
    Data in DB tables on which I will put SELECT query:
    Header        Table LIKP (With approximately 1 Million Entries) (My select query will fetch around    800 entries)
    Item             Table LIPS (With approximately 6 Million Entries) (My select query will fetch around 10000 entries)
    Partner        Table VBPA (With around 3 Million Entries) (My select query will fetch around 3000 entries)
    Reference   Table LIPSRF (With around 74 million entries) (My select query will fetch around 10000 entries)
    My QUESTION is which of the following approach is better:
         To put LIKP select query in the first background FM ZRFC_BACKGROUND and pass it to ZRFC_CHILD and do remaining query in ZRFC_CHILD
         OR to put all the select query in ZRFC_BACKGROUND
    Please keep following things in mind :
    As we know it is not recommended to pass huge tables in RFC as it may increase the network load (In case of select query in ZRFC_BACKGROUND, network load will be more)
    But it is also not recommended to do DB select several times (In case of select query in ZRFC_CHILD, db read time will be more )
    On the basis of aove facts, please suggest which is the better approach.
    Regards
    Rocky

    Hi Rocky,
    Why do you have locking issues? In the worst case, parallel processing will not help at all or even slow down the process if there are too many locks. Ideally, parallel tasks should not collide with each other. Which tables do you update / insert?
    How big are your packages? How long do they take to process?
    From the database point of view, it will not make a big difference whether you select 1 x 10000 entries or 100 x 100 entries. On the other side, if your second approach leads to additional database accesses as compared to the first one, this of course could slow down the process.
    Best Regards, Randolf

  • Basic query regarding work-area and select query

    hi
    dear sdn members,
    thanks too all for solving all my query's up till now
    i am stuck in a problem need help
    1)  why basically work-area has been used ? the sole purpose
    2)  different types of select query ? only coding examples
    note: no links pls
    regards,
    virus

    hi,
    Work Area
    Description for a data object that is particularly useful when working with internal tables or database tables as a source for changing operations or a target for reading operations.
    WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.
    Each row in a table is a record and each column is a field.
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    .g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
    It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.
    With header line
    SELECT.
    Put the curson on that word and press F1 . You can see the whole documentation for select statements.
    select statements :
    SELECT result
    FROM source
    INTO|APPENDING target
    [[FOR ALL ENTRIES IN itab] WHERE sql_cond]
    Effect
    SELECT is an Open-SQL-statement for reading data from one or several database tables into data objects.
    The select statement reads a result set (whose structure is determined in result ) from the database tables specified in source, and assigns the data from the result set to the data objects specified in target. You can restrict the result set using the WHERE addition. The addition GROUP BY compresses several database rows into a single row of the result set. The addition HAVING restricts the compressed rows. The addition ORDER BY sorts the result set.
    The data objects specified in target must match the result set result. This means that the result set is either assigned to the data objects in one step, or by row, or by packets of rows. In the second and third case, the SELECT statement opens a loop, which which must be closed using ENDSELECT. For every loop pass, the SELECT-statement assigns a row or a packet of rows to the data objects specified in target. If the last row was assigned or if the result set is empty, then SELECT branches to ENDSELECT . A database cursor is opened implicitly to process a SELECT-loop, and is closed again when the loop is ended. You can end the loop using the statements from section leave loops.
    Up to the INTO resp. APPENDING addition, the entries in the SELECTstatement define which data should be read by the database in which form. This requirement is translated in the database interface for the database system´s programming interface and is then passed to the database system. The data are read in packets by the database and are transported to the application server by the database server. On the application server, the data are transferred to the ABAP program´s data objects in accordance with the data specified in the INTO and APPENDING additions.
    System Fields
    The SELECT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Relevance
    0 The SELECT statement sets sy-subrc to 0 for every pass by value to an ABAP data object. The ENDSELECT statement sets sy-subrc to 0 if at least one row was transferred in the SELECT loop.
    4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
    8 The SELECT statement sets sy-subrc to 8 if the FOR UPDATE addition is used in result, without the primary key being specified fully after WHERE.
    After every value that is transferred to an ABAP data object, the SELECT statement sets sy-dbcnt to the number of rows that were transferred. If the result set is empty, sy-dbcnt is set to 0.
    Notes
    Outside classes, you do not need to specify the target area with INTO or APPENDING if a single database table or a single view is specified statically after FROM, and a table work area dbtab was declared with the TABLES statement for the corresponding database table or view. In this case, the system supplements the SELECT-statement implicitly with the addition INTO dbtab.
    Although the WHERE-condition is optional, you should always specify it for performance reasons, and the result set should not be restricted on the application server.
    SELECT-loops can be nested. For performance reasons, you should check whether a join or a sub-query would be more effective.
    Within a SELECT-loop you cannot execute any statements that lead to a database commit and consequently cause the corresponding database cursor to close.
    SELECT - result
    Syntax
    ... lines columns ... .
    Effect
    The data in result defines whether the resulting set consists of multiple rows (table-like structure) or a single row ( flat structure). It specifies the columns to be read and defines their names in the resulting set. Note that column names from the database table can be changed. For single columns, aggregate expressions can be used to specify aggregates. Identical rows in the resulting set can be excluded, and individual rows can be protected from parallel changes by another program.
    The data in result consists of data for the rows lines and for the columns columns.
    SELECT - lines
    Syntax
    ... { SINGLE }
    | { { } } ... .
    Alternatives:
    1. ... SINGLE
    2. ... { }
    Effect
    The data in lines specifies that the resulting set has either multiple lines or a single line.
    Alternative 1
    ... SINGLE
    Effect
    If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used.
    An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
    Note
    When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
    Alternative 2
    Effect
    If SINGLE is not specified and if columns does not contain only aggregate expressions, the resulting set has multiple lines. All database lines that are selected by the remaining additions of the SELECT command are included in the resulting list. If the ORDER BY addition is not used, the order of the lines in the resulting list is not defined and, if the same SELECT command is executed multiple times, the order may be different each time. A data object specified after INTO can be an internal table and the APPENDING addition can be used. If no internal table is specified after INTO or APPENDING, the SELECT command triggers a loop that has to be closed using ENDSELECT.
    If multiple lines are read without SINGLE, the DISTINCT addition can be used to exclude duplicate lines from the resulting list. If DISTINCT is used, the SELECT command circumvents SAP buffering. DISTINCT cannot be used in the following situations:
    If a column specified in columns has the type STRING, RAWSTRING, LCHAR or LRAW
    If the system tries to access pool or cluster tables and single columns are specified in columns.
    Note
    When specifying DISTINCT, note that you have to carry out sort operations in the database system for this.
    SELECT - columns
    Syntax
    | { {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ... }
    | (column_syntax) ... .
    Alternatives:
    1. ... *
    2. ... {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ...
    3. ... (column_syntax)
    Effect
    The input in columns determines which columns are used to build the resulting set.
    Alternative 1
    Effect
    If * is specified, the resulting set is built based on all columns in the database tables or views specified after FROM, in the order given there. The columns in the resulting set take on the name and data type from the database tables or views. Only one data object can be specified after INTO.
    Note
    If multiple database tables are specified after FROM, you cannot prevent multiple columns from getting the same name when you specify *.
    Alternative 2
    ... {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ...
    Effect
    A list of column labels col1 col2 ... is specified in order to build the resulting list from individual columns. An individual column can be specified directly or as an argument of an aggregate function aggregate. The order in which the column labels are specified is up to you and defines the order of the columns in the resulting list. Only if a column of the type LCHAR or LRAW is listed does the corresponding length field also have to be specified directly before it. An individual column can be specified multiple times.
    The addition AS can be used to define an alternative column name a1 a2 ... with a maximum of fourteen digits in the resulting set for every column label col1 col2 .... The system uses the alternative column name in the additions INTO|APPENDING CORRESPONDING FIELDS and ORDER BY. .
    Column labels
    The following column labels are possible:
    If only a single database table or a single view is specified after FROM, the column labels in the database table - that is, the names of the components comp1 comp2... - can be specified directly for col1 col2 ... in the structure of the ABAP Dictionary.
    If the name of the component occurs in multiple database tables of the FROM addition, but the desired database table or the view dbtab is only specified once after FROM, the names dbtab~comp1 dbtab~comp2 ... have to be specified for col1 col2 .... comp1 comp2 ... are the names of the components in the structure of the ABAP Dictionary.
    If the desired database table or view occurs multiple times after FROM, the names tabalias~comp1 tabalias~comp2 ... have to be specified for col1 col2 .... tabalias is the alternative table name of the database table or view defined after FROM, and comp1 comp2 ... are the names of the components in the structure of the ABAP Dictionary.
    The data type of a single column in the resulting list is the datatype of the corresponding component in the ABAP Dictionary. The corresponding data object after INTO or APPENDING has to be selected accordingly.
    Note
    If multiple database tables are specified after FROM, you can use alternative names when specifying single columns to avoid having multiple columns with the same name.
    Example
    Read specific columns of a single row.
    DATA wa TYPE spfli.
    SELECT SINGLE carrid connid cityfrom cityto
    INTO CORRESPONDING FIELDS OF wa
    FROM spfli
    WHERE carrid EQ 'LH' AND connid EQ '0400'.
    IF sy-subrc EQ 0.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDIF.
    Alternative 3
    ... (column_syntax)
    Effect
    Instead of static data, a data object column_syntax in brackets can be specified, which, when the command is executed, either contains the syntax shown with the static data, or is initial. The data object column_syntax can be a character-type data object or an internal table with a character-type data type. The syntax in column_syntax, like in the ABAP editor, is not case-sensitive. When specifying an internal table, you can distribute the syntax over multiple rows.
    If column_syntax is initial when the command is executed, columns is implicitly set to * and all columns are read.
    If columns are specificied dynamically without the SINGLE addition, the resulting set is always regarded as having multiple rows.
    Notes
    Before Release 6.10, you could only specify an internal table with a flat character-type row type for column_syntax with a maximum of 72 characters. Also, before Release 6.10, if you used the DISTINCT addition for dynamic access to pool tables or cluster tables, this was ignored, but since release 6.10, this causes a known exception.
    If column_syntax is an internal table with header line, the table body and not the header line is evaluated.
    Example
    Read out how many flights go to and from a city. The SELECT command is implemented only once in a sub-program. The column data, including aggregate function and the data after GROUP BY, is dynamic. Instead of adding the column data to an internal l_columns table, you could just as easily concatenate it in a character-type l_columns field.
    PERFORM my_select USING `CITYFROM`.
    ULINE.
    PERFORM my_select USING `CITYTO`.
    FORM my_select USING l_group TYPE string.
    DATA: l_columns TYPE TABLE OF string,
    l_container TYPE string,
    l_count TYPE i.
    APPEND l_group TO l_columns.
    APPEND `count( * )` TO l_columns.
    SELECT (l_columns)
    FROM spfli
    INTO (l_container, l_count)
    GROUP BY (l_group).
    WRITE: / l_count, l_container.
    ENDSELECT.
    ENDFORM.
    SELECT - aggregate
    Syntax
    ... { MAX( col )
    | MIN( col )
    | AVG( col )
    | SUM( col )
    | COUNT( DISTINCT col )
    | COUNT( * )
    | count(*) } ... .
    Effect
    As many of the specified column labels as you like can be listed in the SELECT command as arguments of the above aggregate expression. In aggregate expressions, a single value is calculated from the values of multiple rows in a column as follows (note that the addition DISTINCT excludes double values from the calculation):
    MAX( col ) Determines the maximum value of the value in the column col in the resulting set or in the current group.
    MIN( col ) Determines the minimum value of the content of the column col in the resulting set or in the current group.
    AVG( col ) Determines the average value of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    SUM( col ) Determines the sum of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    COUNT( DISTINCT col ) Determines the number of different values in the column col in the resulting set or in the current group.
    COUNT( * ) (or count(*)) Determines the number of rows in the resulting set or in the current group. No column label is specified in this case.
    If you are using aggregate expressions, all column labels that are not listed as an argument of an aggregate function are listed after the addition GROUP BY. The aggregate functions evaluate the content of the groups defined by GROUP BY in the database system and transfer the result to the combined rows of the resulting set.
    The data type of aggregate expressions with the function MAX, MIN or SUM is the data type of the corresponding column in the ABAP Dictionary. Aggregate expressions with the function AVG have the data type FLTP, and those with COUNT have the data type INT4. The corresponding data object after INTO or APPENDING has to be selected accordingly.
    Note the following points when using aggregate expressions:
    If the addition FOR ALL ENTRIES is used in front of WHERE, or if cluster or pool tables are listed after FROM, no other aggregate expressions apart from COUNT( * ) can be used.
    Columns of the type STRING or RAWSTRING cannot be used with aggregate functions.
    When aggregate expressions are used, the SELECT command makes it unnecessary to use SAP buffering.
    Null values are not included in the calculation for the aggregate functions. The result is a null value only if all the rows in the column in question contain the null value.
    If only aggregate expressions are used after SELECT, the results set has one row and the addition GROUP BY is not necessary. If a non-table type target area is specified after INTO, the command ENDSELECT cannot be used together with the addition SINGLE. If the aggregate expression count( * ) is not being used, an internal table can be specified after INTO, and the first row of this table is filled.
    If aggregate functions are used without GROUP BY being specified at the same time, the resulting set also contains a row if no data is found in the database. If count( * ) is used, the column in question contains the value 0. The columns in the other aggregate functions contain initial values. This row is assigned to the data object specified after INTO, and unless count( * ) is being used exclusively, sy-subrc is set to 0 and sy-dbcnt is set to 1. If count( *) is used exclusively, the addition INTO can be omitted and if no data can be found in the database, sy-subrc is set to 4 and sy-dbcnt is set to 0.
    if helpful reward points

  • Parallel processing of Jobs in Java

    Hi Sun forum Experts,
    we are facing a problem in parallel processing of jobs in java,The jdk version used is 1.4.
    Find the issue analysis as below
    Assume we have TABLE1 as below:  
    1st job completed running and updates the status to OK by running an update query (so STATUS in TABLE1 is OK )---> 1st row  
    2nd job is still running and is in IN (Status in Table) ---> 2nd row  
    3rd job is still running and is in IN (Status in Table) ---> 3rd row  
    4th job is still running and is in IN (Status in Table) ---> 4th row  
    In the meanwhile, the First job has completed the job and hence  status is "OK" now. now we are calling another update query which updates another column in another table(TABLE2) in database.  
    The query is " Update TABLE2 set STATUS="OK" where INIT_NO='123456789' AND NOT EXISTS(SELECT COUNT(*) FROM  TABLE1 WHERE STATUS in('IN','RE'))  
    Hence the subquery is returning 3 rows as count for the inner query execution which skips the updation of the TABLE2.
    {code}
    *The problem is we want all the 4 jobs to be completed first with respect to TABLE1(running a update query)   & Once this is done we need to update another column in another table(TABLE2) in database.*
    i.e as shown below
    {code}
    public void execute(){  
                 dao.updateTable1(); // calls Table1 and updates it to OK. --> This has to be performed for n number for jobs.Finish all job completion and then proceed below.  
                //Once UpdateTable1 is completed ,after this we perform the below step  
                dao.updateTable2(); //calls Table2 and updates it to OK    
    {code}
    how do we handle this scenario in Java,
    Please Note:Version in java is used is 1.4 only
    Deepak                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    yes sir,you are absolutely correct.
    We run 4 jobs to update table1, wait for them all to complete, then update table2   can you please tell me how do we achieve this in java,
    Please note:JDK version is 1.4 which we are using.
    Thanks
    Deepak
    Edited by: Deepak_A_L on Jun 25, 2009 12:58 AM

  • How to monitor parallel processing

    Hi All,
    I have 2 short questions:
    1. When we want parallel processing, we can either use a parallel hing in the query, or alter a table to be parrallel. My question is what is the difference in the following 2 syntax:
    a. ALTER TABLE myTable PARALLEL (DEGREE 3);
    b. ALTER TABLE myTable PARALLEL 3;
    Does the "DEGREE" keywor make any difference? or they both are same statements?
    2. When we enable parallel processing, how can we monitor oracle processes, to confirm that a certain table is being actually processed by multiple threads of a singe user process?
    An early response would be highly appreciated. Thanks.

    user566817 wrote:
    2. When we enable parallel processing, how can we monitor oracle processes, to confirm that a certain table is being actually processed by multiple threads of a singe user process?There are a number of virtual performance views that can be used. Please refer to the Oracle® Database Reference guide for details on these.
    Had a look though my scripts and I have this one.. cannot recall if I "borrowed" it from somewhere and customised it and how old it is.. but it should (hopefully) still be mostly correct. It uses the virtual view v$px_process to determine the list of current PQ slaves in the pool and if they are used, map them to the Oracle session using them.
    select  distinct
            x.server_name           as "PQ",
            x.status                as "Status",
            x.sid                   as "OraPID",
            w2.sid                  as "Parent OraPID",
            v.osuser                as "O/S User",
            v.schemaname            as "User",
            w1.event                as "Child Wait",
            w2.event                as "Parent Wait"
    from    v$px_process    x,
            v$lock          l,
            v$session       v,
            v$session_wait w1,
            v$session_wait w2
    where   x.sid =! l.sid(+)
    and     to_number (substr(x.server_name,3)) = l.id2(+)
    and     x.sid = w1.sid(+)
    and     l.sid = w2.sid(+)
    and     x.sid = v.sid(+)
    and     nvl(l.type,'PS') = 'PS'Use at own risk - best would be to verify that this is still valid using the Reference Guide. Or create similar ones using the available V$ views for the details you want to see (e.g. SQL statement executed per PQ, etc).

Maybe you are looking for

  • EAR Deployment error!

    I have created a servlet client to test a secured web service. When I deploy the EAR,I get error: Result => deployment aborted : file:/C:/DOCUME~1/uname/LOCALS~1/Temp/temp1530011368822716654CapsWS_EAR.ear Aborted: development component 'CapsWS_EAR'/'

  • Error while extract DME file

    Hello Experts, One user is getting an error while extract DME (Payment File) from customized transaction. Other users are able to save the file on desired location. Error: C:\AB\filename.TXT not allowed in subscreens (Screen: ) Please let me how to s

  • What are the settings for web?

    What are the settings for web?

  • Designer crashes when opening form

    We have a form that was created with Designer, but I am no longer able to open it for editing. When I try, I get the error that LiveCycle Designer has stopped working. The last time I needed to update the form was about two years ago, which I was abl

  • Problem Using KSoap?

    hi, i am using ksoap for developing an web service Client midlet,one of the Webservices needs an 2 Dimensional String to be Passed as Parameter.how can we do this with Ksoap.any sample code would be a great help thanks