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;<br>
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<br>from DBA_HIST_SNAPSHOT where dbid=(select dbid from v$database)<br>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<br>(dbms_workload_repository.awr_global_report_html<br>(l_dbid=> <DBID>, --dbid select DBID from v$database<br>l_inst_num => '1,2', --instance single instance=1<br>l_bid => <SNAPID> ,--begin snap<br>l_eid =><SNAPID>, -- end snap<br>l_options => null )<br>);
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>,<br>l_inst_num => null,<br>l_btime => to_date('09/09/2021 08:20:00','dd/mm/yyyy hh24:mi:ss'),<br>l_etime => to_date('09/09/2021 08:40:00','dd/mm/yyyy hh24:mi:ss')--,<br>)) ;
Finally the following script can be executed as oracle OS user to produce ADDM reports:
@?/rdbms/admin/addmrpt.sql