To create AWR reports based on the automated metrics gathered:
Connect to the correct Pluggable:
select * from v$pdbs;
Find the dbid:select * from v$database;
If you want to create manually a AWR snapshot use the following:
select sys.dbms_workload_repository.create_snapshot('ALL') from dual;
Find the snapshot ids fom the following:
select dbid,instance_number,snap_id,to_char(BEGIN_INTERVAL_TIME,'dd/mm/yyyy hh24:mi;ss') startT,to_char(END_INTERVAL_TIME,'dd/mm/yyyy hh24:mi:ss') endT
from DBA_HIST_SNAPSHOT where dbid=(select dbid from v$database)
order by BEGIN_INTERVAL_TIME desc;
The following statement produces a HTML output of the AWR Report for specific snapshot ids on a RAC:
SELECT output FROM TABLE
(dbms_workload_repository.awr_global_report_html
(l_dbid=> <DBID>, --dbid select DBID from v$database
l_inst_num => '1,2', --instance single instance=1
l_bid => <SNAPID> ,--begin snap
l_eid =><SNAPID>, -- end snap
l_options => null )
);
The following statement produces a HTML output for Active Session History (ASH):
SELECT output FROM TABLE ( dbms_workload_repository.ASH_GLOBAL_REPORT_HTML( l_dbid => <DBID>,
l_inst_num => null,
l_btime => to_date('09/09/2021 08:20:00','dd/mm/yyyy hh24:mi:ss'),
l_etime => to_date('09/09/2021 08:40:00','dd/mm/yyyy hh24:mi:ss')--,
)) ;
Finally the following script can be executed as oracle OS user to produce ADDM reports:
@?/rdbms/admin/addmrpt.sql