Chinaunix首页 | 论坛 | 博客
  • 博客访问: 141107
  • 博文数量: 161
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: -30
  • 用 户 组: 普通用户
  • 注册时间: 2017-09-21 21:45
文章分类
文章存档

2009年(1)

2008年(74)

2007年(48)

2006年(38)

我的朋友

分类: Oracle

2006-11-02 16:35:34

图表化statspack结果
===========================================================
图表化statspack结果
1. 物理读写IO 操作:
观察物理IO 访问,可以看出数据库日常访问的峰值及繁忙程度。
脚本:此脚本按时间生成统计数据(注:以下示例以8i 为基础,SQL 脚本中引用的statistic#在不同
版本代表的意义可能不同,对于9i 等版本,你应该修改相应参数值)
SELECT SUBSTR(TO_CHAR(SNAP_TIME, 'yyyy-mm-dd HH24:MI:SS'), 12),
(NEWREADS.VALUE - OLDREADS.VALUE) READS,
(NEWWRITES.VALUE - OLDWRITES.VALUE) WRITES
FROM PERFSTAT.STATS$SYSSTAT OLDREADS, PERFSTAT.STATS$SYSSTAT NEWREADS,
PERFSTAT.STATS$SYSSTAT OLDWRITES, PERFSTAT.STATS$SYSSTAT NEWWRITES,
PERFSTAT.STATS$SNAPSHOT SN
WHERE NEWREADS.SNAP_ID = SN.SNAP_ID
AND NEWWRITES.SNAP_ID = SN.SNAP_ID
AND OLDREADS.SNAP_ID = SN.SNAP_ID - 1
AND OLDWRITES.SNAP_ID = SN.SNAP_ID - 1
AND OLDREADS.STATISTIC# = 42--40 --42 physical reads
AND NEWREADS.STATISTIC# = 42 --40 --42
AND OLDWRITES.STATISTIC# = 46 --41 --46 physical writes
AND NEWWRITES.STATISTIC# = 46 --41 --46
AND (NEWREADS.VALUE - OLDREADS.VALUE) > 0
AND (NEWWRITES.VALUE - OLDWRITES.VALUE) > 0
2. Buffer 命中率
SELECT SUBSTR(TO_CHAR(SNAP_TIME, 'yyyy-mm-dd HH24:MI'), 12),
ROUND(100 * (((A.VALUE - E.VALUE) + (B.VALUE - F.VALUE)) -
(C.VALUE - G.VALUE)) /
((A.VALUE - E.VALUE) + (B.VALUE - F.VALUE))) "BUFFER HIT RATIO"
FROM PERFSTAT.STATS$SYSSTAT A, PERFSTAT.STATS$SYSSTAT B,
PERFSTAT.STATS$SYSSTAT C, PERFSTAT.STATS$SYSSTAT E,
PERFSTAT.STATS$SYSSTAT F, PERFSTAT.STATS$SYSSTAT G,
PERFSTAT.STATS$SNAPSHOT SN
WHERE A.SNAP_ID = SN.SNAP_ID
AND B.SNAP_ID = SN.SNAP_ID
AND C.SNAP_ID = SN.SNAP_ID
AND D.SNAP_ID = SN.SNAP_ID
AND E.SNAP_ID = SN.SNAP_ID - 1
AND F.SNAP_ID = SN.SNAP_ID - 1
AND G.SNAP_ID = SN.SNAP_ID - 1
AND A.STATISTIC# = 41 --39 --41 consistent gets
AND E.STATISTIC# = 41 --39
AND B.STATISTIC# = 40 --38 --40 db block gets
AND F.STATISTIC# = 40 --38
AND C.STATISTIC# = 42 --40 --42 physical reads 
AND G.STATISTIC# = 42 --40
阅读(567) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~