Procedure Stat
A reader, December 02, 2016 - 5:54 am UTC
Nice demo. So better is without nocopy.
Can have a link or a past of the STAT proc?
December 04, 2016 - 1:10 pm UTC
stat is just statistics for a session, or "my" for my session.
<code>
undefine sid
set verify off
col name format a50
set lines 100
select
--st.sid,
decode('&&sid','my',s.STATISTIC#,st.sid) sid_stat#,
s.name, st.value
from v$statname s, v$sesstat st
where st.STATISTIC# = s.STATISTIC#
and st.sid = nvl(to_number(
decode('&&sid','my',sys_context('USERENV','SID'),'','','&&sid')
),st.SID)
and s.name like '%'||nvl('&stat_prefix',s.name)||'%';
undefine sid
<code>