可以使用Hints對(duì)某個(gè)SQL開(kāi)啟實(shí)時(shí)監(jiān)控
創(chuàng)新互聯(lián)專(zhuān)注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于做網(wǎng)站、網(wǎng)站制作、光明網(wǎng)絡(luò)推廣、小程序定制開(kāi)發(fā)、光明網(wǎng)絡(luò)營(yíng)銷(xiāo)、光明企業(yè)策劃、光明品牌公關(guān)、搜索引擎seo、人物專(zhuān)訪、企業(yè)宣傳片、企業(yè)代運(yùn)營(yíng)等,從售前售中售后,我們都將竭誠(chéng)為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供光明建站搭建服務(wù),24小時(shí)服務(wù)熱線:18980820575,官方網(wǎng)址:www.cdcxhl.com
select /*+monitor*/ count(*) from scott.emp where sal>2000;
使用dbms_sqltune查看監(jiān)控信息
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 | | |
==========================================================================================================================
監(jiān)控信息始終指向最后一次監(jiān)控的SQL語(yǔ)句,這些信息將會(huì)在數(shù)據(jù)庫(kù)重啟后清除。