Monday, July 18, 2022

 AWR Manual 


=================

--#########################################

-- How to Create Manual or AdHoc Snapshot 

--#########################################


EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;



--#########################################

-- How to Pull AWR Reports Manually 

--#########################################


--Step1 Get DBID First 


SELECT DBID, instance_number, snap_id, begin_interval_time, end_interval_time

  FROM dba_hist_snapshot

 where begin_interval_time > sysdate - 3

 ORDER BY snap_id desc;

  

-- Run the following SQL


select output from table(dbms_workload_repository.awr_report_html(DBID inst_id, begin_id, end_id));

-- example

select output from table(dbms_workload_repository.awr_report_html(2981674854, 1, 29374, 29376));


 

===================