关于oracle的session,公司想设定个值,当达到后就告警,请问有没有相关计算公式
展开全部
这个可以通过shell脚本来做,下面是监控oracle的session情况,可以进行一些判断进行其他操作,发邮件告警,这个你自己加上去,就可以。
我们有学习小组也 希望一起学习进步 Oracle-Linux交流 103 382 476
脚本内容:
sqlplus -s $DB_CONN_STR@$DB_SID <<EOF
set feed off
set verify off
set line 132
set pages 200
col username format a15
col sql_id format a20
col sql_address format a20
col machine format a30
col osuser format a15
col logon_time format a10
col program format a35
break on report
compute sum of cnt on report
select status,count(*) cnt from v/$session group by status;
prompt .
select program,cnt,status from (select program,count(*) cnt,status from v/$session group by program,status order by cnt desc) where rownum<10;
prompt .
select username,
sum(cnt) total_cnt,
sum(decode(status,'ACTIVE', cnt,0)) ACTIVE,
sum(decode(status,'INACTIVE', cnt,0)) INACTIVE,
sum(decode(status,'KILLED', cnt,0)) KILLED,
sum(decode(status,'SNIPED', cnt,0)) SNIPED,
$issue_program1 "JDBC Thin Client",
$issue_program2 "program1",
$issue_program3 "program2"
from (select program,username,status,count(*) cnt from V/$SESSION group by program,username,status )
group by username having sum(cnt)>50 order by total_cnt desc;
EOF
exit
追问
监控我们有软件了,就是想为session设定个报警数值,想查查oracle有没有这种数值的公式
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询