SQL> select * from table(dbms_xplan.display_cursor(null,null));
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------
SQL_ID a67wqmkfb9j65, child number 0
-------------------------------------
SELECT ename,dname,loc FROM emp e, dept d WHERE e.deptno = d.deptno AND
e.empno = 7788
SQL> select sql_id,address,plan_hash_value,hash_value,child_number from v$sql
2 where sql_text like '%SELECT ename%' and sql_text not like '%from v$sql%';
/*-------------- 传递SQL_ID以及format参数,并配合修饰符控制执行计划的输出 ------------------------*/
SQL> select * from table(dbms_xplan.display_cursor('a67wqmkfb9j65',null,'typical -predicate -rows'));
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------
SQL_ID a67wqmkfb9j65, child number 0
-------------------------------------
SELECT ename,dname,loc FROM emp e, dept d WHERE e.deptno = d.deptno
AND e.empno = 7788