转载:http://blog.csdn.net/zq9017197/article/details/7028533

下面是ASH报告的第一部分:

ASH Report For ORCL/orcl


DB NameDB IdInstanceInst numReleaseRACHost
ORCL1293815896orcl110.2.0.4.0NOlinux


CPUsSGA SizeBuffer CacheShared PoolASH Buffer Size
1160M (100%)48M (30.0%)96M (60.0%)2.0M (1.3%)


 Sample TimeData Source
Analysis Begin Time:25-11月-11 06:33:55V$ACTIVE_SESSION_HISTORY
Analysis End Time:25-11月-11 07:35:25V$ACTIVE_SESSION_HISTORY
Elapsed Time:61.5 (mins)
Sample Count:18
Average Active Sessions:0.00
Avg. Active Session per CPU:0.00
Report Target:None specified

这一部分除了数据库的一些信息之外,还包括报告的起止时间、时间区间、采样频次、会话平均活动情况,以及会话平均cpu使用情况。

如果是以sid级别生产报告,则如下:(注意Report Target)


 Sample TimeData Source
Analysis Begin Time:25-11月-11 07:07:07V$ACTIVE_SESSION_HISTORY
Analysis End Time:25-11月-11 08:07:20V$ACTIVE_SESSION_HISTORY
Elapsed Time:60.2 (mins)
Sample Count:5
Average Active Sessions:0.00
Avg. Active Session per CPU:0.00
Report Target:SESSION_ID = 16620% of total database activity


Top User Events

EventEvent Class% ActivityAvg Active Sessions
CPU + Wait for CPUCPU16.670.00
log file syncCommit16.670.00

这一部分是用户会话的等待事件的信息。列出了采样时段内数据库发生的显著用户等待!


Top Background Events

EventEvent Class% ActivityAvg Active Sessions
control file parallel writeSystem I/O27.780.00
CPU + Wait for CPUCPU16.670.00
log file parallel writeSystem I/O16.670.00
null eventOther5.560.00

这一部分列出后台进程的等待事件。列出了后台进程的等待事件!


Top Event P1/P2/P3 Values

Event% EventP1 Value, P2 Value, P3 Value% ActivityParameter 1Parameter 2Parameter 3
control file parallel write27.78"3","3","3"27.78filesblock#requests
log file parallel write16.67"1","5","1"5.56filesblocksrequests


"1","6","1"5.56




"1","22","1"5.56


log file sync16.67"1010","0","0"5.56buffer#NOT DEFINEDNOT DEFINED


"1385","0","0"5.56




"5057","0","0"5.56


这一部分信息是上部分等待事件的具体描述。列出了相关等待时间及其参数值。根据这些参数,可以知道等待发生在哪些对象或资源上!


Top Service/Module

ServiceModule% ActivityAction% Action
SYS$BACKGROUNDUNNAMED61.11UNNAMED61.11
SYS$USERS
16.67
16.67

sqlplus@linux (TNS V1-V3)16.67UNNAMED16.67
SYS$BACKGROUNDMMON_SLAVE5.56Auto ADDM Slave Action5.56

这一部分是按照活动的频率列出前五位的应用程序。


Top SQL Command Types

  • 'Distinct SQLIDs' is the count of the distinct number of SQLIDs with the given SQL Command Type found over all the ASH samples in the analysis period

SQL Command TypeDistinct SQLIDs% ActivityAvg Active Sessions
SELECT15.560.00

这部分列出了数据库中活动最频繁的操作。


Top SQL Statements

SQL IDPlanhash% ActivityEvent% EventSQL Text
4z2at9d1natrv28483244715.56CPU + Wait for CPU5.56SELECT INSTANCE_NUMBER FROM V$...

这部分安装sql的活动频度列出了前6位的sql语句。


Top SQL using literals

No data exists for this section of the report.

这部分列出了一些未绑定变量的sql。


Complete List of SQL Text


SQL IdSQL Text
4z2at9d1natrvSELECT INSTANCE_NUMBER FROM V$INSTANCE

