酷酷娱乐网

站内广告

[20190720]12cR2显示执行计划.txt

时间:2020-09-15 15:00:04   作者:酷酷娱乐网   来源:www.kukuyl.com  
内容摘要:


[20190720]12cR2显示执行计划.txt


--//12c R2 可以显示执行计划,不要使用tab......

[20190720]12cR2显示执行计划.txt

--//12c R2 可以显示执行计划,不要使用table。
--//以前看别人的贴子调用dbms_xplan.display_cursor发现执行报错。原来要12cR2才可以这样。12CR1不行。

1.环境:
SCOTT@test01p> @ ver1
PORT_STRING                    VERSION        BANNER                                                                               CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0           12.2.0.1.0     Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production              0

$ cat dpcn.sql
set verify off
--select * from table(dbms_xplan.display_cursor(NVL('&1',NULL),NULL,'ALLSTATS LAST PEEKED_BINDS &2 cost partition'));

select * from dbms_xplan.display_cursor(NVL('&1',NULL),NULL,'ALL ALLSTATS LAST PEEKED_BINDS cost partition -projection -outline &2');

prompt
prompt argment : typical all advanced partition predicate remote note parallel projection alias peeked_binds outline adaptive
prompt

2.测试:

SCOTT@test01p> alter session set statistics_level = all;
Session altered.

SCOTT@test01p> select SYSDATE from dual;
SYSDATE
-------------------
2019-07-20 18:55:17

SCOTT@test01p> @dpcn '' ''
PLAN_TABLE_OUTPUT
-------------------------------------
SQL_ID  5q9sgumphjt9z, child number 1
-------------------------------------
select SYSDATE from dual
Plan hash value: 1388734953
-------------------------------------------------------------------------------------------------
| Id  | Operation        | Name | Starts | E-Rows | Cost (%CPU)| E-Time   | A-Rows |   A-Time   |
-------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT |      |      1 |        |     2 (100)|          |      1 |00:00:00.01 |
|   1 |  FAST DUAL       |      |      1 |      1 |     2   (0)| 00:00:01 |      1 |00:00:00.01 |
-------------------------------------------------------------------------------------------------
Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------
   1 - SEL$1 / DUAL@SEL$1

本文章url:https://www.kukuyl.com/new/30000590.html

相关文章

CopyRight 2018 - 2020 http://www.kukuyl.com 酷酷娱乐网 All Rights Reserved .