首頁 資料庫 mysql教程 dba_enabled_aggregations

dba_enabled_aggregations

Jun 07, 2016 pm 03:22 PM
dba e

DBA_ENABLED_AGGREGATIONS displays information about enabled on-demand statistic aggregation. Column Datatype NULL Description AGGREGATION_TYPE VARCHAR2(21) Type of the aggregation: CLIENT_ID SERVICE SERVICE_MODULE SERVICE_MODULE_ACTION PRI

DBA_ENABLED_AGGREGATIONS displays information about enabled on-demand statistic aggregation.

Column Datatype NULL Description
AGGREGATION_TYPE VARCHAR2(21) Type of the aggregation:

CLIENT_ID

SERVICE

SERVICE_MODULE

SERVICE_MODULE_ACTION

PRIMARY_ID VARCHAR2(64) Primary qualifier (specific client identifier or service name)
QUALIFIER_ID1 VARCHAR2(48) Secondary qualifier (specific module name)
QUALIFIER_ID2 VARCHAR2(32) Additional qualifier (specific action name)

通过DBA_ENABLED_AGGREGATIONS视图可以查询通过DBMS_MONITOR包开启的统计信息收集。通过dbms_monitor我们可以按照如下方式收集统计信息: 基于session client identfier收集基于service、module、action的组合收集 示例如下:
SQL> execute dbms_session.set_identifier('es');

PL/SQL 过程已成功完成。

SQL> exec dbms_monitor.client_id_stat_enable('es');

PL/SQL 过程已成功完成。

SQL> select aggregation_type from dba_enabled_aggregations;

AGGREGATION_TYPE
---------------------
CLIENT_ID

SQL> exec dbms_application_info.set_module(module_name=>'tm',action_name=>'ta');

PL/SQL 过程已成功完成。

SQL> select aggregation_type from dba_enabled_aggregations;

AGGREGATION_TYPE
---------------------
CLIENT_ID

SQL> exec dbms_monitor.serv_mod_act_stat_enable(service_name=>'easy');
BEGIN dbms_monitor.serv_mod_act_stat_enable(service_name=>'easy'); END;

      *
第 1 行出现错误:
ORA-06550: 第 1 行, 第 7 列:
PLS-00306: 调用 'SERV_MOD_ACT_STAT_ENABLE' 时参数个数或类型错误
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored


SQL> exec dbms_monitor.serv_mod_act_stat_enable(service_name=>'easy',module_name=>'tm');

PL/SQL 过程已成功完成。

SQL> select aggregation_type from dba_enabled_aggregations;

AGGREGATION_TYPE
---------------------
CLIENT_ID
SERVICE_MODULE

SQL> exec dbms_monitor.serv_mod_act_stat_enable(service_name=>'easy',module_name=>'tm',action_name=>'ta');

PL/SQL 过程已成功完成。

SQL> select aggregation_type from dba_enabled_aggregations;

AGGREGATION_TYPE
---------------------
CLIENT_ID
SERVICE_MODULE
SERVICE_MODULE_ACTION
登入後複製

查看统计信息: 视图:v$serv_mod_act_stats
SQL> l
  1* select aggregation_type,service_name,module,action,stat_name,value from v$serv_mod_act_stats
SQL> /

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE	      easy	 tm				 user calls				 0
SERVICE_MODULE	      easy	 tm				 DB time				 0
SERVICE_MODULE	      easy	 tm				 DB CPU 				 0
SERVICE_MODULE	      easy	 tm				 parse count (total)			 0
SERVICE_MODULE	      easy	 tm				 parse time elapsed			 0
SERVICE_MODULE	      easy	 tm				 execute count				 0
SERVICE_MODULE	      easy	 tm				 sql execute elapsed time		 0
SERVICE_MODULE	      easy	 tm				 opened cursors cumulative		 0
SERVICE_MODULE	      easy	 tm				 session logical reads			 0
SERVICE_MODULE	      easy	 tm				 physical reads 			 0
SERVICE_MODULE	      easy	 tm				 physical writes			 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE	      easy	 tm				 redo size				 0
SERVICE_MODULE	      easy	 tm				 user commits				 0
SERVICE_MODULE	      easy	 tm				 workarea executions - optimal		 0
SERVICE_MODULE	      easy	 tm				 workarea executions - onepass		 0
SERVICE_MODULE	      easy	 tm				 workarea executions - multipas 	 0
								 s

SERVICE_MODULE	      easy	 tm				 session cursor cache hits		 0
SERVICE_MODULE	      easy	 tm				 user rollbacks 			 0
SERVICE_MODULE	      easy	 tm				 db block changes			 0
SERVICE_MODULE	      easy	 tm				 gc cr blocks received			 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE	      easy	 tm				 gc cr block receive time		 0
SERVICE_MODULE	      easy	 tm				 gc current blocks received		 0
SERVICE_MODULE	      easy	 tm				 gc current block receive time		 0
SERVICE_MODULE	      easy	 tm				 cluster wait time			 0
SERVICE_MODULE	      easy	 tm				 concurrency wait time			 0
SERVICE_MODULE	      easy	 tm				 application wait time			 0
SERVICE_MODULE	      easy	 tm				 user I/O wait time			 0

已选择27行。

SQL> l
  1* select aggregation_type,service_name,module,action,stat_name,value from v$serv_mod_act_stats
SQL> /

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE_ACTION easy	 tm	    ta			 user calls				 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 DB time				 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 DB CPU 				 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 parse count (total)			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 parse time elapsed			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 execute count				 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 sql execute elapsed time		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 opened cursors cumulative		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 session logical reads			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 physical reads 			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 physical writes			 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE_ACTION easy	 tm	    ta			 redo size				 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 user commits				 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 workarea executions - optimal		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 workarea executions - onepass		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 workarea executions - multipas 	 0
								 s

SERVICE_MODULE_ACTION easy	 tm	    ta			 session cursor cache hits		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 user rollbacks 			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 db block changes			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 gc cr blocks received			 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE_ACTION easy	 tm	    ta			 gc cr block receive time		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 gc current blocks received		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 gc current block receive time		 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 cluster wait time			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 concurrency wait time			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 application wait time			 0
SERVICE_MODULE_ACTION easy	 tm	    ta			 user I/O wait time			 0
SERVICE_MODULE	      easy	 tm				 user calls				 0
SERVICE_MODULE	      easy	 tm				 DB time				 0
SERVICE_MODULE	      easy	 tm				 DB CPU 				 0
SERVICE_MODULE	      easy	 tm				 parse count (total)			 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE	      easy	 tm				 parse time elapsed			 0
SERVICE_MODULE	      easy	 tm				 execute count				 0
SERVICE_MODULE	      easy	 tm				 sql execute elapsed time		 0
SERVICE_MODULE	      easy	 tm				 opened cursors cumulative		 0
SERVICE_MODULE	      easy	 tm				 session logical reads			 0
SERVICE_MODULE	      easy	 tm				 physical reads 			 0
SERVICE_MODULE	      easy	 tm				 physical writes			 0
SERVICE_MODULE	      easy	 tm				 redo size				 0
SERVICE_MODULE	      easy	 tm				 user commits				 0
SERVICE_MODULE	      easy	 tm				 workarea executions - optimal		 0
SERVICE_MODULE	      easy	 tm				 workarea executions - onepass		 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE	      easy	 tm				 workarea executions - multipas 	 0
								 s

SERVICE_MODULE	      easy	 tm				 session cursor cache hits		 0
SERVICE_MODULE	      easy	 tm				 user rollbacks 			 0
SERVICE_MODULE	      easy	 tm				 db block changes			 0
SERVICE_MODULE	      easy	 tm				 gc cr blocks received			 0
SERVICE_MODULE	      easy	 tm				 gc cr block receive time		 0
SERVICE_MODULE	      easy	 tm				 gc current blocks received		 0
SERVICE_MODULE	      easy	 tm				 gc current block receive time		 0
SERVICE_MODULE	      easy	 tm				 cluster wait time			 0

AGGREGATION_TYPE      SERVICE_NA MODULE     ACTION		 STAT_NAME			     VALUE
--------------------- ---------- ---------- -------------------- ------------------------------ ----------
SERVICE_MODULE	      easy	 tm				 concurrency wait time			 0
SERVICE_MODULE	      easy	 tm				 application wait time			 0
SERVICE_MODULE	      easy	 tm				 user I/O wait time			 0

