oracle 9i sql_id,9i and 10g 通过SQL_ADDRESS 或sql_id查询执行计划

V$SQL_PLAN, DBMS_XPLAN.DISPLAY_CURSOR:

If you know sql_id or the set of (hash_value, address) of the shared cursor, you can get the correct plan using V$SQL_PLAN or DBMS_XPLAN.DISPLAY_CURSOR.  Make sure the calling user has privileges on fixed following views: V$SQL_PLAN_STATISTICS_ALL, V$SQL and V$SQL_PLAN.

-- For 9i and later

col operation for a20

col object_name for a20

col options for a20

col optimizer for a12

col child_number a3

SELECT child_number, id , lpad (' ', depth) || operation operation , options , object_name , optimizer , cost

FROM V$SQL_PLAN

WHERE hash_value = &hash_value

AND address = '&address'

ORDER BY child_number, id;

-- For 10g and later

col operation for a20

col object_name for a20

col options for a20

col optimizer for a12

col child_number a3

SELECT child_number, id , lpad (' ', depth) || operation operation , options , object_name , optimizer , cost

FROM V$SQL_PLAN

WHERE sql_id = '&sql_id'

ORDER BY child_number, id;

select * from table(dbms_xplan.display_cursor('&sql_id', NULL, 'ALL'));

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31520497/viewspace-2156891/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值