熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

如何生成OracleAWR報告

2022-06-13   來源: Oracle 

  Oracle性能分析入門學習中遇到Oracle數據庫的性能問題一般首要的步驟就是導出AWR的分析報告AWR是g中新引入的一個工具在這之前一般是利用statspack要導出AWR報告只要利用Oracle的一個腳本即可以完成下面是我利用script錄制的一段導出AWR report的過程

  首先進入$ORACLE_HOME/rdbms/admin目錄在sqlplus下運行@awrrpt腳本按照提示一步一步就可以達成導出的格式有兩種txt格式和html格式

  在OTN上有一個DBA新feature系列第六周就是專門講的這個feature大家可以去那裡了解一下(中文的)

  Script started on Sun Jan :: PM PST

  [ractest@sun /u/app/oracle/orahome/rdbms/admin]$ cd $ORACLE_HOME/rdbms/admin

  [ractest@sun /u/app/oracle/orahome/rdbms/admin]$ sqlplus / as sysdba

  SQL*Plus: Release Production on Sun Jan ::

  Copyright (c) Oracle All Rights Reserved

  Connected to:

  Oracle Database g Enterprise Edition Release bit Production

  With the Partitioning Real Application Clusters OLAP Data Mining

  and Real Application Testing options

  SQL> @awrrpt

  Current Instance

  ~~~~~~~~~~~~~~~~

  DB Id DB Name Inst Num Instance

  ———– ———— ——– ————

   ORCLDB orcldb

  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: text

  Type Specified: text

  Instances in this Workload Repository schema

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  DB Id Inst Num DB Name Instance Host

  ———— ——– ———— ———— ————

  * ORCLDB orcldb sun

   ORCLDB orcldb sun

   ORCLDB orcldb sun

   ORCLDB orcldb sun

  Using for database Id

  Using 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 without

  specifying a number lists all completed snapshots

  Enter value for num_days:

  Listing the last days Completed Snapshots

  Snap

  Instance DB Name Snap Id Snap Started Level

  ———— ———— ——— —————— —–

  orcldb ORCLDB Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

   Jan :

  Specify the Begin and End Snapshot Ids

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Enter value for begin_snap:

  Begin Snapshot Id specified:

  Enter value for end_snap:

  End Snapshot Id specified:

  Specify the Report Name

  ~~~~~~~~~~~~~~~~~~~~~~~

  The default report file name is awrrpt___txt To use this name

  press to continue otherwise enter an alternative

  Enter value for report_name:

  Using the report name awrrpt___txt

  WORKLOAD REPOSITORY report for

  DB Name DB Id Instance Inst Num Release RAC Host

  ———— ———– ———— ——– ———– — ————

  ORCLDB orcldb YES sun

  Snap Id Snap Time Sessions Curs/Sess

  ——— —————— ——– ———

  Begin Snap: Jan ::

  End Snap: Jan ::

  Elapsed: (mins)

  DB Time: (mins)

  Cache Sizes

  ~~~~~~~~~~~ Begin End

  //此處有刪減

  ————————————————————

  End of Report

  Report written to awrrpt___txt

  SQL> quit

  Disconnected from Oracle Database g Enterprise Edition Release bit Production

  With the Partitioning Real Application Clusters OLAP Data Mining

  and Real Application Testing options

  [ractest@sun /u/app/oracle/orahome/rdbms/admin]$ exit

  script done on Sun Jan :: PM PST

  來源() 如何生成Oracle AWR報告 (awrrpt)_點點_新浪博客

  自己試驗做過html的覺得很不錯


From:http://tw.wingwit.com/Article/program/Oracle/201311/17629.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.