Created
September 24, 2014 15:40
-
-
Save davidhooey/ec95d67e36cf751cec24 to your computer and use it in GitHub Desktop.
Oracle Generate AWR SQL Report Through SQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Find the dbid, instance_number and begin and end snap_id to be used. | |
select | |
snap_id, | |
dbid, | |
instance_number, | |
begin_interval_time, | |
end_interval_time | |
from | |
dba_hist_snapshot | |
order by | |
snap_id desc; | |
-- Plugin dbid, instance_number, begin stap_id, end_snap_id and SQL_ID. | |
select | |
output | |
from | |
table( | |
dbms_workload_repository.awr_sql_report_text( | |
l_dbid => dbid, | |
l_inst_num => instance_number, | |
l_bid => begin_interval_time, | |
l_eid => end_interval_time, | |
l_sqlid => 'SQL_ID' | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment