您好,登錄后才能下訂單哦!
可以使用Hints對某個SQL開啟實時監控
select /*+monitor*/ count(*) from scott.emp where sal>2000;
使用dbms_sqltune查看監控信息
set long 9999999
set longchunksize 9999999
set linesize 200
select dbms_sqltune.report_sql_monitor from dual;
REPORT_SQL_MONITOR
---------------------------------------------------------------------------------------------------------------------------
SQL Monitoring Report
SQL Text
------------------------------
select /*+monitor*/ count(*) from scott.emp where sal>2000
Global Information
------------------------------
Status : DONE (ALL ROWS)
Instance ID : 1
Session : SYS (9:15084)
SQL ID : 6k8qh0ubz4mnw
SQL Execution ID : 16777216
Execution Started : 05/27/2017 23:10:31
First Refresh Time : 05/27/2017 23:10:31
Last Refresh Time : 05/27/2017 23:10:31
Duration : .0003s
Module/Action : sqlplus.exe/-
Service : SYS$USERS
Program : sqlplus.exe
Fetch Calls : 1
Global Stats
==================================================
| Elapsed | IO | Other | Fetch | Buffer |
| Time(s) | Waits(s) | Waits(s) | Calls | Gets |
==================================================
| 0.00 | 0.00 | 0.00 | 1 | 7 |
==================================================
SQL Plan Monitoring Details (Plan Hash Value=2083865914)
==========================================================================================================================
| Id | Operation | Name | Rows | Cost | Time | Start | Execs | Rows | Activity | Activity Detail |
| | | | (Estim) | | Active(s) | Active | | (Actual) | (%) | (# samples) |
==========================================================================================================================
| 0 | SELECT STATEMENT | | | | 1 | +0 | 1 | 1 | | |
| 1 | SORT AGGREGATE | | 1 | | 1 | +0 | 1 | 1 | | |
| 2 | TABLE ACCESS FULL | EMP | 10 | 3 | 1 | +0 | 1 | 6 | | |
==========================================================================================================================
監控信息始終指向最后一次監控的SQL語句,這些信息將會在數據庫重啟后清除。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。