除了“手工”诊断分析Oracle性能,也可以通过Oracle提供的各类工具来快速的进行分析诊断。
尤其是Oracle10g以来,采用工具的特性更强大及方便。接下来介如何利用ASH工具来诊断分析,生成ASH报告有两种方式:
1、脚本方式:
执行$ORACLE_HOME/rdbms/admin/ashrpt.sql脚本
[dbserv1]@dbserv-db1[/export/home/oracle/awr_dir]$sqlplus / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/ashrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
3747980894 dbserv 1 dbserv1
[@more@]Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
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
------------ -------- ------------ ------------ ------------
3747980894 1 dbserv dbserv boss-dis1
* 3747980894 1 dbserv dbserv1 dbserv-db1
Defaults to current database
Using database id:
3747980894
Defaults to current instance
Using instance number:
1
ASH Samples in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Oldest ASH sample available: 09-Jun-12 07:04:06
[ 50795 mins in the past]
Latest ASH sample available: 14-Jul-12 13:38:43
[ 0 mins in the past]
Specify the timeframe to generate the ASH report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter begin time for report:
-- Valid input formats:
-- To specify absolute begin time:
-- [MM/DD[/YY]] HH24:MI[:SS]
-- Examples: 02/23/03 14:30:15
-- 02/23 14:30:15
-- 14:30:15
-- 14:30
-- To specify relative begin time: (start with '-' sign)
-- -[HH24:]MI
-- Examples: -1:15 (SYSDATE - 1 Hr 15 Mins)
-- -25 (SYSDATE - 25 Mins)
Defaults to -15 mins
Enter value for begin_time: 13:20
Report begin time specified: 13:20
Enter duration in minutes starting from begin time:
Defaults to SYSDATE - begin_time
Press Enter to analyze till current time
Enter value for duration:
Report duration specified:
Using 14-Jul-12 13:20:00 as report begin time
Using 14-Jul-12 13:39:03 as report end time
Specify Slot Width (using ashrpti.sql) for 'Activity Over Time' section
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Explanation:
…
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is ashrpt_1_0714_1339.html. To use this name,
press to continue, otherwise enter an alternative.
Enter value for report_name:
Using the report name ashrpt_1_0714_1339.html
Summary of All User Input
-------------------------
Format : HTML
DB Id : 3747980894
Inst num : 1
Begin time : 14-Jul-12 13:20:00
End time : 14-Jul-12 13:39:03
Slot width : Default
Report targets : 0
Report name : ashrpt_1_0714_1339.html
如下为所生成的HTML格式的报告,如果下载该文件不太方便的话,也可以从如下
...
转载于:http://blog.itpub.net/18841027/viewspace-1058814/