温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

数据库中普通用户如何调用dbms_xplan.display_cursor查看执行计划

发布时间:2021-11-09 10:25:23 来源:亿速云 阅读:169 作者:小新 栏目:关系型数据库

这篇文章主要为大家展示了“数据库中普通用户如何调用dbms_xplan.display_cursor查看执行计划”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“数据库中普通用户如何调用dbms_xplan.display_cursor查看执行计划”这篇文章吧。

SQL> grant select on v_$session to mims;

SQL> grant select on v_$sql to mims;

SQL> grant select on v_$sql_plan to mims;

SQL> SELECT  /*+ gather_plan_statistics */  SECTION ,
  2         item
  3  FROM   eqrecipeitemmonitoring
  4  WHERE  eqpid = '2SOL15'
  5  AND    unitid = 'FB01'
  6  AND    recipeid = '480FN01-SC12-G2C8-SR'
  7  AND    filename ='Lightening.dat';

SECTION                                            ITEM
-------------------------------------------------- ----------------------------------------------------------------------------------------------------
Lightening Data                                    Controller ID 0
Lightening Data                                    Controller ID 1
Lightening Data                                    Controller ID 2
Lightening Data                                    Controller ID 3

SQL> select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST'));

PLAN_TABLE_OUTPUT
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------
SQL_ID  2mg58m5jxsw9v, child number 1
-------------------------------------
SELECT  /*+ gather_plan_statistics */  SECTION ,        item FROM
eqrecipeitemmonitoring WHERE  eqpid = :"SYS_B_0" AND    unitid =
:"SYS_B_1" AND    recipeid = :"SYS_B_2" AND    filename =:"SYS_B_3"

Plan hash value: 2230633342

---------------------------------------------------------------------------------------------------------------------
| Id  | Operation                        | Name                   | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
---------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                 |                        |      1 |        |      4 |00:00:00.01 |      43 |
|*  1 |  TABLE ACCESS BY INDEX ROWID     | EQRECIPEITEMMONITORING |      1 |      1 |      4 |00:00:00.01 |      43 |
|   2 |   BITMAP CONVERSION TO ROWIDS    |                        |      1 |        |     12 |00:00:00.01 |      33 |
|   3 |    BITMAP AND                    |                        |      1 |        |      1 |00:00:00.01 |      33 |
|   4 |     BITMAP CONVERSION FROM ROWIDS|                        |      1 |        |      1 |00:00:00.01 |      22 |
|*  5 |      INDEX RANGE SCAN            | MONITORING_RECIPEID    |      1 |   4778 |   4057 |00:00:00.01 |      22 |
|   6 |     BITMAP CONVERSION FROM ROWIDS|                        |      1 |        |      1 |00:00:00.01 |      11 |
|*  7 |      INDEX RANGE SCAN            | MONITORING_FILENAME    |      1 |   4778 |   1814 |00:00:00.01 |      11 |
---------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(("UNITID"=:SYS_B_1 AND "EQPID"=:SYS_B_0))
   5 - access("RECIPEID"=:SYS_B_2)
   7 - access("FILENAME"=:SYS_B_3)

以上是“数据库中普通用户如何调用dbms_xplan.display_cursor查看执行计划”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI