V$MYSTAT、V$SESSTAT、V$SYSSTAT、V$STATNAME

官方解释:

V$MYSTAT

V$MYSTAT contains statistics on the current session.

Column Datatype Description
SID NUMBER ID of the current session
STATISTIC# NUMBER Number of the statistic
VALUE NUMBER Value of the statistic

V$MYSTAT视图存放了当前会话的一些统计信息, 一般会用该视图查看当前会话的ID,也就是SID列;

该视图和另外三个视图有关联性:V$SESSTAT 、V$SYSSTAT、V$STATNAME

V$SESSTAT

V$SESSTAT displays user session statistics. To find the name of the statistic associated with each statistic number (STATISTIC#), query the V$STATNAME view.

Column Datatype Description
SID NUMBER Session identifier
STATISTIC# NUMBER Statistic number

Note: Statistics numbers are not guaranteed to remain constant from one release to another. Therefore, you should rely on the statistics name rather than its number in your applications.

VALUE NUMBER Statistic value

该视图显示所有会话的统计


V$SYSSTAT

V$SYSSTAT displays system statistics. To find the name of the statistic associated with each statistic number (STATISTIC#), query the V$STATNAME view.

Column Datatype Description
STATISTIC# NUMBER Statistic number

Note: Statistics numbers are not guaranteed to remain constant from one release to another. Therefore, you should rely on the statistics name rather than its number in your applications.

NAME VARCHAR2(64) Statistic name. You can get a complete listing of statistic names by querying the V$STATNAMEview.
CLASS NUMBER A number representing one or more statistics class. The following class numbers are additive:
  • 1 - User

  • 2 - Redo

  • 4 - Enqueue

  • 8 - Cache

  • 16 - OS

  • 32 - Real Application Clusters

  • 64 - SQL

  • 128 - Debug

VALUE NUMBER Statistic value
STAT_ID NUMBER Identifier of the statistic

该视图显示系统的一些统计

V$STATNAME

V$STATNAME displays decoded statistic names for the statistics shown in the V$SESSTAT and V$SYSSTAT tables.

On some platforms, the NAME and CLASS columns contain additional operating system-specific statistics.

Column Datatype Description
STATISTIC# NUMBER Statistic number

Note: Statistics numbers are not guaranteed to remain constant from one release to another. Therefore, you should rely on the statistics name rather than its number in your applications.

NAME VARCHAR2(64) Statistic name
CLASS NUMBER A number representing one or more statistics classes. The following class numbers are additive:
  • 1 - User

  • 2 - Redo

  • 4 - Enqueue

  • 8 - Cache

  • 16 - OS

  • 32 - Real Application Clusters

  • 64 - SQL

  • 128 - Debug

STAT_ID NUMBER Identifier of the statistic

该视图存放了一个STATISTIC# 所对应的名称列表,上面三个视图都可以用STATISTIC# 这一列关联取出相应的名称;

发布了151 篇原创文章 · 获赞 45 · 访问量 25万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章