oracle动态视图(一)stat

1v$mystat,v$sesstat,v$sysstat是用来分别统计用户级,会话级,系统级信息的。

SID                                 NUMBER 
STATISTIC#                     NUMBER 
VALUE                             NUMBER 

 

 

2.与v$statname连用

STATISTIC#       NUMBER                       
NAME             VARCHAR2(64)                          
CLASS            NUMBER        

 

3.v$statname.class的对应值

  • 1 - User

  • 2 - Redo

  • 4 - Enqueue

  • 8 - Cache

  • 16 - OS

  • 32 - Real Application Clusters

  • 64 - SQL

  • 128 - Debug

 

4.示例:比如说要查所产生的redo信息。可以这样写: 

select value , name from v$mystat t,v$statname tn where t.statistic# = tn.statistic# and tn.class=2; 


select value , name from v$mystat t,v$statname tn where t.statistic# = tn.statistic# and tn.name ='redo size';   

 

posted @ 2013-09-18 03:10  等风来。。  Views(462)  Comments(0Edit  收藏  举报
------------------------------------------------------------------------------------------------------------ --------------- 欢迎联系 x.guan.ling@gmail.com--------------- ------------------------------------------------------------------------------------------------------------