Chinaunix首页 | 论坛 | 博客
  • 博客访问: 127851
  • 博文数量: 34
  • 博客积分: 1201
  • 博客等级: 少尉
  • 技术积分: 365
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-21 08:56
文章分类

全部博文(34)

文章存档

2012年(1)

2011年(15)

2010年(18)

我的朋友

分类: Oracle

2010-10-21 14:10:18

redologbuffer.sh:

#!/bin/sh
# Oracle specific environment settings
export ORACLE_BASE=/ora01
export ORACLE_HOME=$ORACLE_BASE/9i
export ORACLE_SID=srm


# User specific environment and startup programs

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:.

datadate=`date +%D`
datatime=`date +%R`
datapath=/backup/scrīpt/tunning/redologbuffer
data=redologbuffer.data-`date +%Y-%m`
sqlplus '/as sysdba' @$datapath/redologbuffer.sql >$datapath/redologbuffer.log
values=`/bin/cat $datapath/redologbuffer.log |egrep -v "SQL|Oracle|JServer|With|Disconnect|Connect|Total|-|redo|NAME|RATIO"|sed '/^$/d'|awk '{print $4,$5}'`
echo $datadate $datatime $values >> $datapath/$data

redologbuffer.sql:

SELECT name, gets, misses, immediate_gets, immediate_misses,Decode(gets,0,0,misses/gets*100) ratio1,Decode(immediate_gets+immediate_misses,0,0,immediate_misses/(immediate_gets+immediate_misses)*100) ratio2 FROM v$latch WHERE name IN ('redo allocation', 'redo copy');
exit;

阅读(890) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~