码迷,mamicode.com
首页 > 数据库 > 详细

Common SQL for Oracle---(3)Check Execution Plan

时间:2015-04-21 18:30:02      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:oracle

---Check Execution Plan----

---sql_plan@awr

select plan_table_output from table (dbms_xplan.display_awr(‘&sql_id‘,null,null,‘ADVANCED +PEEKED_BINDS‘));


---all sql_plan@awr

SELECT A.INSTANCE_NUMBER,

       A.SNAP_ID,

       A.SQL_ID,

       A.PLAN_HASH_VALUE,

       to_char(b.begin_interval_time, ‘yyyy/mm/dd hh24:mi:ss‘)

  FROM DBA_HIST_SQLSTAT A, DBA_HIST_SNAPSHOT B

 WHERE SQL_ID = ‘3ug1bja99mtkv‘

   AND A.SNAP_ID = B.SNAP_ID

   

   

 ---all sql_plan cost@awr  

SELECT A.INSTANCE_NUMBER INST,A.OPTIMIZER_MODE OPT_MODE,A.OPTIMIZER_COST OPT_COST,A.MODULE,A.SQL_ID,

       A.PLAN_HASH_VALUE,TO_CHAR((B.BEGIN_INTERVAL_TIME),‘YYYY/MM/DD HH24:MI:SS‘) BEGIN_TIME

  FROM DBA_HIST_SQLSTAT A, DBA_HIST_SNAPSHOT B

 WHERE SQL_ID=LOWER(‘d8rjbdatc87pf‘)

   AND A.SNAP_ID=B.SNAP_ID

   AND A.INSTANCE_NUMBER=B.INSTANCE_NUMBER

 ORDER BY B.BEGIN_INTERVAL_TIME DESC


本文出自 “在路上” 博客,谢绝转载!

Common SQL for Oracle---(3)Check Execution Plan

标签:oracle

原文地址:http://genjason.blog.51cto.com/6330670/1636627

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!