ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

Oracle生成awr报告操作步骤介绍

2022-08-15 01:31:58  阅读:156  来源: 互联网

标签:awr ------------ report html SQL Oracle 操作步骤 Id


  AWR全称Automatic Workload Repository,自动负载信息库,是Oracle 10g版本后推出的一种性能收集和分析工具,提供了一个时间段内整个系统的报表数据。通过AWR报告,可以分析指定的时间段内数据库系统的性能。

1. sqlplus登录Oracle

[root@ufdb165 ~]# su - oracle
Last login: Thu Aug 11 13:30:16 CST 2022 on pts/0
[oracle@ufdb165 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Sun Aug 14 13:59:26 2022

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected.
SQL>

2. 创建快照

  执行语句创建快照:exec dbms_workload_repository.create_snapshot;

2.1 压测前创建快照

SQL> exec dbms_workload_repository.create_snapshot;

PL/SQL procedure successfully completed.

2.2 压测结束创建快照

SQL> exec dbms_workload_repository.create_snapshot;

PL/SQL procedure successfully completed.

3. 生成awr报告

3.1 执行命令: @?/rdbms/admin/awrrpt

3.2 选择awr报告类型,可选择html或text,默认为html(直接回车即可)。建议选择html

3.3 选择要生成的报告的日期是在多少天以前记录,输入1,则表示要生成今天0点开始到现在之内的某个时间段的报告;输入2,则表示要生成昨天0点开始到现在之内的某个时间段的报告;以此类推。默认情况下,AWR会将镜像信息保留一个月,缺省记录最近7天。

3.4 输入天数后,界面会输出一个时间段的表格,每个时间点都对应一个snap Id,间隔时间默认是1个小时。接下来,输入要生成报告的时间开始点对应的snap Id, 然后再输入结束点对应的snap Id

3.5 接着要求输入生成报告的名字,例如:awr.html。系统会自动生成一个报告名字并会在提示信息中显示出来,如果使用默认名称,则不用输入任何内容,直接回车即可。

SQL> @?/rdbms/admin/awrrpt

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 2154841071 UFGOVDB1            1 ufgovdb1


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:

Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 2154841071        1 UFGOVDB1     ufgovdb1     ufdb165

Using 2154841071 for database Id
Using          1 for instance number


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 <return> without
specifying a number lists all completed snapshots.


Enter value for num_days: 1

Listing the last day's Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
ufgovdb1     UFGOVDB1           659 15 Aug 2022 00:00      1
                                660 15 Aug 2022 00:36      1
                                661 15 Aug 2022 00:36      1



Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 660
Begin Snapshot Id specified: 660

Enter value for end_snap: 661
End   Snapshot Id specified: 661



Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_660_661.html.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name: awr.html

Using the report name awr.html

4. awr报告存放位置

   awr报告默认存放位置为:/home/oracle/

[oracle@ufdb165 ~]$ cd /home/oracle/
[oracle@ufdb165 ~]$ ls
20220811-10-12.lst  20220811-1.lst  20220811awr.lst  awr.html  etc

 

标签:awr,------------,report,html,SQL,Oracle,操作步骤,Id
来源: https://www.cnblogs.com/silgen/p/16573602.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有