码迷,mamicode.com
首页 > 数据库 > 详细

Oracle获取AWR和ASH

时间:2015-09-18 11:34:02      阅读:267      评论:0      收藏:0      [点我收藏+]

标签:

 

-- 找到指定的snap
select snap_id, max(sample_time) 
from sys.wrh$_active_session_history 
group by snap_id
order by snap_id desc;

-- AWR
SELECT * 
FROM TABLE(dbms_workload_repository.awr_report_html(
      (select dbid from v$database), 1,
       26663,  -- begin snap_id 
       26664   -- end snap_id 
      ));


-- ASH
SELECT * 
FROM TABLE(dbms_workload_repository.ash_report_html(
     (select dbid from v$database), 1,
       SYSDATE - 90 / (24 * 60),   -- begin datetime
       SYSDATE - 60 / (24 * 60)    -- end
     ));


-- ADDM
select * from dba_advisor_tasks s order by  s.created desc

-- sqlplus设置参数
set long 1000000 pagesize 0 longchunksize 1000 
 
select dbms_advisor.get_task_report(ADDM:2199108538_1_26664) from dual;

Oracle获取AWR和ASH

标签:

原文地址:http://www.cnblogs.com/zhaoguan_wang/p/4818463.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!