oracle生成报表数据

Oracle Database 10g提供了一个新的工具:(AWR:Automatic Workload Repository)。AWR实质上是一个Oracle的内置工具,它采集与性能相关的统计数据,并从那些统计数据中导出性能量度,以跟踪潜在的问题

1、查看快照间隔时间
select * from dba_hist_wr_control;
查询结果
DBID(数据库ID):1554014627
SNAP_INTERVAL(快照采样频率):+00000 00:10:00.0
RETENTION(数据保留时间):+00008 00:00:00.0
TOPNSQL:DEFAULT

2、生成方法
命令:
sqlplus / as sysdba;
@?/rdbms/admin/awrrpt

1)第一个问题,文件格式为html
Specify the Report Type
~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: html

2)第二个问题,选择快照的时间范围
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed. Pressing without
specifying a number lists all completed snapshots.
Enter value for num_days: 1

3)第三个问题,快照的起始ID
Specify the Begin and End Snapshot Ids
~~~~~~~~~~
Enter value for begin_snap: 3970

4)第四个问题,快照的结束ID
Enter value for end_snap: 3971

5)第五个问题,报告的名字
Specify the Report Name
~~~~~~~
The default report file name is awrrpt_1_3970_3971.html. To use this name,
press to continue, otherwise enter an alternative.
Enter value for report_name: my-test

3、文件生成路径
cd /oracle/app/oracle/11.2.0/db_1/rdbms/admin
在该目录下生成了my-test.lst,改名为my-test.html,可以直接在浏览器中打开

4、样例页面
http://www.live-in.org/wp-content/uploads/2021/03/my-test.html