在pl/sql developer中,直接写条sql,按F5,就可以调出执行计划,但在只有sql plus的情况下,只能用下面这个语句了,
explain plan for select ....
然后再来一句
select * from table(dbms_xplan.display());
就会出现一个类似下面的信息
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | |
| 1 | NESTED LOOPS | | | | |
| 2 | TABLE ACCESS FULL | AC01 | | | |
| 3 | TABLE ACCESS BY INDEX ROWID| AB01 | | | |
| 4 | INDEX UNIQUE SCAN | PK_AB01 | | | |
----------------------------------------------------------------------------
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Note: rule based optimization, PLAN_TABLE' is old version
就能看到执行计划了。
我的微博
http://t.sina.com.cn/1401900445