暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

oracle 手动生成awr报告

数据库这点小事 2019-11-16
596

AWR(Automatic Workload Repository)报告是我们进行日常数据库性能评定、问题SQL发现的重要手段

调用脚本,生成文件(程序脚本一般保存在$ORACLE_HOME下的rdbms/admin中,名称为awrrpt.sql)

    SQL> @?/rdbms/admin/awrrpt.sql

    输入报告参数

    --默认类型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:

      --选择awr报告时间跨度(一般会保存1个月左右)

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

        DB Id Inst Num DB Name Instance Host
        ------------ -------- ------------ ------------ ------------
        * 1397953534 1 DEV dev tts.oradg

        Using 1397953534 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
          ------------ ------------ --------- ------------------ -----
          dev DEV 19073 19 Sep 2019 00:00 1
          19074 19 Sep 2019 01:00 1
          19075 19 Sep 2019 02:00 1
          19076 19 Sep 2019 03:00 1
          19077 19 Sep 2019 04:00 1
          19078 19 Sep 2019 05:00 1
          19079 19 Sep 2019 06:00 1
          19080 19 Sep 2019 07:00 1
          19081 19 Sep 2019 08:00 1
          19082 19 Sep 2019 09:00 1

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

          Enter value for end_snap:

          --默认awr报告文件名(awrrpt_inst_beginscapid_endscapid.html)

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

            Enter value for report_name:

            生成完成,在进入命令行的当前目录下可以看到生成的awr文件

            文章转载自数据库这点小事,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

            评论