1、drop table PLAN_TABLE ;
2、拷贝D:\app\client\Steven\product\12.1.0\client_1\RDBMS\ADMIN\utlxplan.sql里的sql语句,去掉sharing=none
3、SETAUTOTRACEON
sql> SET AUTOTRACE ON sql> SELECT SYSDATE FROM DUAL; SYSDATE -------------- 15-10月-16 执行计划 ---------------------------------------------------------- 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 | ----------------------------------------------------------------- 统计信息 ---------------------------------------------------------- 1 recursive calls 0 db block gets 0 consistent gets 0 physical reads 0 redo size 531 bytes sent via sql*Net to client 520 bytes received via sql*Net from client 2 sql*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed
2、Toad查看计划
接着输入sql语句按CTRL+E即可