Dynamic performance view v$mystat, v$sesstat, v$statname learning (in order to learn how to get redo information generated by sql)

http://blog.csdn.net/haiross/article/details/12101161

 

 

The difference between v$mystat v$sesstat v$sysstat

v$mystat------->mystat---------->my session stat Current session statistics
v$sesstat------>sesstat---------- ->sessionstat Group statistics by session
v$sysstat------->sysstat------------>systemstat When the overall statistics of the system

 

v$mystat refers to the stat of its own session
v$sesstat is the stat of all sessions of the subsystem

 

statistic#This field is associated with the statname table
The sid field is the session identifier
 

Dynamic performance view v$mystat, v$sesstat, v$statname learning

- Dynamic performance view v$mystat, v$sesstat, v$statname learn
In order to learn how to obtain the redo information generated by sql, the results obtained from the online query show that the v$mystat, v$sesstat, v$statname views need to be operated. Now the experience is written as follows:

1. v$mystat, v$sesstat are Used to separately count session level and various database statistics since instance startup.
The two views have the same structure, but the statistics are inconsistent.
desc v$mystat;
name is empty? type
-------------------------------------- -------------- -------- ---------------------------- --------
SID NUMBER
STATISTIC# NUMBER
VALUE NUMBER

SID indicates the session number, which corresponds to the SID in v$session.
STATISTIC# indicates the statistic item
VALUE indicates the value related to the statistic item
The v$mystat view will only contain session information of the current user, and v$sesstat will contain all session information in the entire instance. Therefore, the statistics of v&mystat are naturally included in v$sesstat.

2. Under normal circumstances, v$mystat and v$sesstat will be used together with v$statname.
SQL> desc v$statname;
Name Type Nullable Default Comments 
---------- ------------ -------- ------- - ------- 
STATISTIC# NUMBER Y                         
NAME VARCHAR2(64) Y                         
CLASS NUMBER Y       

STATISTIC# in v$statname view is associated with STATISTIC# in v$mystat, v$sesstat. The NAME is the corresponding English information, for example, to check the redo information generated by a DML statement. It can be written like this:
select value from v$mystat t,v$statname t1 where t.STATISTIC# = t1.STATISTIC# and t1.NAME = 'redo size'
The same is true for other information, just replace t1.name with the corresponding The English name of .
 

select spid

  from v$process

 where addr = (select paddr

                 from v$session

                where sid = (select distinct sid from v$mystat));

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326793109&siteId=291194637