Oracle Statspack分析报告详解(二)

7.数据库后台进程发生的等待事件


Background Wait Events for DB: BLISSDB Instance: blissdb Snaps: 4 -5


-> ordered by wait time desc, waits desc (idle events last)


Avg


Total Wait wait Waits


Event Waits Timeouts Time (s) (ms) /txn


---------------------------- ------------ ---------- ---------- ------ --------


log file parallel write 2,439 2,012 26 11 97.6


db file parallel write 400 0 22 55 16.0


control file parallel write 406 0 5 13 16.2


control file sequential read 258 0 4 16 10.3


db file sequential read 19 0 1 51 0.8


log buffer space 24 0 0 9 1.0


log file sequential read 10 0 0 16 0.4


latch free 14 6 0 9 0.6


db file scattered read 6 0 0 14 0.2


direct path read 56 0 0 1 2.2


direct path write 56 0 0 1 2.2


LGWR wait for redo copy 8 0 0 1 0.3


log file single write 10 0 0 1 0.4


rdbms ipc message 7,339 3,337 3,172 432 293.6


pmon timer 373 373 1,083 2903 14.9


smon timer 3 3 924 ###### 0.1


-------------------------------------------------------------




8.TOP SQL


调整首要的25个缓冲区读操作和首要的25个磁盘读操作做的查询,将可对系统性能产生5%到5000%的增益。


SQL ordered by Gets for DB: BLISSDB Instance: blissdb Snaps: 4 -5


-> End Buffer Gets Threshold: 10000


-> Note that resources reported for PL/SQL includes the resources used by


all SQL statements called within the PL/SQL code. As individual SQL


statements are also reported, it is possible and valid for the summed


total % to exceed 100


CPU Elapsd


Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value


--------------- ------------ -------------- ------ -------- --------- ----------


1,230,745 1 1,230,745.0 27.5 16.39 60.69 1574310682


Module: PL/SQL Developer


insert into city_day_cal select * from rptuser.city_day_cal@db15


1


143,702 1 143,702.0 3.2 1.75 18.66 3978122706


Module: PL/SQL Developer


insert into city_day_cal select * from rptuser.city_day_cal@db15


