Home » RDBMS Server » Server Administration » Execution plan
Execution plan [message #56763] Tue, 22 April 2003 23:46 Go to next message
Manish tiwari
Messages: 6
Registered: April 2003
Junior Member
Hello ever body

How can i see only the exectution plan of my query .....i do not want to see the result only the execution pln .....
i mean which alter session commnad can help me

Thx
Re: Execution plan [message #56770 is a reply to message #56763] Wed, 23 April 2003 06:58 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
mag@itloaner1_local > @c:oracleora81rdbmsadminutlxplan.sql

Table created.

mag@itloaner1_local > set autotrace on
mag@itloaner1_local > select * from dept;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
        40 OPERATIONS     BOSTON
        30 SALES          CHICAGO
        20 RESEARCH       DALLAS
        10 ACCOUNTING     NEW YORK

8 rows selected.

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE
   1    0   TABLE ACCESS (FULL) OF 'DEPT'

Statistics
----------------------------------------------------------
         29  recursive calls
          4  db block gets
          4  consistent gets
          0  physical reads
          0  redo size
        901  bytes sent via SQL*Net to client
        424  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          8  rows processed

Re: Execution plan [message #56773 is a reply to message #56763] Wed, 23 April 2003 08:26 Go to previous messageGo to next message
Sanjay
Messages: 236
Registered: July 2000
Senior Member
SQL> explain plan for select * from dept;

SQL> @$ORACLE_HOME/rdbms/admin/utlxpls.sql

This will JUST show the execution plan for query with out actually running the query. The key is 'EXPLAIN PLAN FOR' before the SELECT statement.

If it complains that PLAN_TABLE is not created, then run this sql to create one.

SQL> @$ORACLE_HOME/rdbms/admin/utlxplan.sql

will create the PLAN_TABLE in the schema you are logged in.

Good luck.

One of the reasons I like is the Execution plan is shown with out actually running the query, saving time to actually tune the query for optimal use before you get your data.
Re: Execution plan [message #56775 is a reply to message #56763] Wed, 23 April 2003 08:47 Go to previous message
Michel Bartov
Messages: 35
Registered: February 2003
Member
I just posted an integrated set of GUI tools to administer and tune the Oracle database.
One of the many functions is to analyze SQL statements. This function generates an execution plan for the statement and also allows you to set different hints to generate different execution plans. You can also run the different scenarios and compare the execution time as well as various query statistics.
Feel free to contact me (michelbartov@yahoo.com). The link is http://www.barsoft.net/
Previous Topic: Oracle Installation
Next Topic: executing unix script from oracle proc
Goto Forum:
  


Current Time: Fri Sep 20 09:21:03 CDT 2024