Single block read for Sort

I’m creating a temp table with following SQL. Table temp2 is 50GB in size with 120M rows. I noticed during SORT operation , it’s performing lots of single block reads on Temp tablespace. Why it’s doing single block reads on temp??
Also, Is there any other way to make this quicker?
I'm on 10gR2 with Auto PGA/SGA. PGA Aggregate is 5GB and SGA is 12GB.
create table t_temp nologging parallel(degree 4 )
as
select /*+ parallel(t1,4) */ * from temp2 partition(P2008)  t1
order by custkey
    SID Wait State    EVENT                               P1                         P2              P3                    SEQ# % TotTime TEventTime(ms)  DistEvnts Avgtime(ms)/Evnt
   2165 WAITING       direct path read temp               file number= 5001          first dba=      block cnt= 1                     .02           .253          1             .253
                                                                                     88791
   2165 WAITING       direct path read temp               file number= 5001          first dba=      block cnt= 1                     .02           .253          1             .253
                                                                                     412771
   2165 WAITING       direct path read temp               file number= 5001          first dba=      block cnt= 1                     .02           .253          1             .253
                                                                                     421465
   2165 WAITING       direct path read temp               file number= 5001          first dba=      block cnt= 1                     .02           .253          1             .253
                                                                                     691141
   2165 WAITING       direct path read temp               file number= 5001          first dba=      block cnt= 1                     .02           .253          1             .253
                                                                                     1295425
Here is  Temp table space properties…
Name                    INITK    NEXTK MINEX MAXEX PCTI CNTS      EXMGMT     ALOCTYPE  SEGMGM STATUS
TEMP                     1024     1024     1          0 TEMPORARY LOCAL      UNIFORM   MANUAL ONLINEEdited by: user4529833 on Feb 5, 2009 9:05 AM