这部分是列出了所有的sql语句。


Top Sessions

  • '# Samples Active' shows the number of ASH samples in which the session was found waiting for that particular event. The percentage shown in this column is calculated with respect to wall clock time and not total database activity.

  • 'XIDs' shows the number of distinct transaction IDs sampled in ASH when the session was waiting for that particular event

  • For sessions running Parallel Queries, this section will NOT aggregate the PQ slave activity into the session issuing the PQ. Refer to the 'Top Sessions running PQs' section for such statistics.

Sid, Serial#% ActivityEvent% EventUserProgram# Samples ActiveXIDs
165, 127.78control file parallel write27.78SYSoracle@linux (CKPT)5/3,690 [ 0%]0
166, 116.67log file parallel write16.67SYSoracle@linux (LGWR)3/3,690 [ 0%]0
167, 116.67CPU + Wait for CPU16.67SYSoracle@linux (DBW0)3/3,690 [ 0%]0
135, 16511.11CPU + Wait for CPU11.11SYSsqlplus@linux (TNS V1-V3)2/3,690 [ 0%]0
135, 1085.56null event5.56SYSoracle@linux (m001)1/3,690 [ 0%]0

这部分列出了活动最频繁的会话信息。这一部分为我们提供了非常有用的信息,那就是哪些进程活动频繁。我们通过这一部分获取到某个活动频繁的会话信 息,可以通过使用ashrpti.sql来生成针对这个会话的ASH性能报告,或者可以使用sql_trace对这个会话进程跟踪。这样我们就能了解到当 前这个会话正在做什么。


Top Blocking Sessions

  • Blocking session activity percentages are calculated with respect to waits on enqueues, latches and "buffer busy" only

  • '% Activity' represents the load on the database caused by a particular blocking session

  • '# Samples Active' shows the number of ASH samples in which the blocking session was found active.

  • 'XIDs' shows the number of distinct transaction IDs sampled in ASH when the blocking session was found active.

Blocking Sid% ActivityEvent Caused% EventUserProgram# Samples ActiveXIDs
166, 116.67log file sync16.67SYSoracle@linux (LGWR)3/3,690 [ 0%]0

这一部分列举了被阻塞的会话信息。


Top Sessions running PQs

No data exists for this section of the report.

这部分列出了活动频繁的前几位并行执行的会话信息。


Top DB Objects

No data exists for this section of the report.

这部分列举了相关等待具体等待的对象。


Top DB Files

No data exists for this section of the report.

这部分列举访问的数据文件信息。


Top Latches

No data exists for this section of the report.

这部分列出latch竞争。

Activity Over Time

  • Analysis period is divided into smaller time slots

  • Top 3 events are reported in each of those slots

  • 'Slot Count' shows the number of ASH samples in that slot

  • 'Event Count' shows the number of ASH samples waiting for that event in that slot

  • '% Event' is 'Event Count' over all ASH samples in the analysis period

Slot Time (Duration)Slot CountEventEvent Count% Event
06:36:00 (6.0 min)1CPU + Wait for CPU15.56
06:48:00 (6.0 min)2control file parallel write211.11
06:54:00 (6.0 min)2log file parallel write15.56


log file sync15.56
07:00:00 (6.0 min)3CPU + Wait for CPU15.56


control file parallel write15.56


null event15.56
07:06:00 (6.0 min)2log file parallel write15.56


log file sync15.56
07:12:00 (6.0 min)2CPU + Wait for CPU15.56


control file parallel write15.56
07:18:00 (6.0 min)3CPU + Wait for CPU15.56


log file parallel write15.56


log file sync15.56
07:30:00 (5.4 min)3CPU + Wait for CPU211.11


control file parallel write15.56

这部分列举了各种等待的细粒度显示。

当我们需要对一些活动的会话做分析时,使用ASH更加方便,这样可以排除很多不需要的信息干扰,更容易定位到问题的所在;

当我们需要对数据库系统做整体性能评估时,需要分析AWR性能报告。