How to calculate a session redolog bytes from get_stat_val

get_stat_val查询当前session生产的redo量或其他空间使用量.

create or replace function get_stat_val( p_name in varchar2 ) return number
as
l_val number;
begin
select b.value into l_val from v$statname a, v$mystat b where a.statistic# = b.statistic# and a.name = p_name;
return l_val;
end;
/
select * from v$statname;
get_stat_val('redo size');
select b.value from v$statname a,v$mystat b where a.statistic# = b.statistic# and a.name = 'redo size';
参见http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2957424542334


你可能感兴趣的:(Oracle,Administration,SQL,Script,Tools)