已选择54行。
登入後複製

视图:v$client_stats
SQL> l
  1* select client_identifier,stat_name,value from v$client_stats
SQL> /

CLIENT_IDE STAT_NAME			       VALUE
---------- ------------------------------ ----------
es	   user calls				  28
es	   DB time			       45170
es	   DB CPU			       20997
es	   parse count (total)			  15
es	   parse time elapsed		       13894
es	   execute count			  14
es	   sql execute elapsed time		8309
es	   opened cursors cumulative		  19
es	   session logical reads		  35
es	   physical reads			   0
es	   physical writes			   0

CLIENT_IDE STAT_NAME			       VALUE
---------- ------------------------------ ----------
es	   redo size				1976
es	   user commits 			   0
es	   workarea executions - optimal	   0
es	   workarea executions - onepass	   0
es	   workarea executions - multipas	   0
	   s

es	   session cursor cache hits		   6
es	   user rollbacks			   0
es	   db block changes			  12
es	   gc cr blocks received		   0

CLIENT_IDE STAT_NAME			       VALUE
---------- ------------------------------ ----------
es	   gc cr block receive time		   0
es	   gc current blocks received		   0
es	   gc current block receive time	   0
es	   cluster wait time			   0
es	   concurrency wait time		   0
es	   application wait time		   0
es	   user I/O wait time			   0

已选择27行。
登入後複製

注意:在service级别的统计信息总是开启的,例如
SQL> l
  1* select aggregation_type from dba_enabled_aggregations
SQL> /

AGGREGATION_TYPE
---------------------
CLIENT_ID
SERVICE_MODULE
SERVICE_MODULE_ACTION

SQL> select * from v$service_stats;

SERVICE_NAME_HASH SERVICE_NA	STAT_ID STAT_NAME			    VALUE
----------------- ---------- ---------- ------------------------------ ----------
       3427055676 SYS$USERS  2666645286 logons cumulative		       48
	165959219 SYS$BACKGR 2666645286 logons cumulative		       47
		  OUND

       3271786180 easy	     2666645286 logons cumulative		       19
       1671308587 jj	     2666645286 logons cumulative			0
       2349869997 pointXDB   2666645286 logons cumulative			0
       3427055676 SYS$USERS  2882015696 user calls			      244
       ......

       3271786180 easy	     3332107451 user I/O wait time		  1756694
       1671308587 jj	     3332107451 user I/O wait time			0
       2349869997 pointXDB   3332107451 user I/O wait time			0

已选择140行。
登入後複製



本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

減少在Docker中使用MySQL內存的使用 減少在Docker中使用MySQL內存的使用 Mar 04, 2025 pm 03:52 PM

減少在Docker中使用MySQL內存的使用

如何使用Alter Table語句在MySQL中更改表? 如何使用Alter Table語句在MySQL中更改表? Mar 19, 2025 pm 03:51 PM

如何使用Alter Table語句在MySQL中更改表?

mysql無法打開共享庫怎麼解決 mysql無法打開共享庫怎麼解決 Mar 04, 2025 pm 04:01 PM

mysql無法打開共享庫怎麼解決

在 Linux 中運行 MySQl(有/沒有帶有 phpmyadmin 的 podman 容器) 在 Linux 中運行 MySQl(有/沒有帶有 phpmyadmin 的 podman 容器) Mar 04, 2025 pm 03:54 PM

在 Linux 中運行 MySQl(有/沒有帶有 phpmyadmin 的 podman 容器)

什麼是 SQLite?全面概述 什麼是 SQLite?全面概述 Mar 04, 2025 pm 03:55 PM

什麼是 SQLite?全面概述

在MacOS上運行多個MySQL版本:逐步指南 在MacOS上運行多個MySQL版本:逐步指南 Mar 04, 2025 pm 03:49 PM

在MacOS上運行多個MySQL版本:逐步指南

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼? 哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼? Mar 21, 2025 pm 06:28 PM

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什麼?

如何為MySQL連接配置SSL/TLS加密? 如何為MySQL連接配置SSL/TLS加密? Mar 18, 2025 pm 12:01 PM

如何為MySQL連接配置SSL/TLS加密?

See all articles