0%,即每个user的对应的session超过profile中设定值的90%,就会返回结果。
select u.username||' with related profile '||p.profile||' has potential issue on '||p.resource_name ||' current value is '||s.cnt||' of '||p.limit
?from dba_profiles p,
?(select username,count(*)cnt from v$session where username is not null group by username) s,
?dba_users u
?where? p.RESOURCE_NAME = 'SESSIONS_PER_USER'
?and p.profile=u.profile
?and s.username=u.username
?and p.profile !='DEFAULT'
?and s.cnt*100/decode(p.limit,'DEFAULT',999)>=90;
返回结果类似下面的形式。
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
APP_TEST with related profile PF_APP_TEST1 has potential issue on SESSIONS_PER_USER current value is 29 of 31
?APP_TEST2 with related profile PF_APP_TEST2 has potential issue on SESSIONS_PER_USER current value is 60 of 6
进一步改进,我们可以加入orabbix中,这样我们可能比开发还早收到报警邮件,问题处理也更有效。