time of DB to autotrace

Hi all

This is probably an easy question for some of you guys, but...

What is the best way to get the "db" to a query time in sqlplus?

Is the way to get to AUTOTRACE or something?

I found blogger this extended post autotrace output as follows:

Statistics

-----------------------------------------------------------

2 CPU used by this session

2 CPU used when calling started

DB 2 time

14 customer requests

14 SQL * Net back and forth to and from the client

387 bytes received via SQL * Net from client

24171 bytes sent via SQL * Net to client

2 calls for instant Yvert: kcmgss

6 calls to kcmgcs

Gets 127 consistent

127 consistent gets cache

127 consistent gets (fastpath) cache

2 authentications of cursor

Releases 1 waiting queue

1 waiting queue requests

2. run County

1040384 logic read the bytes from cache

121, no work - compatible read doesn't get

14 no-idle wait County

2 cursors open cumulative

open cursors current 1

1 parse count (hard)

2 parse count (total)

1 analysis of time cpu

1 recursive calls

1 recursive CPU usage

127 session logical reads

-pga 262144 session in memory

1 sorts (memory)

638 sorts (lines)

scan table 121 blocks obtained

11955 table obtained scan lines

3 analysis of tables (short tables)

15 calls from user

3 executions - optimal activities

So, I would like to know what are the requirements for obtaining such a result...

Tip: there will be more than a simple "set autotrace on."

Kind regards

Jocelyn

seems you need developer sql version 4: http://www.thatjeffsmith.com/archive/2013/07/explain-plan-and-autotrace-enhancements-in-oracle-sql-developer-4/

Tags: Database

