Explain plan in AWR report?

Is there any way to generate the explain plan in AWR report?Is it possible to generate the explain plan in AWR?
Pandu

Hi,
AWR: Automatic Workload Repository
oracle take every 60 minutes a snapshot of statistic in memory and after analysed by ADDM ( automatic database diagnostic monitor) default option, but you can change every 10 minutes or ...
http://www.oracle-base.com/articles/10g/AutomaticWorkloadRepository10g.php
http://www.datadisk.co.uk/html_docs/oracle/addm.htm
http://www.rampant-books.com/t_andert_38_addm_awr_db.htm
http://www.remote-dba.net/oracle_10g_new_features/db_management.htm
http://www.sc.ehu.es/siwebso/KZCC/Oracle_10g_Documentacion/server.101/b10752/diagnsis.htm

Similar Messages

  • Does bigger explain plan in TKPROF output indicate something wrong with SQL

    We were tracing some database sessions.
    Using TKPROF we were able to read the trace file.
    we have noticed that some of the SQL ( 1-2 lines SQL statements) were showing up atleast
    150 lines of explain plan.
    So we realized that the sql statements are badly written.
    Based on that above can we come into the following conclusion:
    - for 1-2 lines of SQL Statement if there is 100+ lines of explain plan in TKPROF report, it indicates the SQL statement
    is wrongly written ?

    johnpau2013 wrote:
    We were tracing some database sessions.
    Using TKPROF we were able to read the trace file.
    we have noticed that some of the SQL ( 1-2 lines SQL statements) were showing up atleast
    150 lines of explain plan.
    So we realized that the sql statements are badly written.
    Based on that above can we come into the following conclusion:
    - for 1-2 lines of SQL Statement if there is 100+ lines of explain plan in TKPROF report, it indicates the SQL statement
    is wrongly written ?The only rule that is always true for tuning SQL, is that NO rule is ALWAYS true for every SQL statement &
    every data distribution.
    it depends
    post actual example, so we can see what you see.

  • Explain plan, Oracle 10g, AWR, ASH etc etc

    Hi,
    I'm obviously not searching on the right terms but using one of the following : AWR, ASH, ADDM, isn't it possible to get the explain plan for a certain SQL_ID after the fact?
    I was sure that using ash and specifying the SQL_ID that one could have the explain plan, but I don't have it in the ASH Report. We don't have Grid in place, only snapshots taken every hour.
    cheers.

    Thankyou both for your very quick replies, just what I needed.
    Edited by: mattyb on Mar 25, 2009 2:06 PM

  • Is there any tool to analyze explain plan and gives the report

    Hi All,
    Is there any tool/scripts to analyze explain plan from plan_table and gives the output report
    Thanks,
    Sankar

    Hi Jaffar,
    Thank you!!!
    The below query will generate the execution tree:
    SELECT OPERATION,
         OPTIONS OPTIONS,
    DECODE(TO_CHAR(ID),'0','---',OBJECT_NAME) OBJECT_NAME,
         (ID ||'-'|| NVL(PARENT_ID,0) ||'-'|| NVL(POSITION,0) ) "ID**PARENT_ID**EXECUTION_STEP",
         SUBSTR(OPTIMIZER,1,8) OPT
    FROM PLAN_TABLE
    START WITH ID = 0
    AND STATEMENT_ID = 'Q1'
    CONNECT BY PRIOR ID = PARENT_ID
    AND STATEMENT_ID = 'Q1'
    Thanks,
    Sankar

  • Reg:Tkprof, awr, explain plan, autotrace analysis

    hi friends.
    can any one give description about below subject..........
    Tkprof,
    awr,
    explain plan,
    autotrace analysis
    if possible kindly mentioned some example for each OR provide some to read.
    regards,
    Rajnish

    They're all described in the Oracle Documentation, example:
    http://www.oracle.com/pls/db112/search?remark=quick_search&word=AWR&partno=
    Look in the [Performance Tuning Guide|http://download.oracle.com/docs/cd/E11882_01/server.112/e10821/toc.htm] for examples/exaplanations.
    Randolf Geist sums it all up very nice here: http://oracle-randolf.blogspot.com/2009/02/basic-sql-statement-performance.html
    More examples can be found on http://asktom.oracle.com
    and on this forum by simply doing a search.

  • Enq: TX - row lock contention in AWR reports

    Dears,
    One of my friends asked me to give him a help on analyzing a performance problem they are experimenting from time to time. First of all I am sorry to tell you that he didn’t gave me a lot of information. I will share with you all what I have been sent and would like to have your precious advice according to the available information.
    It is a third party software installed on oracle data base 10.2.0.4.0. He said that from time to time the application hangs. He sends me an AWR reports supplied by the local DBA. Unfortunately, the local DBA send only the AWR information he thinks are most important to be looked at (he did not include the load profile and the instance efficiency Percentages part in this AWR for example).
    Here below is the available information I can share with you
                                                                             Snap time                                       sessions        cursors/session
    Begin Snap        09-mars-11 08:00:03              31                     6.5
    End Snap          09-mars-11 08:39:49              41                     9.8
    Elapsed           39.77 (mins)
    DB Time           536.65(mins)
    Top 5 Timed Events
    Event                          Waits   Time(s)    Avg Wait(ms)    % Total Call Time     Wait Class
    enq: TX - row lock contention  8,468    25,344       2,993            78.7             Application
    read by other session          714,628   4,604         6               14.3             User I/O
    db file sequential read        323,264  1,977         6               6.1              User I/O
    CPU time                                 171                          .5
    db file scattered read          1,885   49           26               .2               User I/OThe AWR reports presents also the following SQL statement as the top SQL of its ‘’SQL ordered by Elapsed Time’’ part
    UPDATE xxxx.table1
       SET col1 = :1,
           col2 = :2,
           col3 = :3,
           col4 = :4,
    WHERE ID = :13
    AND colx  = :14;And the following sql at its “SQL ordered by Reads’ part
    SELECT t1.*
    FROM xxxx.table1 t1
      LEFT OUTER JOIN xxxx.table2 t2
           ON t1.id = t2.id
      LEFT OUTER JOIN xxxx.table3 t3
           ON t1.id = t3.id
      LEFT OUTER JOIN xxxx.table4 t4
           ON t1.id = t4.id
    WHERE t1.col1 = :1
    AND   t1.col2 IN (:2,:3, :4);And finally in the Segments by Row Lock Waits part of the AWR I have this:
    Owner      tablespace name    object name   object type   row lock waits   %of capture
    xxxx          xxxx          table1         TABLE          54       100    There are no bitmap indexes on this OLTP data base. There are no unindexed foreign keys and it seems that there are no selects done over a dblink.
    I am waiting to have the table table1 script and its indexes
    Given those information I think that the locking problem is due to this update on table table1 which is not followed immediately by a commit or a rollback. But, instead, several selects that might be taking a long time are done before reaching the commit that ends the lock on the table table1
    What do you think about the possible reason of this lock?
    Thanks in advance
    Mohamed Houri

    Dears,
    I did get the suspected query and asked for its several explain plans thanks to the dbms_xplan.display_awr. The most important thing to point out is that the last where clause of this query seems to be dynamically filled-up
    SELECT t1.*
    FROM xxxx.table1 t1
      LEFT OUTER JOIN xxxx.table2 t2
           ON t1.id = t2.id
      LEFT OUTER JOIN xxxx.table3 t3
           ON t1.id = t3.id
      LEFT OUTER JOIN xxxx.table4 t4
           ON t1.id = t4.id
    WHERE t1.col1 = :1
    AND   t1.col2 in (:2 , :3 , :4 , :5 , :6 , :7 , :8 )
    | Id  | Operation                      | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |             
    |   0 | SELECT STATEMENT               |                         |       |       |    14 (100)|          |             
    |   1 |  NESTED LOOPS OUTER            |                         |     1 |   280 |    14   (0)| 00:00:01 |             
    |   2 |   NESTED LOOPS OUTER           |                         |     1 |   226 |     9   (0)| 00:00:01 |             
    |   3 |    NESTED LOOPS OUTER          |                         |     1 |   216 |     6   (0)| 00:00:01 |             
    |   4 |     TABLE ACCESS BY INDEX ROWID| TABLE1                  |     1 |   141 |     4   (0)| 00:00:01 |             
    |   5 |      INDEX RANGE SCAN          | SYS_C0010893            |     1 |       |     3   (0)| 00:00:01 |             
    |   6 |     TABLE ACCESS BY INDEX ROWID| TABLE2                  |     1 |    75 |     2   (0)| 00:00:01 |             
    |   7 |      INDEX UNIQUE SCAN         | SYS_C0010774            |     1 |       |     1   (0)| 00:00:01 |             
    |   8 |    INDEX RANGE SCAN            | SYS_C0010896            |     3 |    30 |     3   (0)| 00:00:01 |             
    |   9 |   TABLE ACCESS BY INDEX ROWID  | TABLE3                  |    11 |   594 |     5   (0)| 00:00:01 |             
    |  10 |    INDEX RANGE SCAN            | SYS_C0010910            |    11 |       |     3   (0)| 00:00:01 |             
    SELECT t1.*
    FROM xxxx.table1 t1
      LEFT OUTER JOIN xxxx.table2 t2
           ON t1.id = t2.id
      LEFT OUTER JOIN xxxx.table3 t3
           ON t1.id = t3.id
      LEFT OUTER JOIN xxxx.table4 t4
           ON t1.id = t4.id
    WHERE t1.col1 = :1
    AND   t1.col2 in (:2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 ,                       
    :17 , :18 , :19 , :20 , :21 , :22 , :23 , :24 , :25 , :26 , :27 , :28 , :29 , :30 , :31 , :32 ,                        
    :33 , :34 , :35 , :36 , :37 , :38 , :39 , :40 , :41 , :42 , :43 , :44 , :45 , :46 , :47 , :48 ,                        
    :251 , :252 , :253 , :254 , :255 , :256 , :257 )  ;
    | Id  | Operation                       | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |            
    |   0 | SELECT STATEMENT                |                         |       |       |  5943 (100)|          |            
    |   1 |  NESTED LOOPS OUTER             |                         |  9210 |  2536K|  5943   (1)| 00:01:12 |            
    |   2 |   NESTED LOOPS OUTER            |                         |   885 |   195K|  1784   (0)| 00:00:22 |            
    |   3 |    NESTED LOOPS OUTER           |                         |   255 | 55080 |  1019   (0)| 00:00:13 |            
    |   4 |     INLIST ITERATOR             |                         |       |       |            |          |            
    |   5 |      TABLE ACCESS BY INDEX ROWID| TABLE1                  |   255 | 35955 |   509   (0)| 00:00:07 |            
    |   6 |       INDEX UNIQUE SCAN         | SYS_C0010893            |   255 |       |   258   (0)| 00:00:04 |            
    |   7 |     TABLE ACCESS BY INDEX ROWID | TABLE2                  |     1 |    75 |     2   (0)| 00:00:01 |            
    |   8 |      INDEX UNIQUE SCAN          | SYS_C0010774            |     1 |       |     1   (0)| 00:00:01 |            
    |   9 |    INDEX RANGE SCAN             | SYS_C0010896            |     3 |    30 |     3   (0)| 00:00:01 |            
    |  10 |   TABLE ACCESS BY INDEX ROWID   | TABLE3                  |    10 |   560 |     5   (0)| 00:00:01 |            
    |  11 |    INDEX RANGE SCAN             | FK_TABLE3               |    10 |       |     3   (0)| 00:00:01 |            
    -----------------------------------------------------------------------------------------------------------   Suddenly there is an INLIST ITERATOR that pops up and which seems to be started 255 times and the ‘quick’ query which in normal situation (small in list) executes in less than 1 second starts now taking more than 1 minute to complete.
    As far as it is a third party software, they can’t change the query.
    Do you have any idea on how to solve this problem?
    Here below are the optimizer parameters
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.4
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUEThanks in advance
    Mohamed Houri

  • Oracle rownum wrong explain plan

    SCOTT@oracle10g>create table t as select * from dba_objects;
    Table created.
    SCOTT@oracle10g>alter table t modify CREATED date not null;
    Table altered.
    SCOTT@oracle10g>insert into t select * from t;
    50416 rows created.
    SCOTT@oracle10g>insert into t select * from t;
    100832 rows created.
    SCOTT@oracle10g>insert into t select * from t;
    201664 rows created.
    SCOTT@oracle10g>commit;
    Commit complete.
    SCOTT@oracle10g>create index t_created on t(created) nologging;
    Index created.
    SCOTT@oracle10g>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SCOTT@oracle10g>set autot trace
    SCOTT@oracle10g>select t.owner,t.object_name   from
      2  (select rid from (
      3  select rownum rn,rid from
      4  (select rowid rid from t order by created)
      5  where rownum<100035)
      6  where rn>100000) h, t
      7  where t.rowid=h.rid;
    34 rows selected.
    Execution Plan
    Plan hash value: 3449471415
    | Id  | Operation           | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| T
    ime     |
    |   0 | SELECT STATEMENT    |           |   100K|    11M|       |  4776   (2)| 0
    0:00:58 |
    |*  1 |  HASH JOIN          |           |   100K|    11M|  3616K|  4776   (2)| 0
    0:00:58 |
    |*  2 |   VIEW              |           |   100K|  2442K|       |  1116   (2)| 0
    0:00:14 |
    |*  3 |    COUNT STOPKEY    |           |       |       |       |            |
            |
    |   4 |     VIEW            |           |   440K|  5157K|       |  1116   (2)| 0
    0:00:14 |
    |   5 |      INDEX FULL SCAN| T_CREATED |   440K|  9024K|       |  1116   (2)| 0
    0:00:14 |
    |   6 |   TABLE ACCESS FULL | T         |   440K|    39M|       |  1237   (2)| 0
    0:00:15 |
    Predicate Information (identified by operation id):
       1 - access("T".ROWID="RID")
       2 - filter("RN">100000)
       3 - filter(ROWNUM<100035)
    Note
       - dynamic sampling used for this statement
    Statistics
              0  recursive calls
              0  db block gets
           5814  consistent gets
              0  physical reads
              0  redo size
           1588  bytes sent via SQL*Net to client
            422  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             34  rows processed   
    here ,oracle don't choose the best explain plan ,I think becase  oracle compute cadinality 100k ,so it don't choose nest loop,why oracle can't compute cardinality 35 here ??
    |*  2 |   VIEW              |           |   100K|  2442K|       |  1116   (2)| 0
    SCOTT@oracle10g>select  t.owner,t.object_name   from t where rowid in
      2      (select rid from (
      3      select rownum rn,rid from
      4      (select rowid rid from t order by created)
      5      where rownum<100035)
      6      where rn>100000)
      7 
    SCOTT@oracle10g>/
    34 rows selected.
    Execution Plan
    Plan hash value: 1566335206
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| T
    ime     |
    |   0 | SELECT STATEMENT            |           |     1 |   107 |  1586   (2)| 0
    0:00:20 |
    |   1 |  NESTED LOOPS               |           |     1 |   107 |  1586   (2)| 0
    0:00:20 |
    |   2 |   VIEW                      | VW_NSO_1  |   100K|  1172K|  1116   (2)| 0
    0:00:14 |
    |   3 |    HASH UNIQUE              |           |     1 |  2442K|            |
            |
    |*  4 |     VIEW                    |           |   100K|  2442K|  1116   (2)| 0
    0:00:14 |
    |*  5 |      COUNT STOPKEY          |           |       |       |            |
            |
    |   6 |       VIEW                  |           |   440K|  5157K|  1116   (2)| 0
    0:00:14 |
    |   7 |        INDEX FULL SCAN      | T_CREATED |   440K|  9024K|  1116   (2)| 0
    0:00:14 |
    |   8 |   TABLE ACCESS BY USER ROWID| T         |     1 |    95 |     1   (0)| 0
    0:00:01 |
    Predicate Information (identified by operation id):
       4 - filter("RN">100000)
       5 - filter(ROWNUM<100035)
    Note
       - dynamic sampling used for this statement
    Statistics
              0  recursive calls
              0  db block gets
            301  consistent gets
              0  physical reads
              0  redo size
           1896  bytes sent via SQL*Net to client
            422  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             34  rows processed
    SCOTT@oracle10g>select /*+ordered use_nl(t)*/ t.owner,t.object_name   from
      2  (select rid from (
      3  select rownum rn,rid from
      4  (select rowid rid from t order by created)
      5  where rownum<100035)
      6  where rn>100000) h, t
      7  where t.rowid=h.rid;
    34 rows selected.
    Execution Plan
    Plan hash value: 3976541160
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| T
    ime     |
    |   0 | SELECT STATEMENT            |           |   100K|    11M|   101K  (1)| 0
    0:20:16 |
    |   1 |  NESTED LOOPS               |           |   100K|    11M|   101K  (1)| 0
    0:20:16 |
    |*  2 |   VIEW                      |           |   100K|  2442K|  1116   (2)| 0
    0:00:14 |
    |*  3 |    COUNT STOPKEY            |           |       |       |            |
            |
    |   4 |     VIEW                    |           |   440K|  5157K|  1116   (2)| 0
    0:00:14 |
    |   5 |      INDEX FULL SCAN        | T_CREATED |   440K|  9024K|  1116   (2)| 0
    0:00:14 |
    |   6 |   TABLE ACCESS BY USER ROWID| T         |     1 |    95 |     1   (0)| 0
    0:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("RN">100000)
       3 - filter(ROWNUM<100035)
    Note
       - dynamic sampling used for this statement
    Statistics
              0  recursive calls
              0  db block gets
            304  consistent gets
              0  physical reads
              0  redo size
           1588  bytes sent via SQL*Net to client
            422  bytes received via SQL*Net from client
              4  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             34  rows processed  

    jinyu wrote:
    Thanks for your great reply and posting ,could you tell me why subquery has the least cost here ??
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 107 | 1586 (2)| 00:00:20 |
    | 1 | NESTED LOOPS | | 1 | 107 | 1586 (2)| 00:00:20 |
    | 2 | VIEW | VW_NSO_1 | 100K| 1172K| 1116 (2)| 00:00:14 |
    | 3 | HASH UNIQUE | | 1 | 2442K| | |
    |* 4 | VIEW | | 100K| 2442K| 1116 (2)| 00:00:14 |
    |* 5 | COUNT STOPKEY | | | | | |
    | 6 | VIEW | | 440K| 5157K| 1116 (2)| 00:00:14 |
    | 7 | INDEX FULL SCAN | T_CREATED | 440K| 9024K| 1116 (2)| 00:00:14 |
    | 8 | TABLE ACCESS BY USER ROWID| T | 1 | 95 | 1 (0)| 00:00:01 |
    ----------------------------------------------------------------------------------------->
    You'll notice that as a result of a "driving" IN subquery Oracle has done a hash unique operation (line 3) on the rowids produced by the subquery. At this point the optimizer has lost all knowledge of the number of distinct values for that data column in the subquery and come back with the cardinality of one. The re-appearance of 100K as the cardinality in line 2 is an error, but I don't think the optimizer has used that value in later arithmetic.
    Given the cardinality of one, the obvious path into the T table is a nested loop.
    The same type of probelm appears when you use the table() operator in joins - you can use the cardinality() hint to try an tell Oracle how many rows the table() will produce, but that doesn't tell it how many distinct values there are in join columns - and that's an important detail when you work out the join cardinality and method).
    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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Statspack with explain plan.

    The goal is to obtain the overall system statistics and explain plans for the entire system.
    1. The only tool that I can think of is "StatsPack".
    2. With AWR there are 2 issues:-
    a. It is not free
    b. It does not give Explain plan output.
    3. We can use 10046 / 10053 Trace's however it wont give you as comphrehensive an output as statspack, you would also have to enable trace for each individual application while its running, grab the trace file, look at the report.
    4. We can also use outlines to store the explain plan this was primarily for Oracle version 10g.
    5. The last option we have is sql managed baselines. This is good , however it does not tell me conclusively how my system was executing a sql lets say 10 days back. It wont accept the new sql unless we promote it. Still there is no guarantee that the underlying sql plan will not change.
    So far statspack with level 6 appears to be the only solution.

    Personally I'd spend the money and get AWR.
    The problem with StatsPack is that when you run it, after an issue, it is too late to capture anything of value. With AWR snapshots are taken as often as you wish, 24 hours a day, and then when someone tells you there was a problem at 4:15 in the morning ... you have something to work with.

  • SQL Query Details in AWR Report

    Hi
    In AWR Report i found that there are few SQL queries that have full table scans
    how can we drill about this and find which table have full scan
    yes with Explain plan we can do this but is there any other way in Oracle 11g
    please let me know
    CHeers

    Saggy wrote:
    In AWR Report i found that there are few SQL queries that have full table scans
    how can we drill about this and find which table have full scan
    yes with Explain plan we can do this but is there any other way in Oracle 11g
    please let me know
    What, exactly, are you looking at in the AWR report that allows you to decide that some SQL statements are doing full tablescans but, at the same time, doesn't show you which tables are being scanned ?
    If the statement is visible in the "SQL ordered by ... " sections of the report then the execution plans and workloed for the statement is also in the AWR. You can access it either from Enterprise Manager, or by running the $ORACLE_HOME/rdbms/admin/awrsqrpt.sql report.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Author: <b><em>Oracle Core</em></b>

  • Help in Analyzing AWR Report.....

    We have faced a performance issue in particular two programs which usually takes only seconds to run (it ran 0.8 and 0.6 sec respectively last month). But it took 2 and 1.4 hrs respectively and when took the AWR report for the run period I could see all looks fine in the report, as we don't have an option to re-run it again till next month end we would like to figure out the cause for the same.
    The explain plan for that particular statement looks fine and it gets completed with in seconds. The only doubt I have is we see "CPU Time" in the Top 5 times events and it consumed most of time. Please help me in finding is the normal scenario or not.
    Event Waits Time(s) Avg Wait(ms) % Total Call Time Wait Class
    CPU time 46,585 97.4
    db file sequential read 1,082,128 859 1 1.8 User I/O
    db file scattered read 540,320 667 1 1.4 User I/O
    log file parallel write 21,817 79 4 .2 System I/O
    db file parallel read 14,111 37 3 .1 User I/O
    Thanks,
    Jay
    +65-81620312

    user13338899 wrote:
    Mohammad,
    Appreciate the update. Please find below the following details,
    SQL> column NAMESPACE form a9;
    SQL> /
    VERSION BUNDLE_SER NAMESPACE ACTION ACTION_TIME ID
    10.2.0.5 PSU SERVER APPLY 26-APR-11 03.01.16.118430 PM 3
    SQL>
    $ uname -a
    SunOS DSOFSAOS01 5.10 Generic_142909-17 sun4u sparc SUNW,SPARC-Enterprise
    $ sqlplus '/ as sysdba'
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Jul 18 11:15:17 2011
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE 10.2.0.5.0 Production
    TNS for Solaris: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    $ opatch lsinv -bugs_fixed | grep PSU
    9952230 11724962 Tue Apr 26 14:53:15 MYT 2011 DATABASE PSU 10.2.0.5.1 (INCLUDES CPUOCT2010)
    10248542 11724962 Tue Apr 26 14:53:15 MYT 2011 DATABASE PSU 10.2.0.5.2 (INCLUDES CPUJAN2011)
    11724962 11724962 Tue Apr 26 14:53:15 MYT 2011 DATABASE PSU 10.2.0.5.3 (INCLUDES CPUAPR2011)
    $
    $ vmstat
    kthr memory page disk faults cpu
    r b w swap free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id
    0 0 0 16622560 5455776 29 14 127 0 0 0 0 0 19 8 16 604 3281 402 0 0 100
    $
    The only thing I would like to know is we faced an performance issue with two programs which took so long to run than usual, as we do not have an option to re-run and could not find any issues in the awr apart from the particular sql took long time to run, what could be the possible causes for a sql behaving badly only at a certain time.
    If we run the same sql now, it gets completed in seconds. Also how to calculate the CPU used in that partuclar period?
    Thanks,
    Jay
    the particular sql took long time to run,does this SQL utilize bind variable & therefore subject to bind variable peeking?

  • How to improve the query performance or tune query from Explain Plan

    Hi
    The following is my explain plan for sql query. (The plan is generated by Toad v9.7). How to fix the query?
    SELECT STATEMENT ALL_ROWSCost: 4,160 Bytes: 25,296 Cardinality: 204                                         
         8 NESTED LOOPS Cost: 3 Bytes: 54 Cardinality: 1                                    
              5 NESTED LOOPS Cost: 2 Bytes: 23 Cardinality: 1                               
                   2 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 13 Cardinality: 1                          
                        1 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                     
                   4 TABLE ACCESS BY INDEX ROWID TABLE AR.HZ_CUST_ACCOUNTS Cost: 1 Bytes: 10 Cardinality: 1                          
                        3 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.HZ_CUST_ACCOUNTS_U1 Cost: 1 Cardinality: 1                     
              7 TABLE ACCESS BY INDEX ROWID TABLE AR.HZ_PARTIES Cost: 1 Bytes: 31 Cardinality: 1                               
                   6 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.HZ_PARTIES_U1 Cost: 1 Cardinality: 1                          
         10 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                                    
              9 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                               
         15 NESTED LOOPS Cost: 2 Bytes: 29 Cardinality: 1                                    
              12 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                               
                   11 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                          
              14 TABLE ACCESS BY INDEX ROWID TABLE ONT.OE_ORDER_HEADERS_ALL Cost: 1 Bytes: 17 Cardinality: 1                               
                   13 INDEX RANGE SCAN INDEX (UNIQUE) ONT.OE_ORDER_HEADERS_U2 Cost: 1 Cardinality: 1                          
         21 FILTER                                    
              16 TABLE ACCESS FULL TABLE ONT.OE_TRANSACTION_TYPES_TL Cost: 2 Bytes: 1,127 Cardinality: 49                               
              20 NESTED LOOPS Cost: 2 Bytes: 21 Cardinality: 1                               
                   18 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                          
                        17 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                     
                   19 INDEX RANGE SCAN INDEX (UNIQUE) ONT.OE_ORDER_HEADERS_U2 Cost: 1 Bytes: 9 Cardinality: 1                          
         23 TABLE ACCESS BY INDEX ROWID TABLE AR.RA_CUSTOMER_TRX_ALL Cost: 1 Bytes: 12 Cardinality: 1                                    
              22 INDEX UNIQUE SCAN INDEX (UNIQUE) AR.RA_CUSTOMER_TRX_U1 Cost: 1 Cardinality: 1                               
         45 NESTED LOOPS Cost: 4,160 Bytes: 25,296 Cardinality: 204                                    
              42 NESTED LOOPS Cost: 4,150 Bytes: 23,052 Cardinality: 204                               
                   38 NESTED LOOPS Cost: 4,140 Bytes: 19,992 Cardinality: 204                          
                        34 NESTED LOOPS Cost: 4,094 Bytes: 75,850 Cardinality: 925                     
                             30 NESTED LOOPS Cost: 3,909 Bytes: 210,843 Cardinality: 3,699                
                                  26 PARTITION LIST ALL Cost: 2,436 Bytes: 338,491 Cardinality: 14,717 Partition #: 29 Partitions accessed #1 - #18          
                                       25 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_AE_HEADERS Cost: 2,436 Bytes: 338,491 Cardinality: 14,717 Partition #: 29 Partitions accessed #1 - #18     
                                            24 INDEX SKIP SCAN INDEX XLA.XLA_AE_HEADERS_N1 Cost: 264 Cardinality: 1,398,115 Partition #: 29 Partitions accessed #1 - #18
                                  29 PARTITION LIST ITERATOR Cost: 1 Bytes: 34 Cardinality: 1 Partition #: 32           
                                       28 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_AE_LINES Cost: 1 Bytes: 34 Cardinality: 1 Partition #: 32      
                                            27 INDEX RANGE SCAN INDEX (UNIQUE) XLA.XLA_AE_LINES_U1 Cost: 1 Cardinality: 1 Partition #: 32
                             33 PARTITION LIST ITERATOR Cost: 1 Bytes: 25 Cardinality: 1 Partition #: 35                
                                  32 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_DISTRIBUTION_LINKS Cost: 1 Bytes: 25 Cardinality: 1 Partition #: 35           
                                       31 INDEX RANGE SCAN INDEX XLA.XLA_DISTRIBUTION_LINKS_N3 Cost: 1 Cardinality: 1 Partition #: 35      
                        37 PARTITION LIST SINGLE Cost: 1 Bytes: 16 Cardinality: 1 Partition #: 38                     
                             36 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_EVENTS Cost: 1 Bytes: 16 Cardinality: 1 Partition #: 39 Partitions accessed #2               
                                  35 INDEX UNIQUE SCAN INDEX (UNIQUE) XLA.XLA_EVENTS_U1 Cost: 1 Cardinality: 1 Partition #: 40 Partitions accessed #2          
                   41 PARTITION LIST SINGLE Cost: 1 Bytes: 15 Cardinality: 1 Partition #: 41                          
                        40 TABLE ACCESS BY LOCAL INDEX ROWID TABLE XLA.XLA_TRANSACTION_ENTITIES Cost: 1 Bytes: 15 Cardinality: 1 Partition #: 42 Partitions accessed #2                    
                             39 INDEX UNIQUE SCAN INDEX (UNIQUE) XLA.XLA_TRANSACTION_ENTITIES_U1 Cost: 1 Cardinality: 1 Partition #: 43 Partitions accessed #2               
              44 TABLE ACCESS BY INDEX ROWID TABLE GL.GL_CODE_COMBINATIONS Cost: 1 Bytes: 11 Cardinality: 1                               
                   43 INDEX UNIQUE SCAN INDEX (UNIQUE) GL.GL_CODE_COMBINATIONS_U1 Cost: 1 Cardinality: 1

    damorgan wrote:
    Tuning is NOT about reducing the cost of i/o.
    i/o is only one of many contributors to cost and only one of many contributors to waits.
    Any time you would like to explore this further run this code:
    SELECT 1 FROM dual
    WHERE regexp_like(' ','^*[ ]*a');but not on a production box because you are going to experience an extreme tuning event with zero i/o.
    And when I say "extreme" I mean "EXTREME!"
    You've been warned.I think you just need a faster server.
    SQL> set autotrace traceonly statistics
    SQL> set timing on
    SQL> select 1 from dual
      2  where
      3  regexp_like   (' ','^*[ ]*a');
    no rows selected
    Elapsed: 00:00:00.00
    Statistics
              1  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
            243  bytes sent via SQL*Net to client
            349  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              0  rows processedRepeated from an Oracle 10.2.0.x instance:
    SQL> SELECT DISTINCT SID FROM V$MYSTAT;
           SID
           310
    SQL> ALTER SESSION SET EVENTS '10053 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    Session altered.
    SQL> select 1 from dual
      2  where
      3  regexp_like   (' ','^*[ ]*a');The session is hung. Wait a little while and connect to the database using a different session:
    COLUMN STAT_NAME FORMAT A35 TRU
    SET PAGESIZE 200
    SELECT
      STAT_NAME,
      VALUE
    FROM
      V$SESS_TIME_MODEL
    WHERE
      SID=310;
    STAT_NAME                                VALUE
    DB time                                   9247
    DB CPU                                    9247
    background elapsed time                      0
    background cpu time                          0
    sequence load elapsed time                   0
    parse time elapsed                        6374
    hard parse elapsed time                   5997
    sql execute elapsed time                  2939
    connection management call elapsed        1660
    failed parse elapsed time                    0
    failed parse (out of shared memory)          0
    hard parse (sharing criteria) elaps          0
    hard parse (bind mismatch) elapsed           0
    PL/SQL execution elapsed time               95
    inbound PL/SQL rpc elapsed time              0
    PL/SQL compilation elapsed time              0
    Java execution elapsed time                  0
    repeated bind elapsed time                  48
    RMAN cpu time (backup/restore)               0Seems to be using a bit of time for the hard parse (hard parse elapsed time). Wait a little while, then re-execute the query:
    STAT_NAME                                VALUE
    DB time                                   9247
    DB CPU                                    9247
    background elapsed time                      0
    background cpu time                          0
    sequence load elapsed time                   0
    parse time elapsed                        6374
    hard parse elapsed time                   5997
    sql execute elapsed time                  2939
    connection management call elapsed        1660
    failed parse elapsed time                    0
    failed parse (out of shared memory)          0
    hard parse (sharing criteria) elaps          0
    hard parse (bind mismatch) elapsed           0
    PL/SQL execution elapsed time               95
    inbound PL/SQL rpc elapsed time              0
    PL/SQL compilation elapsed time              0
    Java execution elapsed time                  0
    repeated bind elapsed time                  48
    RMAN cpu time (backup/restore)               0The session is not reporting additional CPU usage or parse time.
    Let's check one of the session's statistics:
    SELECT
      SS.VALUE
    FROM
      V$SESSTAT SS,
      V$STATNAME SN
    WHERE
      SN.NAME='consistent gets'
      AND SN.STATISTIC#=SS.STATISTIC#
      AND SS.SID=310;
         VALUE
           163Not many consistent gets after 20+ minutes.
    Let's take a look at the plan:
    SQL> SELECT SQL_ID,CHILD_NUMBER FROM V$SQL WHERE SQL_TEXT LIKE 'select 1 from du
    al%';
    SQL_ID        CHILD_NUMBER
    04mpgrzhsv72w            0
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('04mpgrzhsv72w',0,'TYPICAL'))
    select 1 from dual where regexp_like   (' ','^*[ ]*a')
    NOTE: cannot fetch plan for SQL_ID: 04mpgrzhsv72w, CHILD_NUMBER: 0
          Please verify value of SQL_ID and CHILD_NUMBER;
          It could also be that the plan is no longer in cursor cache (check v$sql_p
    lan)No plan...
    Let's take a look at the 10053 trace file:
    Registered qb: SEL$1 0x19157f38 (PARSER)
      signature (): qb_name=SEL$1 nbfros=1 flg=0
        fro(0): flg=4 objn=258 hint_alias="DUAL"@"SEL$1"
    Predicate Move-Around (PM)
    PM: Considering predicate move-around in SEL$1 (#0).
    PM:   Checking validity of predicate move-around in SEL$1 (#0).
    CBQT: Validity checks failed for 7uqx4guu04x3g.
    CVM: Considering view merge in query block SEL$1 (#0)
    CBQT: Validity checks failed for 7uqx4guu04x3g.
    Subquery Unnest
    SU: Considering subquery unnesting in query block SEL$1 (#0)
    Set-Join Conversion (SJC)
    SJC: Considering set-join conversion in SEL$1 (#0).
    Predicate Move-Around (PM)
    PM: Considering predicate move-around in SEL$1 (#0).
    PM:   Checking validity of predicate move-around in SEL$1 (#0).
    PM:     PM bypassed: Outer query contains no views.
    FPD: Considering simple filter push in SEL$1 (#0)
    FPD:   Current where clause predicates in SEL$1 (#0) :
              REGEXP_LIKE (' ','^*[ ]*a')
    kkogcp: try to generate transitive predicate from check constraints for SEL$1 (#0)
    predicates with check contraints:  REGEXP_LIKE (' ','^*[ ]*a')
    after transitive predicate generation:  REGEXP_LIKE (' ','^*[ ]*a')
    finally:  REGEXP_LIKE (' ','^*[ ]*a')
    apadrv-start: call(in-use=592, alloc=16344), compile(in-use=37448, alloc=42256)
    kkoqbc-start
                : call(in-use=592, alloc=16344), compile(in-use=38336, alloc=42256)
    kkoqbc-subheap (create addr=000000001915C238)Looks like the query never had a chance to start executing - it is still parsing after 20 minutes.
    I am not sure that this is a good example - the query either executes very fast, or never has a chance to start executing. But, it might still make your point physical I/O is not always the problem when performance problems are experienced.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • AWR Report - no data!!

    Oracle Version: 11.1.0.7 64x
    OS Version: Windows 2008 Server 64x
    Hi There,
    We're just trying to generate a awr report for one of our databases and the report is coming out with no data.
    statistics_level parameter is set to "TYPICAL"; any idea to what's going on please?
    Thanks
    SQL>
    SQL> @?/rdbms/admin/awrrpt.sql
    Current Instance
    ~~~~~~~~~~~~~~~~
       DB Id    DB Name      Inst Num Instance
    1391811405 WEBTST              1 webtst
    Specify the Report Type
    ~~~~~~~~~~~~~~~~~~~~~~~
    Would you like an HTML report, or a plain text report?
    Enter 'html' for an HTML report, or 'text' for plain text
    Defaults to 'html'
    Enter value for report_type: text
    Type Specified:  text
    Instances in this Workload Repository schema
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       DB Id     Inst Num DB Name      Instance     Host
    * 1391811405        1 WEBTST       webtst       WEBDBTST
    Using 1391811405 for database Id
    Using          1 for instance number
    Specify the number of days of snapshots to choose from
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Entering the number of days (n) will result in the most recent
    (n) days of snapshots being listed.  Pressing <return> without
    specifying a number lists all completed snapshots.
    Enter value for num_days: 1
    Listing the last day's Completed Snapshots
                                                            Snap
    Instance     DB Name        Snap Id    Snap Started    Level
    webtst       WEBTST           43973 12 May 2011 00:00      1
                                  43974 12 May 2011 01:00      1
                                  43975 12 May 2011 02:00      1
                                  43976 12 May 2011 03:00      1
                                  43977 12 May 2011 04:00      1
                                  43978 12 May 2011 05:00      1
                                  43979 12 May 2011 06:00      1
                                  43980 12 May 2011 07:00      1
                                  43981 12 May 2011 08:00      1
                                  43982 12 May 2011 09:00      1
                                  43983 12 May 2011 10:00      1
                                  43984 12 May 2011 11:00      1
                                  43985 12 May 2011 11:02      1
    Specify the Begin and End Snapshot Ids
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Enter value for begin_snap: 43984
    Begin Snapshot Id specified: 43984
    Enter value for end_snap: 43985
    End   Snapshot Id specified: 43985
    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is awrrpt_1_43984_43985.txt.  To use this name,
    press <return> to continue, otherwise enter an alternative.
    Enter value for report_name:
    Using the report name awrrpt_1_43984_43985.txt
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: parse time elapsed
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: DB CPU
    WARNING (-20016)
    ORA-20016: Missing value for SGASTAT: free memory
    WARNING (-20016)
    ORA-20016: Missing value for SGASTAT: free memory
    WARNING (-20009)
    ORA-20009: Missing System Statistic logons current
    WARNING (-20009)
    ORA-20009: Missing System Statistic logons current
    WARNING (-20009)
    ORA-20009: Missing System Statistic opened cursors current
    WARNING (-20009)
    ORA-20009: Missing System Statistic opened cursors current
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: sql execute elapsed
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter undo_management
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter db_block_size
    WARNING (-20016)
    ORA-20016: Missing value for SGASTAT: log_buffer
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: DB time
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter timed_statistics
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter timed_statistics
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter statistics_level
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter statistics_level
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter sga_target
    WARNING (-20008)
    ORA-20008: Missing Init.ora parameter pga_aggregate_target
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: background cpu time
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: background elapsed
    WARNING (-20023)
    ORA-20023: Missing start and end values for time model stat: connection manageme
    WARNING (-20016)
    ORA-20016: Missing value for SGASTAT: buffer_cache
    WARNING (-20016)
    ORA-20016: Missing value for SGASTAT: buffer_cache
    WARNING: Since the DB Time is less than one second, there was
             minimal foreground activity in the snapshot period.
             Some of the percentage values will be invalid.
    WORKLOAD REPOSITORY report for
    DB Name         DB Id    Instance     Inst Num Startup Time    Release     RAC
    WEBTST        1391811405 webtst              1 29-Apr-11 04:50 11.1.0.7.0  NO
    Host Name        Platform                         CPUs Cores Sockets Memory(GB)
    WEBDBTST         Microsoft Windows x86 64-bit                           .00
                  Snap Id      Snap Time      Sessions Curs/Sess
    Begin Snap:     43984 12-May-11 11:00:01
      End Snap:     43985 12-May-11 11:02:00
       Elapsed:                1.98 (mins)
       DB Time:                0.00 (mins)
    Cache Sizes                       Begin        End
    ~~~~~~~~~~~                  ---------- ----------
                   Buffer Cache:MM  Std Block Size:K
               Shared Pool Size:         0M         0M      Log Buffer:K
    ORA-01403: no data found
    Error encountered in Report Summary
    Continuing to Report Sections
    Time Model Statistics              DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Operating System Statistics         DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Operating System Statistics - DetailDB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Foreground Wait Class               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
    -> s  - second, ms - millisecond -    1000th of a second
    -> ordered by wait time desc, waits desc
    -> %Timeouts: value of 0 indicates value was < .5%.  Value of null is truly 0
    -> Captured Time accounts for %  of Total DB time            .00 (s)
    -> Total FG Wait Time:    (s)  DB CPU time:            .00 (s)
                                                                      Avg
                                          %Time       Total Wait     wait
    Wait Class                      Waits -outs         Time (s)     (ms)  %DB time
    DB CPU                                                     0              100.0
    Foreground Wait Events             DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Background Wait Events             DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Wait Event Histogram               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Service Statistics                 DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Service Wait Class Stats            DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Elapsed Time        DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by CPU Time            DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Gets                DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Reads               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Executions          DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Parse Calls         DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Sharable Memory     DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    SQL ordered by Version Count       DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Instance Activity Stats            DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Instance Activity Stats - Absolute ValuesDB/Inst: WEBTST/webtst  Snaps: 43984
                      No data exists for this section of the report.
    Instance Activity Stats - Thread ActivityDB/Inst: WEBTST/webtst  Snaps: 43984-
                      No data exists for this section of the report.
    Tablespace IO Stats                DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    File IO Stats                      DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Buffer Pool Statistics             DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Instance Recovery Stats             DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Buffer Pool Advisory                       DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    PGA Aggr Summary                   DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    PGA Aggr Target Stats               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    PGA Aggr Target Histogram           DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    PGA Memory Advisory                        DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    Shared Pool Advisory                      DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    SGA Target Advisory                        DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    Streams Pool Advisory                      DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    Java Pool Advisory                         DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    Buffer Wait Statistics              DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Enqueue Activity                   DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Undo Segment Summary               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Undo Segment Stats                  DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Latch Activity                     DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Latch Sleep Breakdown              DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Latch Miss Sources                 DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Mutex Sleep Summary                 DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Parent Latch Statistics            DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Child Latch Statistics              DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Segments by Row Lock Waits         DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Segments by ITL Waits               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Segments by Buffer Busy Waits       DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Dictionary Cache Stats             DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Library Cache Activity              DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Memory Dynamic Components          DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Memory Resize Operations Summary    DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Memory Resize Ops                   DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Process Memory Summary             DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    sum
    SGA breakdown difference            DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Streams CPU/IO Usage               DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Streams Capture                     DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Streams Apply                       DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Buffered Queues                     DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Buffered Subscribers                DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Rule Set                            DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Persistent Queues                   DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Persistent Subscribers              DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    Resource Limit Stats                      DB/Inst: WEBTST/webtst  Snap: 43985
                      No data exists for this section of the report.
    init.ora Parameters                DB/Inst: WEBTST/webtst  Snaps: 43984-43985
                      No data exists for this section of the report.
    End of Report

    SQL> show parameter statistics
    NAME                                 TYPE        VALUE
    optimizer_use_pending_statistics     boolean     FALSE
    statistics_level                     string      TYPICAL
    timed_os_statistics                  integer     0
    timed_statistics                     boolean     TRUE
    SQL>
    SQL> SELECT statistics_name,
      2             session_status,
      3             system_status,
      4             activation_level,
      5             session_settable
      6      FROM   v$statistics_level
      7      ORDER BY statistics_name;
    STATISTICS_NAME                                                  SESSION_ SYSTEM_S ACTIVAT SES
    Active Session History                                           ENABLED  ENABLED  TYPICAL NO
    Adaptive Thresholds Enabled                                      ENABLED  ENABLED  TYPICAL NO
    Automated Maintenance Tasks                                      ENABLED  ENABLED  TYPICAL NO
    Bind Data Capture                                                ENABLED  ENABLED  TYPICAL NO
    Buffer Cache Advice                                              ENABLED  ENABLED  TYPICAL NO
    Global Cache Statistics                                          ENABLED  ENABLED  TYPICAL NO
    Longops Statistics                                               ENABLED  ENABLED  TYPICAL NO
    MTTR Advice                                                      DISABLED DISABLED TYPICAL NO
    Modification Monitoring                                          ENABLED  ENABLED  TYPICAL NO
    PGA Advice                                                       ENABLED  ENABLED  TYPICAL NO
    Plan Execution Sampling                                          ENABLED  ENABLED  TYPICAL YES
    Plan Execution Statistics                                        DISABLED DISABLED ALL     YES
    SQL Monitoring                                                   ENABLED  ENABLED  TYPICAL YES
    Segment Level Statistics                                         ENABLED  ENABLED  TYPICAL NO
    Shared Pool Advice                                               ENABLED  ENABLED  TYPICAL NO
    Streams Pool Advice                                              ENABLED  ENABLED  TYPICAL NO
    Threshold-based Alerts                                           ENABLED  ENABLED  TYPICAL NO
    Time Model Events                                                ENABLED  ENABLED  TYPICAL YES
    Timed OS Statistics                                              DISABLED DISABLED ALL     YES
    Timed Statistics                                                 ENABLED  ENABLED  TYPICAL YES
    Ultrafast Latch Statistics                                       ENABLED  ENABLED  TYPICAL NO
    Undo Advisor, Alerts and Fast Ramp up                            ENABLED  ENABLED  TYPICAL NO
    V$IOSTAT_* statistics                                            ENABLED  ENABLED  TYPICAL NO
    23 rows selected.
    SQL>Thanks
    Edited by: rsar001 on May 12, 2011 11:33 AM

  • Explain plan before and after ??

    is there a way to find out what sql plan was before and what sqlp plan is right now ?
    i know we can look at dba_hist_sql_plan but not sure how to put it all togeather...
    i am on 10.2.0.3
    i have a sql that running slow right now, i have the sql_id for it now...looks like its runing
    slow and last week it was fine...need to know what the explain plan was last week ??

    If you are lincenced to use AWR and history tables, you can do this
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID')); ---to get the SQL execution plan as it was run from history
    For the current one, you know how to get it
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&SQL_ID'));
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY('&SQL_ID'));
    You can also query dba_hist_sql_plan and format the results.

  • Issue in  pulling  the execution plan from awrsqrpt report.

    Hi All,
    In my production database , recently we faced some performance issue in daily job and i like to pull the old execution plan of that particular job from awrsqrpt.sql report but i got below error.
    Interesting information is i can able to generate the addm reports & awr reports between the same SNAP id's Why not AWRSQRPT report ???.
    Version : Oracle 11gR2
    Error :
    +++++++++
    Specify the SQL Id
    ~~~~~~~~~~~~~~~~~~
    Enter value for sql_id: b9shw6uakgbdt
    SQL ID specified: b9shw6uakgbdt
    declare
    ERROR at line 1:
    ORA-20025: SQL ID b9shw6uakgbdt does not exist for this database/instance
    ORA-06512: at line 22
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    Old history of SQL id :
    ++++++++++++++++++++
    SQL> select distinct SNAP_ID,SESSION_ID,SESSION_SERIAL#,USER_ID, SQL_EXEC_START from dba_hist_active_sess_history where sql_id='b9shw6uakgbdt' order by SQL_EXEC_START;
    SNAP_ID SESSION_ID SESSION_SERIAL# USER_ID SQL_EXEC_
    13095 1026 23869 86 29-AUG-12
    13096 1026 23869 86 29-AUG-12
    13118 582 14603 95 30-AUG-12
    13119 582 14603 95 30-AUG-12
    13139 708 51763 95 30-AUG-12
    13140 708 51763 95 30-AUG-12
    13142 900 2897 86 31-AUG-12
    13143 900 2897 86 31-AUG-12
    13215 1285 62559 86 03-SEP-12
    13216 1285 62559 86 03-SEP-12
    13238 1283 9057 86 04-SEP-12
    13239 1283 9057 86 04-SEP-12
    Thanks

    Hi,
    Are you using a cluster database (RAC), and running this report on the wrong instance?
    This report validates the SQL ID you specify against the dba_hist_sqlstat view, so check there if you have that SQL ID:
    select dbid, instance_number, snap_id
    from dba_hist_sqlstat
    where sql_id='b9shw6uakgbdt';Regards.
    Nelson

  • User I/O and db file parallel read is high in AWR report

    Hi,
    We have one performance issue during a job execution.
    From the awr report we have identified one query with a table having millions of records causing problems and then we had also fine tuned that query by changing it's code and by using the optmizer hints. It is being executed in plsql batches. After fine tuning, On the first batch execution(first 5000 records) the query is taking only 5 mins, but on the consecutive batches it is consuming more time( more than 30 mins).
    From the awr report I got the statistics as
    Release : 11.2.0.2.0
    Instance Efficiency Percentages (Target 100%)
    Buffer Nowait %: 100.00 Redo NoWait %: 100.00
    Buffer Hit %: 85.44 In-memory Sort %: 99.98
    Library Hit %: 99.76 Soft Parse %: 99.15
    Execute to Parse %: 88.91 Latch Hit %: 100.00
    Parse CPU to Parse Elapsd %: 87.32 % Non-Parse CPU: 98.65
    The buffer hit % is good. On each batch execution it is taking different set of records.
    Top 5 Timed Foreground Events
    Event Waits Time(s) Avg wait (ms) % DB time Wait Class
    db file parallel read 120,485 42,540 353 89.60 User I/O
    DB CPU 3,794 7.99
    db file sequential read 145,074 606 4 1.28 User I/O
    db file scattered read 70,030 556 8 1.17 User I/O
    direct path write temp 12,423 21 2 0.04 User I/O
    So the I/O is our main concern since that query contains one table with millions of records.
    Host CPU (CPUs: 24 Cores: 24 Sockets: 4)
    Load Average Begin Load Average End %User %System %WIO %Idle
    1.40 1.45 0.6 0.3 3.7 99.0
    Load is also normal.
    From the Time model statistics , sql execute elapsed time is 98.27% of db time and only 7.99% is that of DB CPU.
    Memory Statistics
    Begin End
    Host Mem (MB): 64,318.0 64,318.0
    SGA use (MB): 30,720.0 30,720.0
    PGA use (MB): 488.2 497.1
    % Host Mem used for SGA+PGA: 48.52 48.54
    Both the size of sga_max_size and sga_target are 32,212,254,720(32gb) bytes and that of
    pga_aggregate target is 629,145,600(600mb)
    from this it is evident that the memory is still available(so increase in memory size is not an option).
    The sql statistics for that query shows like that
    Elapsed Time (s) Executions Elapsed Time per Exec (s) %Total %CPU %IO SQL Id SQL Text
    44,950.03 55 817.27 94.67 6.99 94.72 79dgmrxh4kv74 SELECT /*+ index(cdr_data cdr_...
    I can't understand whether the problem is in the database side or with the query?
    If the problem is with the query, then how it has been executed in 5 mins for the first batch ?
    (all the batches are having 5000 records each).
    And how can we reduce the db file parallel read ?
    Your valuable advice will be greatly appreciated.
    Thanks in advance
    Manoj Kumar N

    "db file parallel read" is likely to be associated with something like index prefetching.
    See:
    http://www.freelists.org/post/oracle-l/RE-Calculating-LIOs,11
    http://aprakash.wordpress.com/2012/05/29/index-range-scan-and-db-file-scattered-read-as-session-wait-event/
    http://jonathanlewis.wordpress.com/2006/12/15/index-operations/
    Tune the SQL.
    Review the execution plan.
    Check whether the statistics are accurate.
    Review whether the index hint (and others that we can't see) is appropriate.

Maybe you are looking for

  • Table Backup and Best Practice

    Hi Guys, We have 2 tables, master and child with millions of records in it.These tables gets populated from flat files that we receive from external systems.The major operation on this table are insert/delete(update). The way we do update is, if the

  • Cant view video on the canvas properly

    Hey, i have been editing on FCP, and when I put clips pn the timeline, I cant see them on the "fit to window" mode. The video blows up and I can´t view the whole image. How do I fix this?

  • Open bam administrator page error

    page display: ADC System Type Not Found (SysIterUser) Source: "ActiveDataCache" ID: "ADCSystemTypeNotFound" Oracle.BAM.ActiveDataCache.SystemTypeNotFoundException: ADC System Type Not Found (SysIterUser) at Oracle.BAM.ActiveDataCache.SystemType.LoadS

  • Bootcamp does not load support software

    i did follow the steps of the user guide and had a usb formated  and try to continue in Bootcamp .. when it starts downloading after a minute the warning comes that my mac is only abole to run win7( its ok ) and after accepting it the download contin

  • Silverlight problems with Netflix

    Setting up my new 11.6" MB Air I had multiple error DRM codes when trying to instantly watch Netflix movies. I called netflix and they had me 1. uninstall/reinstall Silverlight (no go) 2. create a new user account (no go). I called Applecare, no help