Update 35_get_cursor_usage.sql
This commit is contained in:
@@ -5,21 +5,17 @@ select
|
|||||||
lpad(value, 5) value,
|
lpad(value, 5) value,
|
||||||
decode(value, 0, ' n/a', to_char(100 * used / value, '990') || '%') usage
|
decode(value, 0, ' n/a', to_char(100 * used / value, '990') || '%') usage
|
||||||
from
|
from
|
||||||
( select
|
(
|
||||||
max(s.value) used
|
select max(s.value) used
|
||||||
from
|
from v$statname n, v$sesstat s
|
||||||
v$statname n,
|
|
||||||
v$sesstat s
|
|
||||||
where
|
where
|
||||||
n.name = 'session cursor cache count' and
|
n.name = 'session cursor cache count'
|
||||||
s.statistic# = n.statistic#
|
and s.statistic# = n.statistic#
|
||||||
),
|
),
|
||||||
( select
|
(
|
||||||
value
|
select value
|
||||||
from
|
from v$parameter
|
||||||
v$parameter
|
where name = 'session_cached_cursors'
|
||||||
where
|
|
||||||
name = 'session_cached_cursors'
|
|
||||||
)
|
)
|
||||||
union all
|
union all
|
||||||
select
|
select
|
||||||
@@ -27,23 +23,18 @@ select
|
|||||||
lpad(value, 5),
|
lpad(value, 5),
|
||||||
to_char(100 * used / value, '990') || '%'
|
to_char(100 * used / value, '990') || '%'
|
||||||
from
|
from
|
||||||
( select
|
(
|
||||||
max(sum(s.value)) used
|
select max(sum(s.value)) used
|
||||||
from
|
from v$statname n, v$sesstat s
|
||||||
v$statname n,
|
|
||||||
v$sesstat s
|
|
||||||
where
|
where
|
||||||
n.name in ('opened cursors current') and
|
n.name in ('opened cursors current') and
|
||||||
s.statistic# = n.statistic#
|
s.statistic# = n.statistic#
|
||||||
group by
|
group by s.sid
|
||||||
s.sid
|
|
||||||
),
|
),
|
||||||
( select
|
(
|
||||||
value
|
select value
|
||||||
from
|
from v$parameter
|
||||||
v$parameter
|
where name = 'open_cursors'
|
||||||
where
|
|
||||||
name = 'open_cursors'
|
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user