1 where curtime between to_date('200501','yyyymm') and to_date('


200502','yyyymm')-1


在报表的这一部分,通过Buffer Gets对SQL语句进行排序,即通过它执行了多少个逻辑I/O来排序。顶端的注释表明一个PL/SQL单元的缓存获得(Buffer Gets)包括被


这个代码块执行的所有SQL语句的Buffer Gets。因此将经常在这个列表的顶端看到PL/SQL过程,因为存储过程执行的单独的语句的数目被总计出来。


SQL ordered by Reads for DB: BLISSDB Instance: blissdb Snaps: 4 -5


-> End Disk Reads Threshold: 1000


CPU Elapsd


Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value


--------------- ------------ -------------- ------ -------- --------- ----------


3,587 1 3,587.0 13.9 0.17 5.13 3342983569


Module: PL/SQL Developer


select min(curtime),max(curtime) from city_day_cal


1,575 1 1,575.0 6.1 1.75 18.66 3978122706


Module: PL/SQL Developer


insert into city_day_cal select * from rptuser.city_day_cal@db15


1 where curtime between to_date('200501','yyyymm') and to_date('


200502','yyyymm')-1


这部分通过物理读对SQL语句进行排序。这显示引起大部分对这个系统进行读取活动的SQL,即物理I/O。


SQL ordered by Executions for DB: BLISSDB Instance: blissdb Snaps: 4 -5


-> End Executions Threshold: 100


CPU per Elap per


Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value


------------ --------------- ---------------- ----------- ---------- ----------


748 748 1.0 0.00 0.00 3371479671


select t.name, (select owner_instance from sys.aq$_queue_table_


affinities where table_objno = t.objno) from system.aq$_queue


_tables t where t.name = :1 and t.schema = :2 for update skip lo


cked


442 1,142 2.6 0.00 0.00 1749333492


select position#,sequence#,level#,argument,type#,charsetid,chars


etform,properties,nvl(length, 0), nvl(precision#, 0),nvl(scale,


0),nvl(radix, 0), type_owner,type_name,type_subname,type_linknam


e,pls_type from argument$ where obj#=:1 and procedure#=:2 order


by sequence# desc


这部分告诉我们在这段时间中执行最多的SQL语句。为了隔离某些频繁执行的查询,以观察是否有某些更改逻辑的方法以避免必须如此频繁的执行这些查询,这可能是很


有用的。或许一个查询正在一个循环的内部执行,而且它可能在循环的外部执行一次,可以设计简单的算法更改以减少必须执行这个查询的次数。即使它运行的飞快,


任何被执行几百万次的操作都将开始耗尽大量的时间。




9.实例活动


Instance Activity Stats for DB: BLISSDB Instance: blissdb Snaps: 4 -5


Statistic Total per Second per Trans


CPU used by this session 4,870 4.5 194.8


CPU used when call started 4,870 4.5 194.8


CR blocks created 45 0.0 1.8


DBWR buffers scanned 24,589 22.8 983.6


DBWR checkpoint buffers written 14,013 13.0 560.5


DBWR checkpoints 5 0.0 0.2


……


dirty buffers inspected 38,834 36.0 1,553.4 --脏缓冲的个数


free buffer inspected 40,463 37.5 1,618.5 --如果数量很大,说明缓冲区过小


……




10.I/O


下面两个报表是面向I/O的。通常,在这里期望在各设备上的读取和写入操作是均匀分布的。要找出什么文件可能非常“热”。一旦DBA了解了如何读取和写入这些数据


,他们也许能够通过磁盘间更均匀的分配I/O而得到某些性能提升。


Tablespace IO Stats for DB: BLISSDB Instance: blissdb Snaps: 4 -5


->ordered by IOs (Reads + Writes) desc


Tablespace


Av Av Av Av Buffer Av Buf


Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)


BLISS_DATA


17,649 16 12.3 1.2 44,134 41 0 0.0


UNDOTBS1


4,484 4 9.6 1.0 29,228 27 0 0.0


SYSTEM


340 0 31.0 1.1 36 0 0 0.0


File IO Stats for DB: BLISSDB Instance: blissdb Snaps: 4 -5


->ordered by Tablespace, File


Tablespace Filename


------------------------ ----------------------------------------------------


Av Av Av Av Buffer Av Buf


Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)


-------------- ------- ------ ------- ------------ -------- ---------- ------


BLISS_DATA D:ORACLEORADATABLISSDBBLISS01.DBF


5,779 5 12.0 1.2 14,454 13 0


D:ORACLEORADATABLISSDBBLISS02.DBF


5,889 5 12.1 1.2 14,772 14 0


D:ORACLEORADATABLISSDBBLISS03.DBF


5,981 6 12.6 1.2 14,908 14 0




11.缓冲池


Buffer Pool Statistics for DB: BLISSDB Instance: blissdb Snaps: 4 -5


-> Standard block size Pools D: default, K: keep, R: recycle


-> Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k


Free Write Buffer


Number of Cache Buffer Physical Physical Buffer Complete Busy


P Buffers Hit % Gets Reads Writes Waits Waits Waits


--- ---------- ----- ----------- ----------- ---------- ------- -------- ------


D 3,000 99.4 4,482,816 25,756 73,470 11 9 0


-------------------------------------------------------------


如果我们使用多缓冲池的功能,上面的报表会告诉我们缓冲池引起的使用故障。实际上这只是我们在报表的开头看到的信息的重复。




12.回滚段活动


Instance Recovery Stats for DB: BLISSDB Instance: blissdb Snaps: 4 -5


-> B: Begin snapshot, E: End snapshot


Targt Estd Log File Log Ckpt Log Ckpt


MTTR MTTR Recovery Actual Target Size Timeout Interval


(s) (s) Estd IOs Redo Blks Redo Blks Redo Blks Redo Blks Redo Blks


B 37 17 169 4012 3453 184320 3453


E 37 32 1385 57132 184320 184320 436361


一般期望活动在各回滚段间(除了SYSTEM回滚段外)均匀分布。在检查报表的这一部分时,报表标题也具有需要记住的最有用信息。尤其是,如果完全使用最佳设置时


关于Optmal比Avg Active更大的建议。因为这是与DBA最有关的活动(I/O和回滚段信息)。



oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

你可能感兴趣的:(oracle,statspack,Statspack分析报告)