数据库

位置:IT落伍者 >> 数据库 >> 浏览文章

如何生成OracleAWR报告


发布日期:2022年08月06日
 
如何生成OracleAWR报告

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的觉得很不错

               

上一篇:Oracle弱智900问七

下一篇:OracleGrant详解