分类: 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;