Similar Questions

  • TIME column result autotrace

    ORACLE VERSION: 10.2.0.3
    Operating system: Windows 2003

    I've been running the same SQL statement twice after rinsing my buffer_cache. As expected the first took more time (elapsed time: 00:00:07.67) according to the second one (00:00:00.51). But why not the given result in time does not change the column of my autotrace report. HE shows me the twice 00:02:01 as you can see in my listings.

    Achim.bigemp DESC;
    Name Null type
    EMPNO NUMBER
    ENAME VARCHAR2 (10)
    USE VARCHAR2 (9)
    MGR NUMBER 4
    HIREDATE DATE
    SAL NUMBER (7.2)
    NUMBER (7.2) COMM
    DEPTNO NUMBER (2)
    8 selected lines

    COUNT (*)
    ----------------------
    7529536



    First ROUND
    SQL > set the calendar;
    SQL > set autotrace traces;

    SQL > select count (empno) in the achim.bigemp;

    Abgelaufen: 00:00:07.67

    Ausf³hrungsplan
    ----------------------------------------------------------
    Hash value of plan: 870989070

    -----------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    -----------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 1. 3. 10023 (3) | 00:02:01 |
    | 1. GLOBAL TRI | 1. 3 | | |
    | 2. TABLE ACCESS FULL | BIGEMP | 7529K | 21 M | 10023 (3) | 00:02:01 |
    -----------------------------------------------------------------------------


    Statistics
    ----------------------------------------------------------
    245 recursive calls
    0 db block Gets
    44436 consistent gets
    44410 physical readings
    0 redo size
    425 bytes sent via SQL * Net to client
    396 bytes received via SQL * Net from client
    2 SQL * Net back and forth to and from the client
    4 sorts (memory)
    0 sorts (disk)
    1 rows processed
    Second RUN
    SQL > select count (empno) in the achim.bigemp;

    Abgelaufen: 00:00:00.51

    Ausf³hrungsplan
    ----------------------------------------------------------
    Hash value of plan: 870989070
    -----------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    -----------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 1. 3. 10023 (3) | 00:02:01 |
    | 1. GLOBAL TRI | 1. 3 | | |
    | 2. TABLE ACCESS FULL | BIGEMP | 7529K | 21 M | 10023 (3) | 00:02:01 |
    -----------------------------------------------------------------------------
    Statistics
    ----------------------------------------------------------
    0 recursive calls
    0 db block Gets
    44408 compatible Gets
    0 physical reads
    0 redo size
    425 bytes sent via SQL * Net to client
    396 bytes received via SQL * Net from client
    2 SQL * Net back and forth to and from the client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed

    SQL >

    When I ask the elapsed_time of v$ sqlarea I get the same result, as shown on my screen in SQLPLUS or SQL Developer. It would be nice to give me a hint how I understand the DURATION indicated in the report autotrace.
    Thank you Achim

    See this link for some Autotrace more information: [test Autotrace | http://jonathanlewis.wordpress.com/testing-autotrace/]

  • AutoTrace time colum not wearing any resamblance to real tiem taken

    Hello

    Using sqlplus autotracde set traceonly explain to evaluate indexing strategies before the kickoff of queries and to find time presented on way to the lower gear
    What actaully taken for example query displays the time 00:02:21 and used a different 3rd third party tool to generate plan epxlain - show about 2 minutes, but euqery still running.

    400 million to 800 million line scan lines table so do not race in 2 minutes - would be passing exect more time and it is still running.

    How can we get accurate estimate of queries how long will take?

    Statistics day.

    With the help of 11.2.0.3

    Thank you

    Published by: user5716448 on March 5, 2013 03:17

    It seems that you have never collected statistical system. Without numbers for SREADTIM and MREADTIM Oracle has no idea how much time read only block or a diluvium reading will be. Learn about the procedure of dbms_stats.gather_system_stats, they are not gathered automatically (as you can see).
    --
    John Watson
    Oracle Certified Master s/n
    http://skillbuilders.com

  • [Bug]? AutoTrace without output

    I recently came across a bug (?) while using autotrace in sql developer. Many instructions generate autotrace output. But there are some that do not work. I tried to reproduce our selection for an environment without our data, but I failed. But then I accidentally found this bad behavior when using a select statement very very basic. Its reproducible for me:

    (1) select * from dba_indexes where owner in ('SYS');

    (2) select * from dba_indexes where owner = 'SYS ';

    (3) select * from dba_indexes by "SYS."

    but not during the execution

    (4) select * from dba_indexes;

    Running an autotrace script produces the following output, for example. to select option (2):

    Hash value of plan: 186721070

    -----------------------------------------------------------------------------------------------------------------

    | ID | Operation                                     | Name | Lines | Bytes | Cost (% CPU). Time |

    -----------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                 |    93. 42222 |   784 (1) | 00:00:01 |

    |*  1 |  HASH JOIN                                    |                 |    93. 42222 |   784 (1) | 00:00:01 |

    |   2.   TABLE ACCESS FULL | USER$ |   140.  2800 |     5 (0) | 00:00:01 |

    |   3.   NESTED LOOPS |                 |    93. 40362 |   779 (1) | 00:00:01 |

    |   4.    NESTED LOOPS |                 |    93. 40362 |   779 (1) | 00:00:01 |

    |*  5 |     EXTERNAL RIGHT HASH JOIN |                 |    93. 36921 |   593 (1) | 00:00:01 |

    |   6.      TABLE ACCESS FULL | USER$ |   140.  2800 |     5 (0) | 00:00:01 |

    |   7.      NESTED EXTERNAL LOOPS |                 |    93. 35061 |   587 (1) | 00:00:01 |

    |   8.       NESTED EXTERNAL LOOPS |                 |    93. 31992 |   401 (1) | 00:00:01 |

    |*  9 |        EXTERNAL RIGHT HASH JOIN |                 |    93. 28086 |   308 (1). 00:00:01 |

    |  10.         TABLE ACCESS FULL | TS$             |   141.  4794.    41 (0) | 00:00:01 |

    |  11.         NESTED EXTERNAL LOOPS |                 |    93. 24924 |   266 (1) | 00:00:01 |

    |  12.          NESTED LOOPS |                 |    93. 14043 |   266 (1) | 00:00:01 |

    |  13.           NESTED LOOPS |                 |   409. 24949 |   255 (1) | 00:00:01 |

    |  14.            TABLE ACCESS BY INDEX ROWID | USER$ |     1.    20.     1 (0) | 00:00:01 |

    | * 15 |             INDEX UNIQUE SCAN | I_USER1 |     1.       |     0 (0) | 00:00:01 |

    | * 16.            TABLE ACCESS BY ROWID INDEX BATCH | OBJ$            |   409. 16769 |   254 (1) | 00:00:01 |

    | * 17.             INDEX RANGE SCAN | I_OBJ2 |   409.       |     6 (0). 00:00:01 |

    | * 18.           TABLE ACCESS BY INDEX ROWID | IND$            |     1.    90.     1 (0) | 00:00:01 |

    | * 19.            INDEX UNIQUE SCAN | I_IND1 |     1.       |     0 (0) | 00:00:01 |

    |  20.          TABLE ACCESS BY INDEX ROWID | DEFERRED_STG$ |     1.   117.     0 (0) | 00:00:01 |

    | * 21.           INDEX UNIQUE SCAN | I_DEFERRED_STG1 |     1.       |     0 (0) | 00:00:01 |

    |  22.        CLUSTER OF ACCESS TABLE | SEG$            |     1.    42.     1 (0) | 00:00:01 |

    | * 23.         INDEX UNIQUE SCAN | I_FILE #_BLOCK # |     1.       |     0 (0) | 00:00:01 |

    |  24.       TABLE ACCESS BY ROWID INDEX BATCH | OBJ$            |     1.    33.     2 (0) | 00:00:01 |

    | * 25.        INDEX RANGE SCAN | I_OBJ1 |     1.       |     1 (0) | 00:00:01 |

    | * 26.     INDEX RANGE SCAN | I_OBJ1 |     1.       |     1 (0) | 00:00:01 |

    |  27.    TABLE ACCESS BY INDEX ROWID | OBJ$            |     1.    37.     2 (0) | 00:00:01 |

    -----------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access("IO".") "OWNER # '=' UI '. ("" USER # ")

    5 - access("ITO".") "OWNER #"="ITU". "USER #" (+)) "

    9 - access("I".") "TS # '=' TS '. » TS#"(+))

    15 - access("U".") THE NAME "= 'SYS')

    16 filter (BITAND ("O". "' FLAGS = 0)»(, 128)"

    17 - access("U".") "THE USER #"="O". "' OWNER # ' AND 'O'. (' ' NAME ' LIKE '% I_CDE')

    filter ("O". "NAME' LIKE '% I_CDE')"

    18 filter (BITAND ("I". "' FLAGS = 0)»(, 4096)"

    19 - access("O".") OBJ # "= 'I'." (' OBJ # ")

    21 - access("I".") ' OBJ # '=' DS '. "OBJ #" (+)) "

    23 - access("I".") TS # « = » S ». "TS #" (+) AND 'I'. " "" FILE # "=" S ". "FILE #" (+) AND 'I'. " "" BLOCK # "=" S ". "BLOCK #" (+)) "

    25 - access("I".") ' INDMETHOD # '=' ITO '. "OBJ #" (+)) "

    26 - access("I".") "BO # '=' IO '. (' ' OBJ # ")

    Statistics

    -----------------------------------------------------------

    1 CPU used by this session

    1 CPU used when calling began

    DB 2 time

    5 customer requests

    226 consistent gets

    17 compatible gets review

    17 compatible gets (fastpath) review

    226 consistent gets cache

    209 consistent gets PIN

    209 consistent gets PIN (fastpath)

    5 no-idle wait County

    3 sliders open cumulative

    open cursors current 1

    1 pin current sliders

    226 session logical reads

    7 user calls

    Executes the same within the sql developer using the autotrace button generates an output (on the other hand, made a statement (4)):

    strange2.PNG

    Repeatable at least with sql developer 4.1.1 and 4.1.2.

    There is no entry in the log.

    Buggy as 22250314. Thank you for the complete troubleshooting!

  • Explain and autotrace gave different plans

    Hi, while exploring or characteristic expansion, I found explain plan and autotrace gave to different execute plans for the same sql.

    It seems to explain taking into account as much as autotrace. So, how these two tools made their decisions, that one is more accurate?

    Step 1:

    SQL > create table t select * from object;

    Step 2:

    SQL > EXPLAIN the PLAN FOR
    2 Select * from t where owner = 'FOO' or status = 'BAR ';
    He explained.
    SQL > SELECT * FROM table (DBMS_XPLAN. DISPLAY);
    Hash value of plan: 1601196873
    ------------------------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    ------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |          | 302K |    45 M |  1199 (3) | 00:00:15 |

    |*  1 |  TABLE ACCESS FULL | T       | 302K |    45 M |  1199 (3) | 00:00:15 |

    ----------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter ("OWNER" = 'STATUS"= 'VALID' OR'FUSION_PORTLET ')

    Note

    -----

    -dynamic sample used for this survey (level = 2)

    17 selected lines.

    Step 3:

    SQL > set autotrace on
    SQL > select * from t where owner = 'FOO' or status = 'BAR '.
    no selected line
    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 1162562427
    -------------------------------------------------------------------------------------
    SQL > select * from t where owner = 'FOO' or status = 'BAR '.
    2;
    no selected line
    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 1162562427

    -------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    -------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |            |  2992.   461K |   421 (1) | 00:00:06 |

    |   1.  CONCATENATION.            |       |       |            |          |

    |   2.   TABLE ACCESS BY INDEX ROWID | T          |     1.   158.   379 (0) | 00:00:05 |

    |*  3 |    INDEX RANGE SCAN | STATUS_IDX |  1414 |       |   361 (0) | 00:00:05 |

    |*  4 |   TABLE ACCESS BY INDEX ROWID | T          |  2991 |   461K |    41 (0) | 00:00:01 |

    |*  5 |    INDEX RANGE SCAN | OWNER_IDX |  1414 |       |    11 (0) | 00:00:01 |

    -------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------
    3 - access ("STATUS" = 'FOO')
    4 - filter (LNNVL ("STATUS" = 'FOO'))
    5 - access ("OWNER" = 'BAR')
    Note
    -----
    -dynamic sample used for this survey (level = 2)
    Statistics
    ----------------------------------------------------------
    19 recursive calls
    0 db block Gets
    508 compliant Gets
    0 physical reads
    0 redo size
    1343 bytes sent via SQL * Net to client
    508 bytes received via SQL * Net from client
    1 SQL * Net back and forth to and from the client
    0 sorts (memory)
    0 sorts (disk)

    You deceive us & maybe even yourself.

    INDEX do not spontaneously come into existence.

    You did the INDICES between the first & second EXPLANATION; This is why they are different.

  • a plan explain time column

    Hello
    I use Oracle version 10.2.0.3.0. I have 2 tables with 10 million documents each. The DOF is as follows.

    create the bigtable table (varchar2 (20) col1, col2 varchar2 (20))
    create table bigtablechild (varchar2 (20) col1, col2 varchar (20))

    bigtablechild.Col1 is a foreign key to bigtable.col1. Below is the request and explain the plan. During several executions, the query runs for about 20 seconds before returning the results. Could someone please explain what represents the time column? It does not at the same time it took return of results.
    SQL> set autotrace on
    SQL> 
    SQL> select b.col2
      2  from bigtable a, bigtablechild b
      3  where a.col1 = b.col1
      4  and a.col1 = 'ABC6554';
    
    COL2
    --------------------
    XYZ6554
    XYZ6554
    XYZ6554
    XYZ6554
    XYZ6554
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 4210396901
    
    ------------------------------------------------------------------------------------
    | Id  | Operation          | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |               |     5 |   150 | 21538   (4)| 00:04:19 |
    |*  1 |  HASH JOIN         |               |     5 |   150 | 21538   (4)| 00:04:19 |
    |*  2 |   TABLE ACCESS FULL| BIGTABLE      |     1 |    10 | 13124   (4)| 00:02:38 |
    |*  3 |   TABLE ACCESS FULL| BIGTABLECHILD |     5 |   100 |  8413   (5)| 00:01:41 |
    ------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("A"."COL1"="B"."COL1")
       2 - filter("A"."COL1"='ABC6554')
       3 - filter("B"."COL1"='ABC6554')
    
    
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
          93672  consistent gets
          91845  physical reads
              0  redo size
            463  bytes sent via SQL*Net to client
            396  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              5  rows processed

    Hello

    >

    Thanks, but how did you determine the 12 Member States based on my exit from the plan to explain?

    04:19 = 259 seconds = 259 000 milliseconds

    259 000 milliseconds / 21538 monobloc bed ~ = 12 milliseconds per read monobloc

    Note, however, that A time column, on the other hand, is extremely useful, but it is available only if content plan (RowSource) statistics have been populated.

    What is the A-time column, you are referring to? Could you please give an example?

    ALTER session set statistics_level = all;

    Select * from table (dbms_xplan.display_cursor (, null, 'last iostats'));

    Best regards
    Nikolai

  • Get the response time more with First_Rows Hint.

    Hello
    I use 10.2.0.1.0 oracle version. I have a sql query that gives performance with cutting-edge FIRST_ROWS problem.     I expect the best response time with suspicion of "FIRST_ROWS (5)", but his is the worst, with use of a different set of the index, which is local to the partition. Please, help me to understand, the reason behind this change in negative execution path?
         First query gives all the ~3488 rows within ~1 minutes but the query with HINT is taking ~15 minutes for providing initial few rows itself. 
    For second one i am not able to get the exact and estimated cardinality stats , as it was taking lot of time for completion, so providing Autotrace plan only.
         
    Main Query:
    Published by: 930254 on October 15, 2012 04:55

    930254 wrote:
    Yes, Jonathan, in fact in the first case, i 'I' table is being analyzed using an overall index, but suspicion FIRST_ROW sound using the index that is local to the partition. resulting in the digitization of all partitions of 448. I think it's causing bottleneck. Is there something like: FIRST_ROW suspicion that affect this type of systematic index scan?

    In the first case the optimizer has unnested subquery of REACTION and used to bring to the table, I, and that's what dictated the choice of index.

    In the case of first_rows (5) decided that the range index scan will take adequate data if some time he chose a different index - running subqueries in the REACTION as a subquery for filter on each line. But it is the estimate of how long it will find adequate data (and how much time he will have to run the subquery to eliminate unnecessary data) does not.

    Concerning
    Jonathan Lewis

  • sqlplus - autotrace

    Hello
    I need to insert into the table Oracle execution plan as well as statistics of the statements with autotrace to sqlplus session.

    for example:
    SQL> set autotrace on;
    SQL> select count(*)
      2  from dual;
    
    count(*)                                                                     
    ----------                                                                      
           1                                                                      
    
    
    Exrcution Plan
    ----------------------------------------------------------                      
    Plan hash value: 1388734953                                                     
                                                                                    
    -----------------------------------------------------------------               
    | Id  | Operation        | Name | Rows  | Cost (%CPU)| Time     |               
    -----------------------------------------------------------------               
    |   0 | SELECT STATEMENT |      |     1 |     2   (0)| 00:00:01 |               
    |   1 |  FAST DUAL       |      |     1 |     2   (0)| 00:00:01 |               
    -----------------------------------------------------------------               
    
    
    Statistics
    ----------------------------------------------------------                      
              1  recursive calls                                                    
              0  db block gets                                                      
              0  consistent gets                                                    
              0  physical reads                                                     
              0  redo size                                                          
            425  bytes sent via SQL*Net to client                                   
            416  bytes received via SQL*Net from client                             
              2  SQL*Net roundtrips to/from client                                  
              0  sorts (memory)                                                     
              0  sorts (disk)                                                       
              1  rows processed 
    Can I insert this output in an Oracle table?
    I need to draw the many statements for the current session and store it in a table.

    Thanks in advance!

    RAF Royal wrote:
    I need to find the following values for the session of sqlplus set autotrace on;

    ID
    OPERATION
    NAME
    LINES
    COST (% CPU)
    TIME
    STATISTICS

    I would like to create a table with these columns and insert these values or I would find a system table that gives me the data.

    question one or more of the views below

    07:43:37 SQL > select dba_views view_name where view_name like ' % PLAN % ';

    VIEW_NAME
    ------------------------------
    V_$ ADVISOR_CURRENT_SQLPLAN
    V_$ RSRC_PLAN
    V_$ RSRC_PLAN_CPU_MTH
    V_$ RSRC_PLAN_HISTORY
    DBA_ADVISOR_SQLPLANS
    V_$ SQLAREA_PLAN_HASH
    V_$ SQLSTATS_PLAN_HASH
    V_$ SQL_PLAN
    V_$ SQL_PLAN_MONITOR
    V_$ SQL_PLAN_STATISTICS
    V_$ SQL_PLAN_STATISTICS_ALL

    VIEW_NAME
    ------------------------------
    GV_$ RSRC_PLAN
    GV_$ RSRC_PLAN_CPU_MTH
    GV_$ RSRC_PLAN_HISTORY
    GV_$ SQLAREA_PLAN_HASH
    GV_$ SQLSTATS_PLAN_HASH
    USER_ADVISOR_SQLPLANS
    USER_SQLSET_PLANS
    USER_SQLTUNE_PLANS
    USER_SQLTUNE_RATIONALE_PLAN
    DBA_HIST_PLAN_OPERATION_NAME
    DBA_HIST_PLAN_OPTION_NAME

    VIEW_NAME
    ------------------------------
    DBA_HIST_RSRC_PLAN
    DBA_HIST_SQL_PLAN
    DBA_RSRC_PLANS
    DBA_RSRC_PLAN_DIRECTIVES
    DBA_SQLSET_PLANS
    DBA_SQLTUNE_PLANS
    DBA_SQLTUNE_RATIONALE_PLAN
    DBA_SQL_PLAN_BASELINES
    KU$ _RMGR_PLAN_DIRECT_VIEW
    KU$ _RMGR_PLAN_VIEW
    ALL_SQLSET_PLANS

    VIEW_NAME
    ------------------------------
    GV_$ SQL_PLAN
    GV_$ SQL_PLAN_MONITOR
    GV_$ SQL_PLAN_STATISTICS
    GV_$ SQL_PLAN_STATISTICS_ALL
    ALL_EXPFIL_PREDTAB_PLAN
    USER_EXPFIL_PREDTAB_PLAN
    ALL THE$ AW_CUBE_AGG_PLANS
    MGMT_JOB$ EXECPLAN
    GV_$ ADVISOR_CURRENT_SQLPLAN

    42 selected lines.

    07:44:06 SQL >

  • How to know the execution time

    Hello

    I'm using Oracle 11 g. I want to know the execution time of a query.

    Can someone help me please how to find it.

    And. y at - it a tool that compares the performance of the 2 queries?

    user13044793 wrote:
    Hello

    I'm using Oracle 11 g. I want to know the execution time of a query.

    Can someone help me please how to find it.

    In SQL * more:

    SET TIMING ON

    And. y at - it a tool that compares the performance of the 2 queries?

    In SQL * more:

    SET AUTOTRACE ON

    URS

  • Question on AUTOTRACE, 0618 SP2 and SP2-0611

    Hello

    I wanted to look at for some examples of query execution plans. I did a little research with Google, discovered autotrace, plan_table plustrace role utlxplan. I followed the instructions I found, but the result is not quite as expected.

    Here is an exit of a freshly session started:
    0 01:50 [SS1TB Attic-Z] [5G] [750M] Z:\Documentation\Oracle\
    Oracle Concepts\Scripts>sqlplus hr/abc123
    
    SQL*Plus: Release 11.2.0.1.0 Production on Sun Aug 8 01:50:16 2010
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select count(*) from plan_table;
    
      COUNT(*)
    ----------
             2
    
    SQL> set autotrace on
    SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
    SP2-0611: Error enabling STATISTICS report
    SQL> select count(*) from plan_table;
    
      COUNT(*)
    ----------
             2
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3662021055
    
    -------------------------------------------------------------------------
    | Id  | Operation          | Name       | Rows  | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |            |     1 |     3   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE    |            |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| PLAN_TABLE |     2 |     3   (0)| 00:00:01 |
    -------------------------------------------------------------------------
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL>
    1. the first select statement is there to make sure I have a plan_table, than controls.
    2. when I set autotrace on, I get SP2-0618 and SP2-0611 for reasons I can't understand.
    3. the second selection is there to find out if the autotrace in step 2 have had an impact. He has done now for the explain plan command is displayed.

    The question is: if it works (as shown in step 3) then why I get these errors in step 2? and what do I do to not get these errors more?

    Thanks for your help (again!)

    John.

    Note: I created the role plustrace, granted it select v_$ sesstat, v_$ statname, v_$ session, and then I gave hr plustrace. was there something else?

    John,

    10.2 from, creating the plan_table is not necessary because the table is created in the Sys schema with the name of table plan $ and his public synonym is made available to all users with the name plan_table . For the rest, see if the below demo.

    SQL> select * from V$version;
    
    BANNER
    -------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> drop user john purge;
    drop user john purge
                   *
    ERROR at line 1:
    ORA-00921: unexpected end of SQL command
    
    SQL> drop user john cascade;
    
    User dropped.
    
    SQL> @D:\oracle\product\11.2.0\dbhome_1\sqlplus\admin\plustrce
    SQL>
    SQL> drop role plustrace;
    
    Role dropped.
    
    SQL> create role plustrace;
    
    Role created.
    
    SQL>
    SQL> grant select on v_$sesstat to plustrace;
    
    Grant succeeded.
    
    SQL> grant select on v_$statname to plustrace;
    
    Grant succeeded.
    
    SQL> grant select on v_$mystat to plustrace;
    
    Grant succeeded.
    
    SQL> grant plustrace to dba with admin option;
    
    Grant succeeded.
    
    SQL>
    SQL> set echo off
    SQL> create user john identified by john;
    
    User created.
    
    SQL> grant connect, resource to john;
    
    Grant succeeded.
    
    SQL> grant create table to john;
    
    Grant succeeded.
    
    SQL> grant plustrace to john;
    
    Grant succeeded.
    
    SQL> conn john/john
    Connected.
    SQL> create table test(a number);
    
    Table created.
    
    SQL> set autot lon
    Usage: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
    SQL> set autot on
    SQL> select * from test;
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1357081020
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |     1 |    13 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| TEST |     1 |    13 |     2   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    Statistics
    ----------------------------------------------------------
             24  recursive calls
              0  db block gets
              2  consistent gets
              0  physical reads
              0  redo size
            281  bytes sent via SQL*Net to client
            409  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              0  rows processed
    
    SQL>
    

    HTH
    Aman...

  • Really basic - need help with interpreting the result autotrace

    I am reviewing tunning of database to verify the effectiveness of my sql statements and I think AUTOTRACE is the first thing to look into.

    I created two identical tables containing 250,000 lines. First of all, there is no evidence of a fact

    SET AUTOTRACE ON
    SELECT * FROM TEST_250000
    WHERE CUSTOMER_NO > 241000.

    Hash value of plan: 4257243307

    ---------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    ---------------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 15353 | 2623K | 750 (2) | 00:00:10 |
    |* 1 | TABLE ACCESS FULL | TEST_250000 | 15353 | 2623K | 750 (2) | 00:00:10 |
    ---------------------------------------------------------------------------------


    Statistics
    -----------------------------------------------------------
    0 recursive calls
    0 db block Gets
    2687 gets coherent
    0 physical reads
    0 redo size
    390398 bytes sent via SQL * Net to client
    427 bytes received via SQL * Net from client
    12 SQL * Net back and forth to and from the client
    1 sorts (memory)
    0 sorts (disk)


    Hash value of plan: 174749588
    -------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    -------------------------------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 9000 | 606K | 121 (1) | 00:00:02 |
    | 1. TABLE ACCESS BY INDEX ROWID | TEST_250000_INDEX | 9000 | 606K | 121 (1) | 00:00:02 |
    |* 2 | INDEX RANGE SCAN | TEST_250000 | 9000 | 22 (0) | 00:00:01 |
    -------------------------------------------------------------------------------------------------

    Statistics
    -----------------------------------------------------------
    0 recursive calls
    0 db block Gets
    Gets 89 consistent
    0 physical reads
    0 redo size
    390399 bytes sent via SQL * Net to client
    433 bytes received via SQL * Net from client
    12 SQL * Net back and forth to and from the client
    1 sorts (memory)
    0 sorts (disk)

    My questions are the following:

    (1) I am assuming that the right time to run the first query is 0.2 sec and costs 1500, while the other is 0.05 second and 164. You simply add to the top?
    2.) which means the cost? I mean what is the unit of it?
    3.) there is a substantial difference in gets consistent. I found a definition (Gets the number of times that a consistent read was requested for a block). Could someone explain what it means to me and why is it so different in the two queries.
    4.) what is the hash value of Plan on?

    Know that it's a lot, but any help appreciated.

    PS: I am posting this in general, but y at - it a forum specializing in the tunning?

    Jana Kralova wrote:
    I am reviewing tunning of database to verify the effectiveness of my sql statements and I think AUTOTRACE is the first thing to look into.

    Uitilities TRACE and TKPROF are even better.

    My questions are the following:

    (1) I am assuming that the right time to run the first query is 0.2 sec and costs 1500, while the other is 0.05 second and 164. You simply add to the top?
    2.) which means the cost? I mean what is the unit of it?

    By comparing the cost of two queries is not something that you should focus.
    See: http://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:313416745628
    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:956029960417

    3.) there is a substantial difference in gets consistent. I found a definition (Gets the number of times that a consistent read was requested for a block). Could someone explain what it means to me and why is it so different in the two queries.

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:6643159615303

    4.) what is the hash value of Plan on?

    "The NUMBER of PLAN_HASH_VALUE digital representation of the SQL plan for this cursor. Comparing a PLAN_HASH_VALUE to another easily identifies whether two plans are the same (rather than comparing two plans line by line). »
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14237/dynviews_2113.htm#REFRN30246

    Oracle Performance Tuning Guide can be found here:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14211/TOC.htm

    Know that it's a lot, but any help appreciated.

    Refer to the documentation (according to the version of your database) @
    http://www.Oracle.com/pls/db102/homepage
    http://www.Oracle.com/pls/db112/homepage
    or start @.
    http://Tahiti.Oracle.com
    and your own research on http://asktom.oracle.com, you will find many examples and explanations.

    PS: I am posting this in general, but y at - it a forum specializing in the tunning?

    I think that you are in the right forum ;)

  • How to know the execution time of query in sql plus

    Hello

    I want to know the duration of execution of query in sql more accompanied by statistics

    I say time is set on;
    Set autotrace on;
    Select * view where usr_id = "abcd";


    If the result is 300 lines it scrolls up until all the rows are retrieved and finally gives me the run time in 40 seconds, or 1 minute... (it is after all records scrolls)

    but when I run it in Toad he gives 350 milli seconds...

    I want to see the execution time in sql how to proceed

    client and database server 11g is g 10

    concerning
    REDA

    In sqlplus you can do set autotrace traces to suppress the display of the selected lines.

    John

  • set timing on (just need time and no data)

    is anyway to get the time from a sql instructions for how long it works... just the time data only... not... I know using "set"timing"on" on sqlplus... it gives me data + time... but I'm looking for only sometimes... need that data... which option to use? As the use of SET AUTOTRACE ON STATISTICS it gives me the stats with no plans to explain... I need something where I just need time... and not data... . How is that possible?

    SET ON TIME
    SET TIMING ON
    SET TRACEONLY AUTOTRACE

  • New iPhone than 7 to 8 hours time to call to life

    I got a new iPhone 7 more, ordered through Verizon, a few days ago. Yesterday, I noticed that she had 8 hours and 51 minutes of life call time, which is impossible.

    This phone has replaced my iPhone 6

    I have not configured this phone via an iPhone backup 6. I plug it into iTunes once for synchronization of music and iTunes did ask if I want to set it up as a new phone. I said yes.

    I use the same iTunes/iCloud account that I used on my old phone, however.

    My use in line with Verizon for this month is only 113 minutes, so this number is clearly wrong.

    Still, I have the old phone and looked at the number of hours of calls from life. It's much more than 24 hours, the new phone has not inherit the old phone number.

    DIDS, I get a phone used or defective?

    Very strange... no one here can say what has happened. I go back to Verizon and ask them. If it was me, I insist on getting a new phone... that one has been used somewhere.

    Barry

  • I've never done a Time Machine backup and I have upgraded to iOS Sierra. Help!

    I'm a fool. After owning my Macbook for 5 years, I failed to make a single Time Machine backup. I just saved my essential to an external hard drive. I have upgraded to iOS Sierra. Big mistake. I want to go back to iOS Capitan, but it does not seem possible. Now, my external hard drive is wiped clean (things are dark). What are my options? If I'm stuck with Sierra?

    If you have downloaded El Capitan, it should always be available in your purchases. Now, you will need to make a backup to backup your personal files.

Maybe you are looking for

  • Tecra A9: Cannot enable or disable Multi Core processing in the BIOS

    I have a Tecra A9 and want to swicht out of the Multi Core Processing in the Bios, but it is impossible. To the old Bios version (1.50), it has been possible. Now I use the most recent (2.10) and I can't move the cursor to this selection. The special

  • Windows 10 and ipod nano 3

    I have a bunch of old music on my iPod nano 3 I want to put on my computer.  I have windows 10.  He did years I even put music on the iPod, so my memory is faded.  I don't think I need to use iTunes, but at this point, I don't know yet!  A link to th

  • Create a library in Blackberry JDE

    Learn more and more :-) I want to create a library for a couple of functions.  I can what I have to specify 'Library' in the definitions of the project Several output files are created. To use the library, I guess I should do an import in the class w

  • I just bought the mouse explore and blue light that is supposed to shine around the mouse, don't. Clues?

    I'm not really experienced with computers and their peripherals, so any help would be appreciated.

  • How to use a large on my clone view related?

    I'm experimenting with using view to replace the user workstations in my building.  I already started to replace the computers on the manufacturing plant, now I want to start looking to replace part of my offices.  One of the conditions for this is m