V$MYSTAT
This view 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字面来说就是当前用户的各种统计信息,sid就是session的id(也就是当前用户),STATISTIC#就是统计量的编号(用来唯一确定统计量 的名称),value是统计量的值。
V$STATNAME
This view 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:
|
STAT_ID | NUMBER | Identifier of the statistic |
v$statname视图获取系统的统计量的说明
v$mystat视图获取当前用户的在v$statname中的每个统计量的值
两个视图按STATISTIC#连接,可以得到当前用户的sid,统计量的编号,统计量的名称,和统计值.
select b.sid,a.STATISTIC#,a.name,b.value
from v$statname a,v$mystat b
where a.STATISTIC#=b.STATISTIC#;
SID STATISTIC# NAME VALUE
---------- ---------- ---------------------------------------------------------------- ----------
138 0 logons cumulative 1
138 1 logons current 1
138 2 opened cursors cumulative 56
138 3 opened cursors current 1
...
138 314 OTC commit optimization hits 0
138 315 OTC commit optimization failure - setup 0
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24107336/viewspace-1271210/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24107336/viewspace-1271210/