Skip to content

Instantly share code, notes, and snippets.

@davidhooey
Last active August 29, 2015 14:06
Show Gist options
  • Save davidhooey/6150faf39ee04a0092d5 to your computer and use it in GitHub Desktop.
Save davidhooey/6150faf39ee04a0092d5 to your computer and use it in GitHub Desktop.
Oracle Generate AWR Report Through SQL
-- 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 and end_snap_id.
select
output
from
table(
dbms_workload_repository.awr_report_text(
l_dbid => dbid,
l_inst_num => instance_number,
l_bid => begin_interval_time,
l_eid => end_interval_time
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment