[20191119]測試dbms_system.wait_for_event.txt
[20191119]測試dbms_system.wait_for_event.txt
--//測試看看dbms_system.wait_for_event的延遲.
1.環境:
SYS@book> @ 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@book> @ desc_proc sys dbms_system wait_for_event
INPUT OWNER PACKAGE_NAME OBJECT_NAME
sample : @desc_proc sys dbms_stats gather_%_stats
OWNER PACKAGE_NAME OBJECT_NAME SEQUENCE ARGUMENT_NAME DATA_TYPE IN_OUT DEFAULTED
---------- -------------------- ------------------------------ ---------- -------------------- -------------------- --------- ----------
SYS DBMS_SYSTEM WAIT_FOR_EVENT 1 EVENT VARCHAR2 IN N
2 EXTENDED_ID BINARY_INTEGER IN N
3 TIMEOUT BINARY_INTEGER IN N
2.測試:
SCOTT@book> alter system flush buffer_cache;
System altered.
SCOTT@book> execute dbms_system.wait_for_event('db file scattered read',1,1);
BEGIN dbms_system.wait_for_event('db file scattered read',1,1); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_SYSTEM.WAIT_FOR_EVENT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
--//scott使用者許可權不夠.換成sys使用者測試看看.
alter system flush buffer_cache;
execute dbms_system.wait_for_event('db file scattered read',1,1);
SYS@book> select * from scott.dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
Elapsed: 00:00:00.00
--//恩並沒有效果,測試有問題.還是理解錯誤.
3.看一下文件,應該這麼測試:
--//實際上我的理解有誤.
SYS@book> set timing on
SYS@book> execute dbms_system.wait_for_event('db file scattered read',1,1);
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.00
SYS@book> execute dbms_system.wait_for_event('db file scattered read',1,2);
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.00
SYS@book> execute dbms_system.wait_for_event('db file scattered read',2,2);
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.00
SYS@book> execute dbms_system.wait_for_event('db file scattered read',3,2);
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.01
--//也就是直接模擬db file scattered read,輸入引數EXTENDED_ID表示什麼不懂.
4.跟蹤看看:
SYS@book> @ 10046on 12
old 1: alter session set events '10046 trace name context forever, level &1'
new 1: alter session set events '10046 trace name context forever, level 12'
Session altered.
Elapsed: 00:00:00.00
SYS@book> execute dbms_system.wait_for_event('db file scattered read',0,1);
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.00
SYS@book> @ 10046off
Session altered.
Elapsed: 00:00:00.00
*** 2019-11-19 16:59:01.373
WAIT #139830919647368: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=5541 tim=1574153941373299
*** 2019-11-19 16:59:07.563
WAIT #139830919647368: nam='SQL*Net message from client' ela= 6190131 driver id=1650815232 #bytes=1 p3=0 obj#=5541 tim=1574153947563516
CLOSE #139830919647368:c=0,e=26,dep=0,type=1,tim=1574153947563638
=====================
PARSING IN CURSOR #139830919639928 len=70 dep=0 uid=0 oct=47 lid=0 tim=1574153947565709 hv=1754337657 ad='7c356e60' sqlid='fpqb1vxn924bt'
BEGIN dbms_system.wait_for_event('db file scattered read',0,1); END;
END OF STMT
PARSE #139830919639928:c=1999,e=2009,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=1574153947565701
WAIT #139830919639928: nam='Disk file operations I/O' ela= 50 FileOperation=8 fileno=0 filetype=8 obj#=5541 tim=1574153947565866
*** 2019-11-19 16:59:08.566
WAIT #139830919639928: nam='db file scattered read' ela= 1000425 file#=0 block#=0 blocks=0 obj#=5541 tim=1574153948566430
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--//奇怪file#=0 block#=0 blocks=0 obj#=5541
EXEC #139830919639928:c=0,e=1000606,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=0,tim=1574153948566524
WAIT #139830919639928: nam='SQL*Net message to client' ela= 2 driver id=1650815232 #bytes=1 p3=0 obj#=5541 tim=1574153948566599
*** 2019-11-19 16:59:12.524
WAIT #139830919639928: nam='SQL*Net message from client' ela= 3957845 driver id=1650815232 #bytes=1 p3=0 obj#=5541 tim=1574153952524478
CLOSE #139830919639928:c=0,e=24,dep=0,type=0,tim=1574153952524589
=====================
PARSING IN CURSOR #139830919639928 len=55 dep=0 uid=0 oct=42 lid=0 tim=1574153952524789 hv=2217940283 ad='0' sqlid='06nvwn223659v'
alter session set events '10046 trace name context off'
END OF STMT
PARSE #139830919639928:c=0,e=138,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=0,tim=1574153952524788
WAIT #139830919639928: nam='Disk file operations I/O' ela= 47 FileOperation=8 fileno=0 filetype=8 obj#=5541 tim=1574153952524924
EXEC #139830919639928:c=0,e=382,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=0,tim=1574153952525351
SYS@book> select * from dba_objects where object_id=5541
2 @ prxx
==============================
OWNER : SYS
OBJECT_NAME : DAM_CONFIG_PARAM$
SUBOBJECT_NAME :
OBJECT_ID : 5541
DATA_OBJECT_ID : 5541
OBJECT_TYPE : TABLE
CREATED : 2013-08-24 11:38:59
LAST_DDL_TIME : 2013-08-24 11:38:59
TIMESTAMP : 2013-08-24:11:38:59
STATUS : VALID
TEMPORARY : N
GENERATED : N
SECONDARY : N
NAMESPACE : 1
EDITION_NAME :
PL/SQL procedure successfully completed.
--//不可能是這個物件.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2664909/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20191119]探究ipcs命令輸出.txt
- [20191119]探究ipcs命令輸出2.txt
- 測試測試測試測試測試測試
- 測試—測試方法
- 測試測試用
- Flutter 學習之路 - 測試(單元測試,Widget 測試,整合測試)Flutter
- App測試、Web測試和介面測試一般測試流程APPWeb
- 測試面試-測試用例面試
- 介面測試測試流程
- 介面測試,負載測試,併發測試,壓力測試區別負載
- 測試CMS同步測試CMS同步測試CMS同步
- (一)效能測試(壓力測試、負載測試)負載
- 介面測試 - 引數測試
- Jmeter介面測試+效能測試JMeter
- 【軟體測試】——介面測試
- 微服務測試之介面測試和契約測試微服務
- 測試 之Java單元測試、Android單元測試JavaAndroid
- 黑盒測試、白盒測試與灰盒測試方法
- 功能測試、自動化測試、效能測試的區別
- 小白測試系列:介面測試與效能測試的區別
- 軟體測試中的功能測試和非功能測試
- API 測試 | 瞭解 API 介面測試 | API 介面測試指南API
- 測試——水杯的測試用例
- Burpsuite安全測試測試指導UI
- 軟體測試-測試計劃
- 單元測試,只是測試嗎?
- 測試平臺之介面測試
- 測試用例和測試方法
- 測試物件和測試級別物件
- 微服務測試之效能測試微服務
- 去測試化≠測試失業
- 黑盒測試和白盒測試
- 介面測試要測試什麼?
- 效能測試之測試指標指標
- 測試標題測試標題
- API測試:瞭解API介面測試與API介面測試指南API
- 眼圖測試(硬體測試 訊號完整性測試)
- 軟體效能測試常見指標。在哪裡測試測試?指標