如何找出Oracle instance中当前打开游标open cursor的总数
2个回答
展开全部
您好,我来为您解答:
WITH a AS (SELECT VALUE init_open_cursors
FROM v$parameter
WHERE name = 'open_cursors'),
b AS (SELECT MAX (max_cursors) curr_max_cursors
FROM ( SELECT MAX (a.VALUE) max_cursors
FROM v$sesstat a, v$statname b, v$session s
WHERE a.statistic# = b.statistic#
AND s.sid = a.sid
AND b.name = 'opened cursors current'
GROUP BY s.sid))
SELECT ROUND (b.curr_max_cursors / a.init_open_cursors * 100, 2) ratio
FROM a, b;
如果我的回答没能帮助您,请继续追问。
WITH a AS (SELECT VALUE init_open_cursors
FROM v$parameter
WHERE name = 'open_cursors'),
b AS (SELECT MAX (max_cursors) curr_max_cursors
FROM ( SELECT MAX (a.VALUE) max_cursors
FROM v$sesstat a, v$statname b, v$session s
WHERE a.statistic# = b.statistic#
AND s.sid = a.sid
AND b.name = 'opened cursors current'
GROUP BY s.sid))
SELECT ROUND (b.curr_max_cursors / a.init_open_cursors * 100, 2) ratio
FROM a, b;
如果我的回答没能帮助您,请继续追问。
2016-03-21 · 做真实的自己 用良心做教育
千锋教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
关注
展开全部
WITH a AS(SELECTVALUEinit_open_cursors
FROMv$parameter
WHEREname = 'open_cursors'),
b AS(SELECTMAX(max_cursors) curr_max_cursors
FROM( SELECTMAX (a.VALUE) max_cursors
FROMv$sesstat a, v$statname b, v$session s
WHEREa.statistic# = b.statistic#
AND s.sid = a.sid
AND b.name = 'opened cursors current'
GROUP BY s.sid))
SELECT ROUND(b.curr_max_cursors / a.init_open_cursors * 100, 2) ratio
FROM a, b;
FROMv$parameter
WHEREname = 'open_cursors'),
b AS(SELECTMAX(max_cursors) curr_max_cursors
FROM( SELECTMAX (a.VALUE) max_cursors
FROMv$sesstat a, v$statname b, v$session s
WHEREa.statistic# = b.statistic#
AND s.sid = a.sid
AND b.name = 'opened cursors current'
GROUP BY s.sid))
SELECT ROUND(b.curr_max_cursors / a.init_open_cursors * 100, 2) ratio
FROM a, b;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询