-- 
prompt 
prompt 创建收集信息的视图stats
create or replace VIEW stats
as 
select 'STAT...' || a.name name ,b.value 
from v$statname a,v$mystat b
where a.statistic# = b.statistic# 
union all 
select 'LATCH.' || name,gets
from v$latch
union all 
select 'STAT...Elapsed Time',hsecs from v$timer;
/
-- 创建小表来收集信息
prompt 
prompt 创建小表run_stats收集信息
create global temporary table run_stats(
    runid varchar2(15),
    name varchar2(80),
    value int
 )on commit preserve rows;
/
