[20160516]SQL共享游標的測試疑問.txt
[20160516]SQL共享游標的測試疑問.txt
--昨天我看了連結http://blog.itpub.net/17203031/viewspace-754994/,感覺他的測試有問題,不可能相同的sql語句,而sql_id會不一樣
--的.我自己測試看看.
1.環境:
SYS@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
--分別以sys,scott使用者建立表T:
create table t as select * from dba_objects;
2.測試
--sys使用者:
select /*+ DEMO */count(*) from t where owner='SCOTT';
--sql_id='0cmtuq6zf22px'
--SCOTT使用者:
select /*+ DEMO */count(*) from t where owner='SCOTT';
--sql_id='0cmtuq6zf22px'
SYS@book> select sql_id, version_count, executions, USERS_EXECUTING, PARSING_SCHEMA_NAME from v$sqlarea where sql_text like 'select /*+ DEMO */%';
SQL_ID VERSION_COUNT EXECUTIONS USERS_EXECUTING PARSING_SCHEMA_NAME
------------- ------------- ---------- --------------- --------------------
0cmtuq6zf22px 2 2 0 SCOTT
SYS@book> select sql_id, child_number , executions, USERS_EXECUTING, PARSING_SCHEMA_NAME from v$sql where sql_text like 'select /*+ DEMO */%';
SQL_ID CHILD_NUMBER EXECUTIONS USERS_EXECUTING PARSING_SCHEMA_NAME
------------- ------------ ---------- --------------- --------------------
0cmtuq6zf22px 0 1 0 SYS
0cmtuq6zf22px 1 1 0 SCOTT
--而作者的測試居然不一樣.感覺非常奇怪.這讓我突然想起toad的老版本會在sql語句上自動補一個空格,感覺作者應該會使用PLSQL
--Developer,我也測試看看:
SYS@book> select sql_id, child_number , executions, USERS_EXECUTING, PARSING_SCHEMA_NAME from v$sql where sql_text like 'select /*+ DEMO */%';
SQL_ID CHILD_NUMBER EXECUTIONS USERS_EXECUTING PARSING_SCHEMA_NAME
------------- ------------ ---------- --------------- ------------------------------
gp5x6kaz2whwu 0 1 0 SCOTT
0cmtuq6zf22px 0 1 0 SYS
0cmtuq6zf22px 1 1 0 SCOTT
--很明顯PLSQL Developer也會"格式化指令碼".
SYS@book> select sql_id, dump(sql_text,16) c100 ,child_number , executions, USERS_EXECUTING, PARSING_SCHEMA_NAME from v$sql where sql_text like 'select /*+ DEMO */%';
SQL_ID C100 CHILD_NUMBER EXECUTIONS USERS_EXECUTING PARSING_SCHEMA_NAME
------------- ---------------------------------------------------------------------------------------------------- ------------ ---------- --------------- ------------------------------
gp5x6kaz2whwu Typ=1 Len=54: 73,65,6c,65,63,74,20,2f,2a,2b,20,44,45,4d,4f,20,2a,2f,63,6f,75,6e,74,28,2a,29,20,66,72 0 1 0 SCOTT
,6f,6d,20,74,20,77,68,65,72,65,20,6f,77,6e,65,72,3d,27,53,43,4f,54,54,27,20
0cmtuq6zf22px Typ=1 Len=53: 73,65,6c,65,63,74,20,2f,2a,2b,20,44,45,4d,4f,20,2a,2f,63,6f,75,6e,74,28,2a,29,20,66,72 0 1 0 SYS
,6f,6d,20,74,20,77,68,65,72,65,20,6f,77,6e,65,72,3d,27,53,43,4f,54,54,27
0cmtuq6zf22px Typ=1 Len=53: 73,65,6c,65,63,74,20,2f,2a,2b,20,44,45,4d,4f,20,2a,2f,63,6f,75,6e,74,28,2a,29,20,66,72 1 1 0 SCOTT
,6f,6d,20,74,20,77,68,65,72,65,20,6f,77,6e,65,72,3d,27,53,43,4f,54,54,27
--很明顯PLSQL Developer也會在後面加一個空格.但是我無法得到作者測試5x21uhnky7bnb.
--BTW 我的PLSQL Developer版本是6.0.0.840.
SYS@book> @ &r/share 0cmtuq6zf22px
SQL_TEXT = select /*+ DEMO */count(*) from t where owner='SCOTT'
SQL_ID = 0cmtuq6zf22px
ADDRESS = 000000007D487178
CHILD_ADDRESS = 000000007D9B7150
CHILD_NUMBER = 0
REASON = <ChildNode><ChildNumber>0</ChildNumber><ID>37</ID><reason>Authorization Check
failed(4)</reason><size>5x4</size><translation_table_position>0</translation_table_position><original_handle>2120444968</original_handle><temp_handle>2101839128</temp_handle><schema>83</schema><synonym_object_number>0</synonym_object_number></ChildNode>
--------------------------------------------------
SQL_TEXT = select /*+ DEMO */count(*) from t where owner='SCOTT'
SQL_ID = 0cmtuq6zf22px
ADDRESS = 000000007D487178
CHILD_ADDRESS = 000000007D456048
CHILD_NUMBER = 1
AUTH_CHECK_MISMATCH = Y
TRANSLATION_MISMATCH = Y
REASON =
--------------------------------------------------
PL/SQL procedure successfully completed.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2100659/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20210812]測試sql語句子游標的效能.txtSQL
- [20210818]測試sql語句子游標的效能4.txtSQL
- [20210816]測試sql語句子游標的效能3.txtSQL
- [20210813]關於測試sql語句子游標的效能的一些補充說明.txtSQL
- [20160407]sql語句父子游標的堆轉儲.txtSQL
- Oracle遊標共享,父遊標和子游標的概念Oracle
- [20161228]sql語句父子游標的堆轉儲2.txtSQL
- [20220304]測試library cache mutex遇到的疑問.txtMutex
- 關於 ui 自動化測試 driver 疑問?UI
- Android 滑鼠游標的圖形合成Android
- 控制input輸入框游標的位置
- jmock 進行單元測試的一些疑問Mock
- 關於 K8S 在測試中的疑問K8S
- 深入理解父遊標,子游標的概念
- 操作文字域內游標的jQuery程式碼jQuery
- [20160516]統計分析引數method_opt.txt
- [20220328]查詢游標為什麼不共享指令碼.txt指令碼
- Stax處理XML(一)——基於游標的查詢XML
- [20160215]超長sql語句與父子游標.txtSQL
- 0821Cache Buffers chains與共享模式疑問4AI模式
- 0330Cache Buffers chains與共享模式疑問AI模式
- SQL PROFILE 測試SQL
- [20190411]linux stat 命令疑問.txtLinux
- Jest 單元測試疑難點入門
- 安卓 unit 測試與 instrument 測試的程式碼共享安卓
- [20200129]子游標不共享BIND_EQUIV_FAILURE.txtUIAI
- [20220420]完善查詢游標為什麼不共享指令碼.txt指令碼
- 【CURSOR】Oracle 子游標無法共享的原因之V$SQL_SHARED_CURSOROracleSQL
- [20210419]測試18c SQL Translation Framework.txtSQLFramework
- SQL SERVER 遊標的使用SQLServer
- Spring、Spring Boot和TestNG測試指南 – 共享測試配置Spring Boot
- 0330Cache Buffers chains與共享模式疑問2AI模式
- 1104Cache Buffers chains與共享模式疑問3AI模式
- 1104Cache Buffers chains與共享模式疑問4AI模式
- [20160606]windows下使用bbed的疑問.txtWindows
- SQL MAP 注入測試SQL
- Prepared SQL 效能測試SQL
- 疑問:mybatis如何自定義SQL執行時長MyBatisSQL