Tkprof not showing the Execution Plan for Statement

Hi all
using oracle 9i release 2
I have issued the following statements
alter session set sql_trace
alter session set events '10046 trace name context forever, level 12';
--then executed a pl-sql procedure
after reading the traceout outfile it shows the Execution plan for statements directly wirtten under begin and end block and doesnot displays the plan for the statements written like this
procedure a is
cursor b is
select ename,dname from dept a,emp b
where a.deptno=b.deptno;
begin
for x in a loop --plan not found but stats are written
select ename into v_ename from emp where empno=300; --does show the plan+stats
end;
what I am missing to get the actual plan in trace output file
thanks in advance

You have to exit sql*plus after running the procedure, example tkprof is below:
declare
cursor c is
select ename, dname
from emp, dept
where emp.deptno = dept.deptno;
begin
for v_x in c
loop
dbms_output.put_line(v_x.ename || ' ' ||v_x.dname);
end loop;
end;
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.06 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.06 0 0 0 1
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 68
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 0.00 0.00
SELECT ENAME, DNAME
FROM
EMP, DEPT WHERE EMP.DEPTNO = DEPT.DEPTNO
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 15 0.01 0.00 0 44 0 14
total 17 0.01 0.00 0 44 0 14
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 68 (recursive depth: 1)
Rows Row Source Operation
14 NESTED LOOPS
14 TABLE ACCESS FULL EMP
14 TABLE ACCESS BY INDEX ROWID DEPT
14 INDEX UNIQUE SCAN DEPT_PK (object id 40350)
Best Regards
Krystian Zieja / mob

