Common SQL for Oracle---(1)AWR Generator

AWR Generator

-------------

-- query snapid

SELECT   dbid,

           instance_number,

           MIN (snap_id) begin_snap_id,

           MAX (snap_id) end_snap_id

    FROM   dba_hist_snapshot

   WHERE    end_interval_time >=

       to_date('2014/06/29 07:00:00', 'yyyy/mm/dd hh24:mi:ss')

   and end_interval_time <=

       to_date('2014/06/29 08:01:00', 'yyyy/mm/dd hh24:mi:ss')

GROUP BY   dbid, instance_number;


--AWR Report

SELECT output FROM table (DBMS_WORKLOAD_REPOSITORY.awr_report_html(1781576951, 1, 24737, 24738, 0));

------------------------------------------------

本文出自 “在路上” 博客,谢绝转载!

你可能感兴趣的:(oracle,sql,AWR)