begin
dbms_workload_repository.create_snapshot();
end;
1、准备
查询dbid
select dbid from v$database;
查询instance_number
select instance_number from v$instance;
查询历史快照
select SNAP_ID,dbid,SNAP_LEVEL,BEGIN_INTERVAL_TIME from dba_hist_snapshot order by SNAP_ID desc;
2、生成报告
AWR关注数据库的整体性能报告
select output from table(dbms_workload_repository.awr_report_html
(v_dbid, v_instance_number,v_min_snap_id,v_max_snap_id
));
3、导出查询结果,粘贴到文档中,保存为html格式
标签:PLSQL,dbid,导出,awr,number,instance,SNAP,select From: https://www.cnblogs.com/luckyhjp/p/17652767.html