Similar Messages

  • How to capture the execution plan for a query

    HI All,
    Can anyone please help me in finding out the command to capture the execution plan for a query.
    Execution plan for select * from EMP where <Condtions>
    it is getting executed successfully but i need to get the proper execution plan for the same.
    Thanks

    971830 wrote:
    i want to know where execution plan gets generated??
    in PMON of server process or in shared pool??
    i know that optimixer create execution plan..It is stored in Library Cache (present inside Shared Pool ).
    select * from v$sql_plan;An absolute beautiful white paper :
    Refer this -- www.sagelogix.com/sagelogix/SearchResults/SAGE015052
    Also -- http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/XPVSP/Default.aspx
    HTH
    Ranit B.

  • Date difference is not showing the correct result for date interval

    Hi Expert,
                    I've created two formula variable one for PO date and another for GR date
    while i am taking the date difference of GR and PO date for single PO date selection
    it showing me correct result , but while i am taking the date interval for PO date it not
    showing the correct result.
    eg: PO date: 01.01.2010   for a particular PO and Gr date is suppose 03.01.2010, 06.01.2010
          it showing the result 2 and 5.
    But if i am taking date interval for PO date:
    eg: 01.01.2010 - 31.01.2010
    PO date: 10.01.2010 and GR date are suppose 15.01.2010, 22.01.2010 and 30.01.2010
    it showing me 14, 21 and 29
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                    Through replacement path.
    Thanks and Regards
    Lalit Kumar

  • I have an imac and I set up additional user accounts.  When I start up or restart the computer it only shows me the option of logging on as the system administrator and it does not show the other accounts for my wife and kids.

    When I start up my additional user accounts do not show so I can log onto them.   The same thing happens when I log out as the system admin.  How do I get to the additional accounts that I have set up on my imac so I can log in under them.   Thanks

    There is zero advantage to partitioning a HD for the purpose you have described. I recommend that you take your machine to an AASP, describe the problem and they will help you get it back working. Partitioning a HD is a 1990's approach and is of no value what-so-ever unless you installing multiple operating systems on the HD. In that case it would be valuable.
    Good luck.

  • OIM - How To not show the "Disable" option for a Resource object to a group

    Hello there,
    Is there anyway we can remove or don't show the option to "Disable" a already provisioned resource object ?
    I have a requirement over here wherein there is no reason available to show the "disable" option out of the 3 available - "enable", "disable" and "revoke" for an already provisioned RO.
    How can we remove it ? We don't want users belonging to a specific group see that option, at all.
    Is there any menu item associated with it ? or is there any other way we can configure it ?
    Please advise to the earliest.
    Thanks !!
    P.S.: this is OIM 9102 running on solaris.
    Edited by: 786001 on Oct 13, 2010 7:22 PM

    Modify JSP:
    And to do this just for a particular group, put your java code in JSP itself. This is the easiest approach.
    Otherwise you can modify the action class to return two action forwards and then use two different JSP's.
    Thanks
    Sunny

  • Asset report S_ALR_87011963 is not showing the asset values for perion 08

    Hi,
         The internal order number is 400011.The amount 38,300 were booked on this order. I have settled  38,050 into 7 assets hence the balance is 250 in this internal order (Work in progress 100050).
    When i check the Asset expolorer, there it is showing me this remaining value. But when i run any asset report, say Transaction code - S_ALR_87011963(Asset balances) with report date as 30/05/2008 for period 8, the asset 100050 is showing as NIL Value. But if i run it with date as 30/09/2008 for period 12, then it is showing the balance amount.Our fiscal year is frorm Oct- Sep.
    I don't understand why this difference is coming. It should show the balance 250 at the end of period 8.
    The last input on this internal order was in March 08 when I transfered most of the costs to the assets.So no reason to have a difference depending on the date of the report.
    The internal order 400011 is having status as Released at present.
    Can anyboday help me on this. Points will awarded.
    Earliest reply will be highly appreciated.
    Regards,
    Shree.j

    Hi Rau,
    Could you please me How to Upload the GL or Open Item Balances on Month to Month Basis? for this we still use FB01 for Initial Upload?
    My Client is giving the balance for last year Monthly with daily Transactions with past Posting dates obviously,do I need to Upload with same Posting dates or with Current Posting date?
    For reporting Purpose My Client would like to see Monthly Balances of Open items for Initial Upload,"is this same as Month to Month Upload you advised above"?
    What is the Difference b/w Month to Month ORr Just one Amount as total balance uploaded to SAP? which is Best Practice before Initial Upload?
    Thank you ,
    Paarthaa...

  • Packaged PDF not showing the navigation sidebar for individual PDFs

    I've created a PDF Ebook as a Package, where individual PDFs are the chapters. My client tells me that some of the customers cannot see the left navigation panel showing all the "chapters", and therefore can only see the cover sheet PDF
    I haven't been able to see if there's a setting I missed during assembly, and yet I can see the navigation panels when the file is opened in Acrobat Pro 8.1.7 and Reader 9.2.
    Would this be a setting that a user needs to have turned on? Or did I not check something during final assembly and saving? I can't seem to find anything in my Acrobat Help files about this.
    Thanks for any help!
    David

    May be that the font is not embedded in the PDF file.

  • Multiple Executions Plans for the same SQL statement

    Dear experts,
    awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.
    Below is the awrsqrpt's output for your reference.
    WORKLOAD REPOSITORY SQL Report
    Snapshot Period Summary
    DB Name         DB Id    Instance     Inst Num Release     RAC Host
    TESTDB          2157605839 TESTDB1               1 10.2.0.3.0  YES testhost1
                  Snap Id      Snap Time      Sessions Curs/Sess
    Begin Snap:     32541 11-Oct-08 21:00:13       248     141.1
      End Snap:     32542 11-Oct-08 21:15:06       245     143.4
       Elapsed:               14.88 (mins)
       DB Time:               12.18 (mins)
    SQL Summary                            DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
                    Elapsed
       SQL Id      Time (ms)
    51szt7b736bmg     25,131
    Module: SQL*Plus
    UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL,
    0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE
    TEST_BATCH_DT = (:B1 )
    SQL ID: 51szt7b736bmg                  DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> 1st Capture and Last Capture Snap IDs
       refer to Snapshot IDs witin the snapshot range
    -> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC...
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    1   2960830398                 25,131             1         32542          32542
    2   3834848140                      0             0         32542          32542
    Plan 1(PHV: 2960830398)
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                            25,131       25,130.7     3.4
    CPU Time (ms)                                23,270       23,270.2     3.9
    Executions                                        1            N/A     N/A
    Buffer Gets                               2,626,166    2,626,166.0    14.6
    Disk Reads                                      305          305.0     0.3
    Parse Calls                                       1            1.0     0.0
    Rows                                        371,735      371,735.0     N/A
    User I/O Wait Time (ms)                         564            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                 26            N/A     N/A
    Execution Plan
    | Id  | Operation                    | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT             |                 |       |       |  1110 (100)|          |
    |   1 |  UPDATE                      | TEST            |       |       |            |          |
    |   2 |   TABLE ACCESS FULL          | TEST            |   116K|  2740K|  1110   (2)| 00:00:14 |
    |   3 |   TABLE ACCESS BY INDEX ROWID| ACCT            |     1 |    26 |     5   (0)| 00:00:01 |
    |   4 |    INDEX RANGE SCAN          | ACCT_DT_ACC_IDX |     1 |       |     4   (0)| 00:00:01 |
    Plan 2(PHV: 3834848140)
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                                 0            N/A     0.0
    CPU Time (ms)                                     0            N/A     0.0
    Executions                                        0            N/A     N/A
    Buffer Gets                                       0            N/A     0.0
    Disk Reads                                        0            N/A     0.0
    Parse Calls                                       0            N/A     0.0
    Rows                                              0            N/A     N/A
    User I/O Wait Time (ms)                           0            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                 26            N/A     N/A
    Execution Plan
    | Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT             |              |       |       |     2 (100)|          |
    |   1 |  UPDATE                      | TEST         |       |       |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID| TEST         |     1 |    28 |     2   (0)| 00:00:01 |
    |   3 |    INDEX RANGE SCAN          | TEST_DT_IND  |     1 |       |     1   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS BY INDEX ROWID| ACCT         |     1 |    26 |     4   (0)| 00:00:01 |
    |   5 |    INDEX RANGE SCAN          | INDX_ACCT_DT |     1 |       |     3   (0)| 00:00:01 |
    Full SQL Text
    SQL ID       SQL Text
    51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) +
                  NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB
                 RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )Your input is highly appreciated.
    Thanks for taking your time in answering my question.
    Regards

    Oracle Lover3 wrote:
    Dear experts,
    awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.If you're using bind variables and you've histograms on your columns which can be created by default in 10g due to the "SIZE AUTO" default "method_opt" parameter of DBMS_STATS.GATHER__STATS it is quite normal that you get different execution plans for the same SQL statement. Depending on the values passed when the statement is hard parsed (this feature is called "bind variable peeking" and enabled by default since 9i) an execution plan is determined and re-used for all further executions of the same "shared" SQL statement.
    If now your statement ages out of the shared pool or is invalidated due to some DDL or statistics gathering activity it will be re-parsed and again the values passed in that particular moment will determine the execution plan. If you have skewed data distribution and a histogram in place that reflects that skewness you might get different execution plans depending on the actual values used.
    Since this "flip-flop" behaviour can sometimes be counter-productive if you're unlucky and the values used to hard parse the statement leading to a plan that is unsuitable for the majority of values used afterwards, 11g introduced the "adaptive" cursor sharing that attempts to detect such a situation and can automatically re-evaluate the execution plan of the statement.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Trace generation is not producing the detail trace for queries in the block

    For example one.sql file contains below stmts
    begin
    query1;
    query2;
    query3;
    end;
    Alter session set sql_trace = TRUE;
    alter session set tracefile_identifier='7g26trc2' events '10046 trace name context forever, level 12';
    @one.sql
    ! tkprof filename.trc plan.tkp It gives the segmentation fault error.
    In the plan.tkp contains only the cost for the while one.sql it is not showing the plans and cost for query1,query2,query3,

    Please try to be clear.
    Normally the execution plans are in the raw trace files.
    This will only happen if the session exited normally (ie issued an (implicit) commit)
    If there are no execution plans in the trace file you will still be able to get them using the explain=<username/password>@service syntax in the tkprof command line. Please be aware in this case tkprof will determine the execution plans, and tkprof doesn't know the exact datatype of literals.
    Did you notice the tkprof session ended in a segmentation fault. Is the trace file huge?
    events 10046 trace name context forever, level 4 will show you what your session is waiting for. 10046 trace name context forever, level 8 will show you bind variables.
    10046 trace name context forever, level 12 will show both.
    10046 trace name context off will disable the event.
    sql_trace=true is equivalent to 10046 trace name context forever, level 1.
    Obviously this is documented on Metalink and in many books.
    Sybrand Bakker
    Senior Oracle DBA
    Sybrand Bakker
    Senior Oracle DBA

  • How can I get an execution plan for a Function in oracle 10g

    Hi
    I have:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    I would like to know if is possible to get an EXECUTION PLAN for a FUNCTION if so, how can I get it ?
    Regards

    You can query the AWR data if your interesting SQL consumes enough resources.
    Here is a SQL*Plus script I call MostCPUIntensiveSQLDuringInterval.sql (nice name eh?)
    You'll need to know the AWR snap_id numbers for the time period of interest, then run it like this to show the top 20 SQLs during the interval:
    @MostCPUIntensiveSQLDuringInterval 20The script outputs a statement to run when you are interested in looking at the plan for an interesting looking statement.
    -- MostCPUintesticeSQLDuringInterval: Report on the top n SQL statements during an AWR snapshot interval.
    -- The top statements are ranked by CPU usage
    col inst_no             format      999 heading 'RAC|Node'
    col sql_id              format a16      heading 'SQL_ID'
    col plan_hash_value     format 999999999999 heading 'Plan|hash_value'
    col parsing_schema_name format a12      heading 'Parsing|Schema'
    col module              format a10      heading 'Module'
    col pct_of_total   format        999.99 heading '% Total'
    col cpu_time       format   999,999,999 heading 'CPU     |Time (ms)'
    col elapsed_time   format   999,999,999 heading 'Elapsed |Time (ms)'
    col lios           format 9,999,999,999 heading 'Logical|Reads'
    col pios           format   999,999,999 heading 'Physical|Reads'
    col execs          format    99,999,999 heading 'Executions'
    col fetches        format    99,999,999 heading 'Fetches'
    col sorts          format       999,999 heading 'Sorts'
    col parse_calls    format       999,999 heading 'Parse|Calls'
    col rows_processed format   999,999,999 heading 'Rows|Processed'
    col iowaits        format   999,999,999,999 heading 'iowaits'
    set lines 195
    set pages 75
    PROMPT Top &&1 SQL statements during interval
    SELECT diff.*
    FROM (SELECT e.instance_number inst_no
                ,e.sql_id
                ,e.plan_hash_value
                ,e.parsing_schema_name
                ,substr(trim(e.module),1,10) module
                ,ratio_to_report(e.cpu_time_total - b.cpu_time_total) over (partition by 1) * 100 pct_of_total
                ,(e.cpu_time_total - b.cpu_time_total)/1000 cpu_time
                ,(e.elapsed_time_total - b.elapsed_time_total)/1000 elapsed_time
                ,e.buffer_gets_total - b.buffer_gets_total lios
                ,e.disk_reads_total - b.disk_reads_total pios
                ,e.executions_total - b.executions_total execs
                ,e.fetches_total - b.fetches_total fetches
                ,e.sorts_total - b.sorts_total sorts
                ,e.parse_calls_total - b.parse_calls_total parse_calls
                ,e.rows_processed_total - b.rows_processed_total rows_processed
    --            ,e.iowait_total - b.iowait_total iowaits
    --            ,e.plsexec_time_total - b.plsexec_time_total plsql_time
          FROM dba_hist_sqlstat b  -- begining snap
              ,dba_hist_sqlstat e  -- ending snap
          WHERE b.sql_id = e.sql_id
          AND   b.dbid   = e.dbid
          AND   b.instance_number = e.instance_number
          and   b.plan_hash_value = e.plan_hash_value
          AND   b.snap_id = &LowSnapID
          AND   e.snap_id = &HighSnapID
          ORDER BY e.cpu_time_total - b.cpu_time_total DESC
         ) diff
    WHERE ROWNUM <=&&1
    set define off
    prompt  to get the text of the SQL run the following:
    prompt  @id2sql &SQL_id
    prompt .
    prompt  to obtain the execution plan for a session run the following:
    prompt  select * from table(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID'));
    prompt  or
    prompt  select * from table(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID',NULL,NULL,'ALL'));
    prompt .
    set define on
    undefine LowSnapID
    undefine HighSnapIDI guess you'll need the companion script id2sql.sql, so here it is:
    set lines 190
    set verify off
    declare
       maxDisplayLine  NUMBER := 150;  --max linesize to display the SQL
       WorkingLine     VARCHAR2(32000);
       CurrentLine     VARCHAR2(64);
       LineBreak       NUMBER;
       cursor ddl_cur is
          select sql_id
            ,sql_text
          from v$sqltext_with_newlines
          where sql_id='&1'
          order by piece
       ddlRec ddl_cur%ROWTYPE;
    begin
       WorkingLine :='.';
       OPEN ddl_cur;
       LOOP
          FETCH ddl_cur INTO ddlRec;
          EXIT WHEN ddl_cur%NOTFOUND;
          IF ddl_cur%ROWCOUNT = 1 THEN
             dbms_output.put_line('.');
             dbms_output.put_line('   sql_id: '||ddlRec.sql_id);
             dbms_output.put_line('.');
             dbms_output.put_line('.');
             dbms_output.put_line('SQL Text');
             dbms_output.put_line('----------------------------------------------------------------');
          END IF;
          CurrentLine := ddlRec.sql_text;
          WHILE LENGTH(CurrentLine) > 1 LOOP
             IF INSTR(CurrentLine,CHR(10)) > 0 THEN -- if the current line has an embeded newline
                WorkingLine := WorkingLine||SUBSTR(CurrentLine,1,INSTR(CurrentLine,CHR(10))-1);  -- append up to new line
                CurrentLine := SUBSTR(CurrentLine,INSTR(CurrentLine,CHR(10))+1);  -- strip off up through new line character
                dbms_output.put_line(WorkingLine);  -- print the WorkingLine
                WorkingLine :='';                   -- reset the working line
             ELSE
                WorkingLine := WorkingLine||CurrentLine;  -- append the current line
                CurrentLine :='';  -- the rest of the line has been processed
                IF LENGTH(WorkingLine) > maxDisplayLine THEN   -- the line is morethan the display limit
                   LineBreak := instr(substr(WorkingLine,1,maxDisplayLine),' ',-1); --find the last space before the display limit
                   IF LineBreak = 0 THEN -- there is no space, so look for a comma instead
                      LineBreak := substr(WorkingLine,instr(substr(WorkingLine,1,maxDisplayLine),',',-1));
                   END IF;
                   IF LineBreak = 0 THEN -- no space or comma, so force the line break at maxDisplayLine
                     LineBreak := maxDisplayLine;
                   END IF;
                   dbms_output.put_line(substr(WorkingLine,1,LineBreak));
                   WorkingLine:=substr(WorkingLine,LineBreak);
                END IF;
             END IF;
          END LOOP;
          --dbms_output.put(ddlRec.sql_text);
       END LOOP;
       dbms_output.put_line(WorkingLine);
       dbms_output.put_line('----------------------------------------------------------------');
       CLOSE ddl_cur;
    END;
    /

  • How i can find the execution plan

    how i can find the execution plan for a quesry , and how i can compare two execution plan

    Mohan,
    Just create a table as follows
    CREATE TABLE T1 (STATEMENT_ID VARCHAR2(30),TIMESTAMP DATE,OPERATION VARCHAR2(30),
              OPTIONS VARCHAR2(30),OBJECT_NAME VARCHAR2(30),COST NUMBER(38),
              ID NUMBER(38),PARENT_ID NUMBER(38), OBJECT_NODE VARCHAR2(128),
              OBJECT_OWNER VARCHAR2(30),OBJECT_INSTANCE NUMBER(38),OBJECT_TYPE VARCHAR2(30),
              OPTIMIZER VARCHAR2(255),SEARCH_COLUMNS NUMBER,POSITION NUMBER(38),
              PARTITION_START VARCHAR2(255),PARTITION_STOP VARCHAR2(255),PARTITION_ID NUMBER(38),
              CARDINALITY NUMBER(38),BYTES NUMBER(38),OTHER_TAG VARCHAR2(255),
              OTHER LONG,REMARKS VARCHAR2(80),DISTRIBUTION VARCHAR2(30)
    Now use the sql statements as
    > EXPLAIN PLAN INTO T1 FOR (SELECT * FROM EMP);
    > Select * from T1
    this should do the job . . .
    Regards,
    K.T. Gandhi Karuna

  • Tool to find the execution plan of a SQL query

    Hi,
    I new to Oracle. I come from the SQL Server world.
    I would like to know what tool(s) should I use to identify the execution plan for a SQL statement and to see if a query is missing indices.
    Thanks,
    Paul

    Use SQL*PLUS.
    SQL> select dummy from dual;
    D
    X
    SQL> set autotrace on explain
    SQL> r
      1* select dummy from dual
    D
    X
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=2)
       1    0   TABLE ACCESS (FULL) OF 'DUAL' (TABLE) (Cost=2 Card=1 Bytes
              =2)
    SQL> set autot off
    SQL> explain plan for select dummy from dual;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1157671242
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    8 rows selected.
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options
    SQL>

  • Scan count 17 logical reads 176543 showing in execution plan

    Hello,
    I am getting scan count 17 and logical reads 145634 and some time the query takes 2 minutes and sometime 5 seconds.Thelogical reads showing against a big table(Product and Orders) that is having 10 milions records.After procedure executed it gives only 7008
    records as out put.
    SELECT Cust.Name
    FROM  dbo.Customers Cust WITH (NOLOCK)
    INNER JOIN Products Prod WITH (NOLOCK) ON Cust.ID = Prod.CustID
    INNER JOIN dbo.Orders  Ords WITH (NOLOCK) on Cust.RepID = prod.ProdId
    INNER JOIN dbo.[Address] Adds WITH (NOLOCK) on Prod.id = Adds.Id 
    WHERE ords.pickeddate between @startdate and @enddate
    Please do the needful.

    >>>>How to reduce logical reads against big tables?
    Have a useful index/s . But please show the execution plan of the query as David pointed.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Out of the box execution plan for Payables EBS 11.5.10

    Has anyone else experienced performance issues with the out of the box execution plan for the Payables subject area for Oracle EBS 11.5.10? Our incremental ETL for this particular subject area is taking 8+ hours. I understand that there are several factors involved with performance and that there are a lot of AP transactions, but this is ridiculous for a nightly incremental ETL job.
    In particular it is the SDE_ORA_APTransactionFact_Payment task that is taking forever. This query appears to have extremely high cost (see explain plan below). Has anyone been successful in rewriting or changing this query?
    SELECT STATEMENT  ALL_ROWSCost: 586,953  Bytes: 16,550  Cardinality: 50                                                                         
                13 NESTED LOOPS OUTER  Cost: 586,953  Bytes: 16,550  Cardinality: 50                                                         
                            10 NESTED LOOPS  Cost: 586,952  Bytes: 15,800  Cardinality: 50                                             
                                        7 HASH JOIN  Cost: 468,320  Bytes: 11,693,526  Cardinality: 59,358                               
                                                    5 HASH JOIN  Cost: 429,964  Bytes: 9,200,490  Cardinality: 59,358                     
                                                                3 HASH JOIN  Cost: 366,009  Bytes: 7,740,544  Cardinality: 60,473         
                                                                            1 TABLE ACCESS FULL TABLE AP.AP_AE_LINES_ALL Cost: 273,240  Bytes: 15,212,604  Cardinality: 230,494 
                                                                            2 TABLE ACCESS FULL TABLE AP.AP_INVOICE_PAYMENTS_ALL Cost: 45,211  Bytes: 715,512,860  Cardinality: 11,540,530 
                                                                4 TABLE ACCESS FULL TABLE AP.AP_PAYMENT_SCHEDULES_ALL Cost: 39,003  Bytes: 309,648,420  Cardinality: 11,468,460       
                                                    6 TABLE ACCESS FULL TABLE AP.AP_CHECKS_ALL Cost: 28,675  Bytes: 130,126,920  Cardinality: 3,098,260               
                                        9 TABLE ACCESS BY INDEX ROWID TABLE AP.AP_INVOICES_ALL Cost: 2  Bytes: 119  Cardinality: 1                                 
                                                    8 INDEX UNIQUE SCAN INDEX (UNIQUE) AP.AP_INVOICES_U1 Cost: 1  Cardinality: 1             
                            12 TABLE ACCESS BY INDEX ROWID TABLE PO.PO_HEADERS_ALL Cost: 1  Bytes: 15  Cardinality: 1                                                 
                                        11 INDEX UNIQUE SCAN INDEX (UNIQUE) PO.PO_HEADERS_U1 Cost: 1  Cardinality: 1                       

    Hi Srini, All,
    Thanks for the reply.
    The payables documentation (i.e. User Guide) discusses about options that could be used in implementing EFT. However, if possible, we would like suggestions on what would be the better ways to implement EFT (US bank) using either XML or text formats. We would also prefer not using e-commerce gateway or EDI.
    Thanks in advance.
    MM

  • Router 7606 does not show the inventory for the Fan module

    I have a issue with a router 7606, specifically with  fan module, the LC go down because it does have sufficiently cooling , I changed the Fan module, the IOS, The power supply, and I still have the same issue, Besides the Router does not show the inventory or PID  for module fan, 
    logg" system minor alarm on operating fan count"
    Someone knows what could be happening,

    Check this:
    Can you try this;
    7606-01#show environment status fan-tray 1
    fan-tray 1: 
      fan-tray 1 type: FAN-MOD-6SHS
      fan-tray 1 mode: Auto
      fan-tray 1 fan-fail: OK
    7606-01#show power
    Fan  Type               Watts   A @42V State
    1    FAN-MOD-6SHS        180.18  4.29  OK............................ FAn try
    If above doesnt work then try the below link:
    https://supportforums.cisco.com/discussion/10824271/7606-s-and-fan-module-6shs-version-1
    HTH
    inayath
    *Plz dont forget to rate if this info is helpfull.

Maybe you are looking for