两个简单的动态视图:v$statname、v$mystat的一点说明
sys@OCP10G> desc v$statname; 名称???????????????? ??? 是否为空? 类型---------------------------------------------------STATISTIC# NUMBERNAME VARCHAR2(64)CLASS NUMBERSTAT_ID NUMBERsys@OCP10G> select * from v$statname;STATISTIC# NAME CLASS STAT_ID---------------------------------------------------0 logons cumulative 1 26666452861 logons current 1 30804655222 opened cursors cumulative 1 850525023 opened cursors current 1 2301954928 ....314 OTC commit optimization hits 1 284064864054315 OTC commit optimization failure - setup 1 28 3633344886sys@OCP10G> show userUSER 为 "SYS"sys@OCP10G> select sid,username from v$session where username='SYS'; SID USERNAME------------------------------ 138 SYSsys@OCP10G> desc v$mystat;名称 是否为空? 类型--------------------------------------------------SID NUMBERSTATISTIC# NUMBERVALUE NUMBERsys@OCP10G> select * from v$mystat where rownum<10; SID STATISTIC# VALUE------------------------------------ 138 0 1 138 1 1 138 2 54 138 3 1 ... 138 314 0 138 315 0select 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 logonscumulative 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?
?