user4529833 wrote:
Thanks Jonathan.
I will do that and post the results... One questions though, how to correct this unexpected side-effect of asynchronous reads... ( Assuming it's the case )
If the assumption is correct, then it's not really something that needs to be corrected. Because of the overlapping of I/Os, there may be lots of I/Os that never make it into wait time, so a single process could be going:
give me 12 blocks
give me 12 blocks
give me 12 blocks
give me 12 blocks
give me a block
of which you see only the "give me a block".
That's why the 10033 is an important diagnostic - it will help you decide whether or not "everything" is a single block read, or whether the single block reads are a very tiny fraction of the total I/O that also happens to become visible for some reason.
how does oracle perform sort for SQLs I have given..
1) read & sort the data for custid coulmn with rowids and dump it temp (quite likely)
2) read the rowids from temp and start loading row to temp table..I'd have to check the execution to give you a definite answer but the basic strategy would be:
<ul>
Two sets of PX slaves.
Set one reads a chunk of the source table picking up all the relevant columns for the result table.
Because of the ORDER BY clause layer one does a range-based distribution of data to the second set of slaves - along the lines of "slave 1 gets custid less than 1M", "slave 2 gets custid between 1M and 2M" and so on. Because entire rows are passed between the two sets of slaves, you can see a LOT of PQ traffic going on. (People sometimes increase the "PX message size" parameter because of the volume of traffic and the size of the rows).
Set two slaves accumulate, and sort the incoming data sets. Each sorted row carries ALL the columns, there is no "sort the custkey/rowids only" strategy. The sorting may spill to temp - given your "select *", the amount of temp space used may actually be greater than the size of the source table.
Each set two slave creates its own "private table" with its results.
The query coordinator links the "private table" metadata in the data dictionay in the right order to create the final table.
</ul>
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"Science is more than a body of knowledge; it is a way of thinking"
Carl Sagan
To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Unable to relate consistent reads with number of phsyical block reads

    HI ,
    The question is we have observed the consistent reads are much more than total buffers required to give the results back.
    I have flushed the buffer_cache before executing the query and also queried the V$BH to know the buffer details for these objects ...after the flush before firing the query we don't have any buffers regarding these tables. Which is expected.
    We are doing DB file sequential reads through the plan and it will result into a single block read at a time.
    Please take a close look at "TABLE ACCESS BY INDEX ROWID CMPGN_DIM (cr=45379 pr=22949 pw=0 time=52434931 us)" line in the below row source plan..
    Here we have only 22949 physical reads means 22949 data buffers but we are seeing 45379 consistent gets.
    Note: We have the CMPGN_DIM and AD_GRP tables are in 4M block size table space and we have only than the default db_cache_size . My database block size is 8192.
    Can you please help me in understand how the 22949 sequential reads result into 45379 consistant gets.
    Even the V$BH query buffer details matches with physical reads .
    query row source plan from 10043 trace:
    27 SORT ORDER BY (cr=92355 pr=47396 pw=0 time=359030364 us)
    27 WINDOW SORT (cr=92355 pr=47396 pw=0 time=359030088 us)
    27 NESTED LOOPS OUTER (cr=92355 pr=47396 pw=0 time=359094569 us)
    27 NESTED LOOPS OUTER (cr=92276 pr=47395 pw=0 time=359041825 us)
    27 VIEW (cr=92197 pr=47393 pw=0 time=358984314 us)
    27 UNION-ALL (cr=92197 pr=47393 pw=0 time=358984120 us)
    26 HASH GROUP BY (cr=92197 pr=47393 pw=0 time=358983665 us)
    9400 VIEW (cr=92197 pr=47393 pw=0 time=359094286 us)
    9400 COUNT (cr=92197 pr=47393 pw=0 time=359056676 us)
    9400 VIEW (cr=92197 pr=47393 pw=0 time=359009672 us)
    9400 SORT ORDER BY (cr=92197 pr=47393 pw=0 time=358972063 us)
    9400 HASH JOIN OUTER (cr=92197 pr=47393 pw=0 time=358954170 us)
    9400 VIEW (cr=92191 pr=47387 pw=0 time=349796124 us)
    9400 HASH JOIN (cr=92191 pr=47387 pw=0 time=349758517 us)
    94 TABLE ACCESS BY INDEX ROWID CMPGN_DIM (cr=45379 pr=22949 pw=0 time=52434931 us)
    50700 INDEX RANGE SCAN IDX_CMPGN_DIM_UK1 (cr=351 pr=349 pw=0 time=1915239 us)(object id 55617)
    60335 TABLE ACCESS BY INDEX ROWID AD_GRP (cr=46812 pr=24438 pw=0 time=208234661 us)
    60335 INDEX RANGE SCAN IDX_AD_GRP2 (cr=613 pr=611 pw=0 time=13350221 us)(object id 10072801)
    7 VIEW (cr=6 pr=6 pw=0 time=72933 us)
    7 HASH GROUP BY (cr=6 pr=6 pw=0 time=72898 us)
    162 PARTITION RANGE SINGLE PARTITION: 4 4 (cr=6 pr=6 pw=0 time=45363 us)
    162 PARTITION HASH SINGLE PARTITION: 676 676 (cr=6 pr=6 pw=0 time=44690 us)
    162 INDEX RANGE SCAN PK_AD_GRP_DTL_FACT PARTITION: 3748 3748 (cr=6 pr=6 pw=0 time=44031 us)(object id 8347241)
    1 FAST DUAL (cr=0 pr=0 pw=0 time=9 us)
    25 TABLE ACCESS BY INDEX ROWID AD_GRP (cr=79 pr=2 pw=0 time=29817 us)

    I think that I understand your question. The consistent gets statistic (CR) indicates the number of times blocks were accessed in memory, and doing so possibly required undo to be applied to the blocks to provide a consistent get. The physical read statistic (PR) indicates the number of blocks that were accessed from disk. The consistent gets statistic may be very close to the physical reads statistic, or very different depending on several factors. A test case might best explain why the CR and PR statistics may differ significantly. First, creating the test objects:
    CREATE TABLE T1 AS
    SELECT
      ROWNUM C1,
      1000000-ROWNUM C2,
      RPAD(TO_CHAR(ROWNUM),800,'X') C3
    FROM
      DUAL
    CONNECT BY
      LEVEL<=1000000;
    CREATE INDEX INT_T1_C1 ON T1(C1);
    CREATE INDEX INT_T1_C2 ON T1(C2);
    CREATE TABLE T2 AS
    SELECT
      ROWNUM C1,
      1000000-ROWNUM C2,
      RPAD(TO_CHAR(ROWNUM),800,'X') C3
    FROM
      DUAL
    CONNECT BY
      LEVEL<=100000;
    COMMIT;
    EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE,ESTIMATE_PERCENT=>NULL)
    EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T2',CASCADE=>TRUE,ESTIMATE_PERCENT=>NULL)We now have 2 tables, the first with 1,000,000 rows with about 8 rows per block and having 2 indexes, and the second table with 100,000 rows and no indexes.
    SELECT
      TABLE_NAME,
      PCT_FREE,
      NUM_ROWS,
      BLOCKS
    FROM
      USER_TABLES
    WHERE
      TABLE_NAME IN ('T1','T2');
    TABLE_NAME   PCT_FREE   NUM_ROWS     BLOCKS
    T1                 10    1000000     125597
    T2                 10     100000      12655
    COLUMN INDEX_NAME FORMAT A10
    SELECT
      INDEX_NAME,
      BLEVEL,
      LEAF_BLOCKS,
      DISTINCT_KEYS DK,
      CLUSTERING_FACTOR CF,
      NUM_ROWS
    FROM
      USER_INDEXES
    WHERE
      TABLE_NAME IN ('T1','T2');
    INDEX_NAME     BLEVEL LEAF_BLOCKS         DK         CF   NUM_ROWS
    INT_T1_C1           2        2226    1000000     125000    1000000
    INT_T1_C2           2        2226    1000000     125000    1000000Now a test script to try a couple experiments with the two tables:
    SET LIN 120
    SET AUTOTRACE TRACEONLY STATISTICS EXPLAIN
    SET TIMING ON
    SPOOL C:\MYTEST.TXT
    ALTER SESSION SET STATISTICS_LEVEL=TYPICAL;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'TEST1';
    ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 8';
    SELECT /*+ USE_HASH(T1 T2) */
      T1.C1,
      T2.C2,
      T1.C3
    FROM
      T1,
      T2
    WHERE
      T1.C2=T2.C2
      AND T1.C2 BETWEEN 900000 AND 1000000;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'TEST2';
    SELECT /*+ USE_NL(T1 T2) */
      T1.C1,
      T2.C2,
      T1.C3
    FROM
      T1,
      T2
    WHERE
      T1.C2=T2.C2
      AND T1.C2 BETWEEN 900000 AND 1000000;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'TEST3';
    SELECT /*+ USE_HASH(T1 T2) */
      T1.C1,
      T2.C2,
      T1.C3
    FROM
      T1,
      T2
    WHERE
      T1.C1=T2.C1
      AND T1.C1 BETWEEN 1 AND 100000;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'TEST4';
    SELECT /*+ USE_NL(T1 T2) */
      T1.C1,
      T2.C2,
      T1.C3
    FROM
      T1,
      T2
    WHERE
      T1.C1=T2.C1
      AND T1.C1 BETWEEN 1 AND 100000;
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'TEST5';
    SELECT /*+ USE_NL(T1 T2) FIND_ME */
      T1.C1,
      T2.C2,
      T1.C3
    FROM
      T1,
      T2
    WHERE
      T1.C1=T2.C1
      AND T1.C1 BETWEEN 1 AND 100000;
    SET AUTOTRACE OFF
    ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF';
    SPOOL OFFTest script output follows (note that the script was executed twice so that statistics related to the hard parse would be excluded):
    SQL> SELECT /*+ USE_HASH(T1 T2) */
      2    T1.C1,
      3    T2.C2,
      4    T1.C3
      5  FROM
      6    T1,
      7    T2
      8  WHERE
      9    T1.C2=T2.C2
    10    AND T1.C2 BETWEEN 900000 AND 1000000;
    100000 rows selected.
    Elapsed: 00:00:22.65
    Execution Plan
    Plan hash value: 488978626                                                                                             
    | Id  | Operation                    | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |                     
    |   0 | SELECT STATEMENT             |           | 99999 |    77M|       | 20139   (1)| 00:04:02 |                     
    |*  1 |  HASH JOIN                   |           | 99999 |    77M|  1664K| 20139   (1)| 00:04:02 |                     
    |*  2 |   TABLE ACCESS FULL          | T2        |   100K|   488K|       |  3435   (1)| 00:00:42 |                     
    |   3 |   TABLE ACCESS BY INDEX ROWID| T1        |   100K|    77M|       | 12733   (1)| 00:02:33 |                     
    |*  4 |    INDEX RANGE SCAN          | INT_T1_C2 |   100K|       |       |   226   (1)| 00:00:03 |                     
    Predicate Information (identified by operation id):                                                                    
       1 - access("T1"."C2"="T2"."C2")                                                                                     
       2 - filter("T2"."C2">=900000 AND "T2"."C2"<=1000000)                                                                
       4 - access("T1"."C2">=900000 AND "T1"."C2"<=1000000)                                                                
    Statistics
              0  recursive calls                                                                                           
              0  db block gets                                                                                             
          37721  consistent gets                                                                                           
          25226  physical reads                                                                                            
              0  redo size                                                                                                 
       82555058  bytes sent via SQL*Net to client                                                                          
          73722  bytes received via SQL*Net from client                                                                    
           6668  SQL*Net roundtrips to/from client                                                                         
              0  sorts (memory)                                                                                            
              0  sorts (disk)                                                                                              
         100000  rows processed                                                                                            
    STAT lines from the 10046 trace:
    STAT #37 id=1 cnt=100000 pid=0 pos=1 obj=0 op='HASH JOIN  (cr=37721 pr=25226 pw=0 time=106305676 us)'
    STAT #37 id=2 cnt=100000 pid=1 pos=1 obj=48144 op='TABLE ACCESS FULL T2 (cr=12511 pr=12501 pw=0 time=13403966 us)'
    STAT #37 id=3 cnt=100000 pid=1 pos=2 obj=48141 op='TABLE ACCESS BY INDEX ROWID T1 (cr=25210 pr=12725 pw=0 time=103903740 us)'
    STAT #37 id=4 cnt=100000 pid=3 pos=1 obj=48143 op='INDEX RANGE SCAN INT_T1_C2 (cr=6877 pr=225 pw=0 time=503602 us)'Elapsed: 00:00:00.01
    SQL> SELECT /*+ USE_NL(T1 T2) */
      2    T1.C1,
      3    T2.C2,
      4    T1.C3
      5  FROM
      6    T1,
      7    T2
      8  WHERE
      9    T1.C2=T2.C2
    10    AND T1.C2 BETWEEN 900000 AND 1000000;
    100000 rows selected.
    Elapsed: 00:00:20.17
    Execution Plan
    Plan hash value: 1773329022                                                                                            
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |                              
    |   0 | SELECT STATEMENT            |           | 99999 |    77M|   303K  (1)| 01:00:43 |                              
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |     1 |   810 |     3   (0)| 00:00:01 |                              
    |   2 |   NESTED LOOPS              |           | 99999 |    77M|   303K  (1)| 01:00:43 |                              
    |*  3 |    TABLE ACCESS FULL        | T2        |   100K|   488K|  3435   (1)| 00:00:42 |                              
    |*  4 |    INDEX RANGE SCAN         | INT_T1_C2 |     1 |       |     2   (0)| 00:00:01 |                              
    Predicate Information (identified by operation id):                                                                    
       3 - filter("T2"."C2">=900000 AND "T2"."C2"<=1000000)                                                                
       4 - access("T1"."C2"="T2"."C2")                                                                                     
           filter("T1"."C2">=900000 AND "T1"."C2"<=1000000)                                                                
    Statistics
              0  recursive calls                                                                                           
              0  db block gets                                                                                             
         250219  consistent gets                                                                                           
          25227  physical reads                                                                                            
              0  redo size                                                                                                 
       82555058  bytes sent via SQL*Net to client                                                                          
          73722  bytes received via SQL*Net from client                                                                    
           6668  SQL*Net roundtrips to/from client                                                                         
              0  sorts (memory)                                                                                            
              0  sorts (disk)                                                                                              
         100000  rows processed                                                                                            
    STAT lines from the 10046 trace:
    STAT #36 id=1 cnt=100000 pid=0 pos=1 obj=48141 op='TABLE ACCESS BY INDEX ROWID T1 (cr=250219 pr=25227 pw=0 time=61410637 us)'
    STAT #36 id=2 cnt=200001 pid=1 pos=1 obj=0 op='NESTED LOOPS  (cr=231886 pr=12727 pw=0 time=3000840 us)'
    STAT #36 id=3 cnt=100000 pid=2 pos=1 obj=48144 op='TABLE ACCESS FULL T2 (cr=18344 pr=12501 pw=0 time=14103896 us)'
    STAT #36 id=4 cnt=100000 pid=2 pos=2 obj=48143 op='INDEX RANGE SCAN INT_T1_C2 (cr=213542 pr=226 pw=0 time=1929742 us)'
    SQL> SELECT /*+ USE_HASH(T1 T2) */
      2    T1.C1,
      3    T2.C2,
      4    T1.C3
      5  FROM
      6    T1,
      7    T2
      8  WHERE
      9    T1.C1=T2.C1
    10    AND T1.C1 BETWEEN 1 AND 100000;
    100000 rows selected.
    Elapsed: 00:00:20.35
    Execution Plan
    Plan hash value: 689276421                                                                                             
    | Id  | Operation                    | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |                     
    |   0 | SELECT STATEMENT             |           | 99999 |    77M|       | 20143   (1)| 00:04:02 |                     
    |*  1 |  HASH JOIN                   |           | 99999 |    77M|  2152K| 20143   (1)| 00:04:02 |                     
    |*  2 |   TABLE ACCESS FULL          | T2        |   100K|   976K|       |  3435   (1)| 00:00:42 |                     
    |   3 |   TABLE ACCESS BY INDEX ROWID| T1        |   100K|    76M|       | 12733   (1)| 00:02:33 |                     
    |*  4 |    INDEX RANGE SCAN          | INT_T1_C1 |   100K|       |       |   226   (1)| 00:00:03 |                     
    Predicate Information (identified by operation id):                                                                    
       1 - access("T1"."C1"="T2"."C1")                                                                                     
       2 - filter("T2"."C1">=1 AND "T2"."C1"<=100000)                                                                      
       4 - access("T1"."C1">=1 AND "T1"."C1"<=100000)                                                                      
    Statistics
              0  recursive calls                                                                                           
              0  db block gets                                                                                             
          37720  consistent gets                                                                                           
          25225  physical reads                                                                                            
              0  redo size                                                                                                 
       82555058  bytes sent via SQL*Net to client                                                                          
          73722  bytes received via SQL*Net from client                                                                    
           6668  SQL*Net roundtrips to/from client                                                                         
              0  sorts (memory)                                                                                            
              0  sorts (disk)                                                                                              
         100000  rows processed                                                                                            
    STAT lines from the 10046 trace:
    STAT #38 id=1 cnt=100000 pid=0 pos=1 obj=0 op='HASH JOIN  (cr=37720 pr=25225 pw=0 time=69225424 us)'
    STAT #38 id=2 cnt=100000 pid=1 pos=1 obj=48144 op='TABLE ACCESS FULL T2 (cr=12511 pr=12501 pw=0 time=13204971 us)'
    STAT #38 id=3 cnt=100000 pid=1 pos=2 obj=48141 op='TABLE ACCESS BY INDEX ROWID T1 (cr=25209 pr=12724 pw=0 time=66504913 us)'
    STAT #38 id=4 cnt=100000 pid=3 pos=1 obj=48142 op='INDEX RANGE SCAN INT_T1_C1 (cr=6876 pr=224 pw=0 time=604405 us)'
    SQL> SELECT /*+ USE_NL(T1 T2) */
      2    T1.C1,
      3    T2.C2,
      4    T1.C3
      5  FROM
      6    T1,
      7    T2
      8  WHERE
      9    T1.C1=T2.C1
    10    AND T1.C1 BETWEEN 1 AND 100000;
    100000 rows selected.
    Elapsed: 00:00:28.11
    Execution Plan
    Plan hash value: 1467726760                                                                                            
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |                              
    |   0 | SELECT STATEMENT            |           | 99999 |    77M|   303K  (1)| 01:00:43 |                              
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |     1 |   806 |     3   (0)| 00:00:01 |                              
    |   2 |   NESTED LOOPS              |           | 99999 |    77M|   303K  (1)| 01:00:43 |                              
    |*  3 |    TABLE ACCESS FULL        | T2        |   100K|   976K|  3435   (1)| 00:00:42 |                              
    |*  4 |    INDEX RANGE SCAN         | INT_T1_C1 |     1 |       |     2   (0)| 00:00:01 |                              
    Predicate Information (identified by operation id):                                                                    
       3 - filter("T2"."C1">=1 AND "T2"."C1"<=100000)                                                                      
       4 - access("T1"."C1"="T2"."C1")                                                                                     
           filter("T1"."C1"<=100000 AND "T1"."C1">=1)                                                                      
    Statistics
              0  recursive calls                                                                                           
              0  db block gets                                                                                             
         250218  consistent gets                                                                                           
          25225  physical reads                                                                                            
              0  redo size                                                                                                 
       82555058  bytes sent via SQL*Net to client                                                                          
          73722  bytes received via SQL*Net from client                                                                    
           6668  SQL*Net roundtrips to/from client                                                                         
              0  sorts (memory)                                                                                            
              0  sorts (disk)                                                                                              
         100000  rows processed                                                                                            
    STAT lines from the 10046 trace:
    STAT #26 id=1 cnt=100000 pid=0 pos=1 obj=48141 op='TABLE ACCESS BY INDEX ROWID T1 (cr=250218 pr=25225 pw=0 time=80712592 us)'
    STAT #26 id=2 cnt=200001 pid=1 pos=1 obj=0 op='NESTED LOOPS  (cr=231885 pr=12725 pw=0 time=4601151 us)'
    STAT #26 id=3 cnt=100000 pid=2 pos=1 obj=48144 op='TABLE ACCESS FULL T2 (cr=18344 pr=12501 pw=0 time=17704737 us)'
    STAT #26 id=4 cnt=100000 pid=2 pos=2 obj=48142 op='INDEX RANGE SCAN INT_T1_C1 (cr=213541 pr=224 pw=0 time=2683089 us)'
    SQL> SELECT /*+ USE_NL(T1 T2) FIND_ME */
      2    T1.C1,
      3    T2.C2,
      4    T1.C3
      5  FROM
      6    T1,
      7    T2
      8  WHERE
      9    T1.C1=T2.C1
    10    AND T1.C1 BETWEEN 1 AND 100000;
    100000 rows selected.
    Elapsed: 00:00:17.81
    Execution Plan
    Plan hash value: 1467726760                                                                                            
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |                              
    |   0 | SELECT STATEMENT            |           | 99999 |    77M|   303K  (1)| 01:00:43 |                              
    |   1 |  TABLE ACCESS BY INDEX ROWID| T1        |     1 |   806 |     3   (0)| 00:00:01 |                              
    |   2 |   NESTED LOOPS              |           | 99999 |    77M|   303K  (1)| 01:00:43 |                              
    |*  3 |    TABLE ACCESS FULL        | T2        |   100K|   976K|  3435   (1)| 00:00:42 |                              
    |*  4 |    INDEX RANGE SCAN         | INT_T1_C1 |     1 |       |     2   (0)| 00:00:01 |                              
    Predicate Information (identified by operation id):                                                                    
       3 - filter("T2"."C1">=1 AND "T2"."C1"<=100000)                                                                      
       4 - access("T1"."C1"="T2"."C1")                                                                                     
           filter("T1"."C1"<=100000 AND "T1"."C1">=1)                                                                      
    Statistics
              0  recursive calls                                                                                           
              0  db block gets                                                                                             
         250218  consistent gets                                                                                           
              0  physical reads                                                                                            
              0  redo size                                                                                                 
       82555058  bytes sent via SQL*Net to client                                                                          
          73722  bytes received via SQL*Net from client                                                                    
           6668  SQL*Net roundtrips to/from client                                                                         
              0  sorts (memory)                                                                                            
              0  sorts (disk)                                                                                              
         100000  rows processed                                                                                            
    STAT lines from the 10046 trace:
    STAT #36 id=1 cnt=100000 pid=0 pos=1 obj=48141 op='TABLE ACCESS BY INDEX ROWID T1 (cr=250218 pr=0 pw=0 time=6000438 us)'
    STAT #36 id=2 cnt=200001 pid=1 pos=1 obj=0 op='NESTED LOOPS  (cr=231885 pr=0 pw=0 time=2401295 us)'
    STAT #36 id=3 cnt=100000 pid=2 pos=1 obj=48144 op='TABLE ACCESS FULL T2 (cr=18344 pr=0 pw=0 time=1400071 us)'
    STAT #36 id=4 cnt=100000 pid=2 pos=2 obj=48142 op='INDEX RANGE SCAN INT_T1_C1 (cr=213541 pr=0 pw=0 time=2435627 us)'So, what does the above mean? Why would a forced execution plan change the number of consistent gets? Why would not flushing the buffer cache cause the PR statistic to drop to 0, yet not change the CR statistic?
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Oracle 11g - Memory used for sorting

    Hi everyone,
    I would like to know how I could analyze memory used for sorting in Oracle 11g. When I run the below query, it returns 1531381.
    select value from v$sysstat where name like 'sorts (memory)';But when I check sort_area_size parameter from v$parameter, it returns 65536. Does it mean my database is using more memory for sorting than sort_area_size. Or is the way I interpret v$sysstat view and sort_area_size wrong? What is the best way to monitor the memory usage for sorting? Thanks in advance.
    Regards,
    K.H
    Edited by: K Hein on Apr 5, 2012 8:16 PM

    check the valuse of pga_aggregate_target
    http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams157.htm
    Note:
    Oracle does not recommend using the SORT_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_SIZE is retained for backward compatibility.
    What is the best way to monitor the memory usage for sorting? try v$sort_usage
    or v$tempseg_usage
    col sid_serial for a44
    col size for a22
    col SID_SERIAL for a22
    SELECT b.tablespace,
            ROUND(((b.blocks*p.value)/1024/1024),2)||' MB' "SIZE",
            a.sid||','||a.serial# SID_SERIAL,
            a.username,a.osuser,
            a.program
       FROM sys.v_$session a,
            sys.v_$sort_usage b,
            sys.v_$parameter p
      WHERE p.name  = 'db_block_size'
        AND a.saddr = b.session_addr
    ORDER BY b.blocks;

  • Fetching records in a block(db) for mass processing

    My user interface inputs commit frequency for intermittent commits. We reference this to # of records processed & then issue commit. [whilst processing against millions of records]
    Now, we want to process all records belonging to set of data blocks to avoid contention issues (gc/ other locking issues) & then issue commit.
    So the question is, how do I query records belonging to a particular block OR identify those blocks that hold my data.
    Any pointer is greatly appreciated.
    thanks
    Kiran.

    kkulkarn wrote:
    This is needed for a DW instance wherein we select recordset from a OLTP instance running 4 node RAC. The user then inputs a condition based on which the records are selected.
    We are commiting based on parameters defined by DBA's - the commit frequency. This increases contention especially if the records are stored in contiguous location. Add to this the RAC, the GC traffic is huge.
    So what we want to do is to grab all the records in a particular block & read the whole block & then process to DW. I was looking at a query that can get me the block# involved in this process.
    Could you clarify:
    Is it the OLTP that is on RAC, or the DW, or both ?
    Which type of contention - can you show us the critical wait information - and is this on the OLTP or RAC system, and is it the OLTP or RAC system where the GC traffic is huge ?
    You seem to be asking how you can specify a query in an OLTP system that is going to visit many table blocks - but "pre-sort" the data in some way so that it visits each table block only once, and visits the table blocks in order so that you don't revisit the same table block and run the risk of extra interconnect traffic on the OLTP system. Is this a correct interpretation of your requirement ?
    Does your transfer process do something like:
    counter := 0;
    for r in (select from OLTP system) loop
        insert into DW system values (r.thing....);
        counter := counter + 1;
        if counter = {limit} then
            commit;
            counter := 0;
        end if;
    end loop;
    commit;Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Anchor link only for image in table header for sorting

    Hi,
    I need to implement sorting functionality for datatable.
    for sorting header of the table column will have image along with header text.
    for this i am using <h:commandLink> and <h:graphicImage>.
    But i am getting behaviour as anchor link for both text and image.
    deserved behavior for this is only ofr Image.
    If any one implemented the same ..please help me
    Regards

    Try:
    Sub ClearKeepWNext()
    Dim Tbl As Table, i As Long
    For Each Tbl In ActiveDocument.Tables
      With Tbl
        .Range.ParagraphFormat.KeepWithNext = False
        For i = 1 To .Rows.Count
          With .Rows(i)
            If .HeadingFormat = True Then
              .Range.ParagraphFormat.KeepWithNext = True
            Else
              Exit For
            End If
          End With
        Next
      End With
    Next
    End Sub
    If the tables only have a single heading row, you could instead use:
    Sub ClearKeepWNext()
    Dim Tbl As Table
    For Each Tbl In ActiveDocument.Tables
      With Tbl
        .Range.ParagraphFormat.KeepWithNext = False
        With .Rows(1)
          If .HeadingFormat = True Then
            .AllowBreakAcrossPages = False
          End If
        End With
      End With
    Next
    End Sub
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • What is needed for sorting on two fields in a table control

    Hi Everybody
    I am going to certification in a couple of days. I need some help and was hopeing that you  guys could help.
    What is needed for sorting on two fields in a table control?
         One sorted table and two processing blocks
         Two standard tables and one processing blocks
         Two standard tables and two processing
    Which one is corret??
    //Script

    Hi Kimallan
    I am not sure what is meant by a "processing block". However, it seems the question wants the original table order to be preserved. If so; as far as I understood the problem we need:
    itab_proxy[] = itab_main[] .
    "two standard tables"
    SORT itab_proxy BY field1 field2 .
    If we have a sorted table, then it is always sorted by its keys. So, the question seems to become obsolete for that option.
    Hope I've understood correct...
    Regards
    *--Serdar
    [email protected]

  • Does GROUP BY force oracle go for sorting?

    Version : 10.2
    I usually rewrite all queries with DISTINCT clause to GROUP BY to avoid sorting in the temporary tablespace. But, doesn't GROUP BY queries go for sorting?

    Hi,
    I am on 10.2.0.1
    SQL> alter system flush shared_pool;
    System altered.
    SQL> alter system flush buffer_cache;
    System altered.
    SQL> select deptno from emp group by deptno;
        DEPTNO
            30
            20
            10
    Execution Plan
    Plan hash value: 4067220884
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     3 |     9 |     4  (25)| 00:00:01 |
    |   1 |  HASH GROUP BY     |      |     3 |     9 |     4  (25)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |    42 |     3   (0)| 00:00:01 |
    Statistics
            335  recursive calls
              0  db block gets
             64  consistent gets
             21  physical reads
              0  redo size
            456  bytes sent via SQL*Net to client
            381  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              5  sorts (memory)
              0  sorts (disk)
              3  rows processed
    SQL> alter system flush shared_pool;
    System altered.
    SQL>  alter system flush buffer_cache;
    System altered.
    SQL> select distinct deptno from emp;
        DEPTNO
            30
            20
            10
    Execution Plan
    Plan hash value: 3709190377
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     3 |     9 |     4  (25)| 00:00:01 |
    |   1 |  HASH UNIQUE       |      |     3 |     9 |     4  (25)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |    42 |     3   (0)| 00:00:01 |
    Statistics
            754  recursive calls
              0  db block gets
            145  consistent gets
             31  physical reads
              0  redo size
            456  bytes sent via SQL*Net to client
            381  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
             17  sorts (memory)
              0  sorts (disk)
              3  rows processedhmm,group by does sort but distinct seems to be more expensive w.r.t sorting.

  • Concerning oracle single block io call and os block size!!

    Hi, all
    The block size of my db(10gr2) is 8k, and
    the db is on the raw device file system on a aix machine.
    OS block size is 512k.
    How much block will be read from disk when a single oracle io call occurs?
    Which one is currect, 8K or 512K?
    If the block size for a single io call depends on the os block size (512k),
    I think os block size need to be tuned for oracle block size (8k).
    If we use raw device file system, os level block size has no meaning??
    Thanks in advance.
    Best Regards.

    Hi,
    Please refer to the following oracle doc:
    http://docs.oracle.com/cd/B28359_01/server.111/b32009/appa_aix.htm
    extract from it:
    Setting the Database Block Size
    You can configure Oracle Database block size for better Input-Output throughput. On AIX, you can set the value of the DB_BLOCK_SIZE initialization parameter to between 2 KB and 32 KB, with a default of 4 KB. If Oracle Database is installed on a journaled file system, then the block size should be a multiple of the file system block size (4 KB on JFS, 16 K to 1 MB on GPFS). For databases on raw partitions, Oracle Database block size is a multiple of the operating system physical block size (512 bytes on AIX).
    Thanks and Regards,
    Raj K.

  • Single idoc generation for multiple sales orders

    Hi,
    Pls let me know how do we generate single idoc for multiple sales orders.
    Its not collecting idoc. As we know we can generate an idoc for one sales order correspondingly
    my requirement is to generate single idoc number for multiple sales orders.
    Do we need to write a program.

    Amar,
    To understand take HRMD_A04 as example. Root segment has Maximum 9999999999 defined.
    Segm.type       E1PLOGI
    Minimum number  1
    Maximum number  9999999999
    Parent segment
    Hier.level      2
    This means that this IDOC types has capability to hold multiple HR Master data objects. PFAL program creates this IDOC and it has facility to mention the Objects per process, check selection screen.
    I checked for INVOICE01/02 its not possible there. Hope this clarifies.

  • I purchased Creative Cloud single-app membership for Dreamweaver. Can I download this app on both my desktop and laptop?

    I purchased Creative Cloud single-app membership for Dreamweaver. Can I download this app on both my desktop and laptop?

    Yes, maximum of two activations at any one time.
    Creative Cloud Help | Creative Cloud / Common Questions
    "Can I use the software I download from Creative Cloud on more than one machine?"

  • How to Restrict Single Delivery Date for PO with Multiple Line Items

    Dear Experts,
    How to Restrict Single Delivery Date for PO with Multiple Line Items.
    System needs to through Error Message if User Inputs Different Delivery Dates for PO with Multiple Line Items in ME21N Tcode.
    Can we achive this by Some Enhancement in SAP or Not ???
    If so how to do it.
    Any Inputs is highly appreciated.
    Thanks and Regards,
    Selvakumar. M

    Hi Selvakumar,
    we can resrict the PO to have a single delivery date in all the line items by means of giving a error message or overwiting the delivery date keyed/determined in the line item.
    You can use the BADI -> ME_PROCESS_PO_CUST. In which you need to implement the method PROCESS_SCHEDULE.
    (for technical aid - This method will be called for each and every PO line item, From the imporing parameter im_schedule we can get all the details of current PO line, even we can change the data in the current PO line. )
    Regards,
    Madhu.

  • How to use single sign-on  for BCC and Experience Manager

    Does anyone have experience in implementing single-sign-on for BCC and Endeca Experience manager for business users.

    With the older versions of Endeca commerce stack there is no OOTB support for this. However with Oracle Commerce 11, SSO with BCC and Experience Manager are out of the box. Oracle Commerce 11 is released today.

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

  • How to take a single data point for each trigger pulse ( synchronou​s acquisitio​n).

     hi
              im using the pci-mio-16E1 card, with the IDE VC++, so  im looking for an example to explicate me how to make an synchronous acquisition data using an external timing, so the idea is to acquire (take) a single data point for each trigger pulse  from one  input channel ,and saving  the data in a file .
    now im making a code using the AI_setup and DAQ_op functions, im getting  a speed acquisition (it is the start of acquisition data), and  it is  a synchronous acquisition just for one trigger pulse, and me i looking for an acquisition for each trigger pulse. 
      so to  understand my problem you can see my code :
    iStatus = Timeout_Config(iDevice, lTimeout);
             iRetVal = NIDAQErrorHandler(iStatus, "Timeout_Config", iIgnoreWarning);
       //  configuration and selection of  signal trigger  
             iStatus = Configure_HW_Analog_Trigger(iDevice, ND_ON, iLowValue,iHighValue, ND_ABOVE_HIGH_LEVEL, ND_THE_AI_CHANNEL);
            iRetVal = NIDAQErrorHandler(iStatus, "Configure_HW_Analog_Trigger", iIgnoreWarning);
      iStatus = Select_Signal(iDevice, ND_IN_CONVERT, ND_PFI_2,ND_HIGH_TO_LOW);
             iRetVal = NIDAQErrorHandler(iStatus, "Select_Signal", iIgnoreWarning);
        iStatus = AI_Setup(iDevice, iChannel, iGain);
       iRetVal = NIDAQErrorHandler(iStatus, "AI_Setup", iIgnoreWarning);
       while ((iReadingAvail != 1) && (iStatus == 0)) {
     /* Wait until reading is available. */
             iStatus = AI_Check(iDevice, &iReadingAvail, &iReading);
            iRetVal = NIDAQYield(iYieldON);
           //  Acquire data from a single channel 
        iStatus = DAQ_Op (iDevice, iChannel, iGain, piBuffer, ulCount, dSampRate);
       while ((iDAQstopped != 1) && (iStatus == 0)) {
            iStatus = DAQ_Check(iDevice, &iDAQstopped, &ulRetrieved);
            iRetVal = NIDAQYield(iYieldON);
           iStatus = DAQ_VScale(iDevice, iChannel, iGain, dGainAdjust, dOffset,ulCount, piBuffer, pdVoltBuffer);
          iRetVal = NIDAQErrorHandler(iStatus, "DAQ_VScale",iIgnoreWarning);
       /* Set analog trigger mode back to initial state. */
           iStatus = Configure_HW_Analog_Trigger(iDevice, ND_OFF, iLowValue,iHighValue, ND_ABOVE_HIGH_LEVEL, ND_THE_AI_CHANNEL);
      /* Set PFI line back to initial state. */
           iStatus = Select_Signal(iDevice, ND_IN_START_TRIGGER,ND_AUTOMATIC, ND_DONT_CARE);
              iStatus = DAQ_Clear(iDevice);
     /* Plot acquired data  */
          iRetVal = NIDAQPlotWaveform(pdVoltBuffer,ulCount, WFM_DATA_F64);
    so this is the data acquired -0.900879,-0.900879,-0.900879,-0.900879,-0.900879,​-0.900879,-0.900879,-0.900879 and i think that is a noise because all time i get this data.
    tank you very mutch fo your help

    Hello,
    Please see the responses to this thread at the following post.
    http://forums.ni.com/ni/board/message?board.id=250​&message.id=13686
    Also, please only post one thread per issue.
    Regards,
    Sean C.

  • How to set Blocking Indicator for product specific TransportationLanes?

    Hi All,
    I'm facing a problem while trying to set the blocking indicator for product specific Transportation Lanes-external procurement.
    How can i proceed on the same?
    I've figured out 2 methods for blocking the product specific TLanes.
    1. using /SAPAPO/TR_TL_TRANSFER_BAPI.
    2. using BAPI_TRLSRVAPS_SAVEMULTI.
    I tried using the BAPI - /SAPAPO/TR_TL_TRANSFER_BAPI, which comes inside the DELETE BAPI - BAPI_TRLSRVAPS_DELMULTI. Although I had passed the parameters reg. external procurement, nothing seemed to be happening in the system. There was no blocking indicator - D(locked and flagged for deletion) set against the subjected TLane. In fact, to my amazement, the BAPI didn't return even a single msg. BAPIRETURN internal table after execution was empty.
    Here, I'm passing:
    (IV_LOGQS) TYPE  /SAPAPO/LOGQS
    (IV_LOGSYS) TYPE  LOGSYS
    (IV_CALLER) TYPE  /SAPAPO/MD_CALLER
    (IT_TR) TYPE  /SAPAPO/TR_TTD_TR
    (IT_TR_X) TYPE  /SAPAPO/TR_TTX_TR
    (IT_TRPROD_SRC) TYPE  /SAPAPO/TR_TTD_TRPROD_SRC    and
    (IT_TRPROD_SRC_X) TYPE  /SAPAPO/TR_TTX_TRPROD_SRC
    I haven't tried on the second method yet. Is there any other programming alternative for setting the blocking indicator of a TLane / multiple Tlanes?
    Could anyone pls explain and guide me on a suitable method to be chosen and the process to be followed, parameters to be passed, etc.

    Hi Sanjay,
                    Use the standard BAPI:  BAPI_TRLSRVAPS_SAVEMULTI2 (according to SCM version you are using)
    to update the deletion flag for product specific T-lane, in this BAPI you have to pass the data to EXTERNAL_PROCUREMENT parameter table in which LOCKED_FLG field is there in which you can pass the "D" for deletion or block flag.
    Also you have to pass the same entries in EXTERNAL_PROCUREMENT_X parameter table of this BAPI.
    If any further help required, refer the documentation of BAPI or let me know.
    I hope this will help you to solve the issue.
    Regards,
    Saurabh

Maybe you are looking for

  • Authorization of Organizational elements at user level

    Sir, Is there any way by which I can assign organisational elments like-plant,company code,etc. to user id instead of Role? Thanks & regards, Sachin Taware 9920290697

  • PR Release with respect to HR Org structure.

    Hi , I am having a requirnment where Business needs to Approve PR's based on the HR org struct and $ limit . Users maintained in HR org struct. have specifed roles ( eg. Managers , VP , Directors , CFO's)  & based on the $ limit in PR's they become 

  • Can't import own classes...

    I'm very new to java. I rented a book called Java 2 Grand Cru to learn it on my own. It is based on Java 1.3 but I have 1.4 installed. Now I wanted to write a simple program with a class in an other directory. I added that directory to CLASSPATH so m

  • How Can I Replace An Extracted Audio Track?

    Yup, after I have extracted an audio track from the video track how can I replace it? Dragging & dropping isn't working neither is cutting & pasting. I wasn't able to find any info on this at all. Please don't tell me it's irreversible. AAUUUUUUGHH!!

  • Ipone 4S muting every time it starts up

    Really, really regretting doing the ios6 upgrade.  My iphone 4S is muting every time it starts up and can only be un-muted by a buried option uder General?Accessability.  Anyone know the permanent fix? Thanks in advance. Peter