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

全部博文(34)

文章存档

2012年(1)

2011年(15)

2010年(18)

我的朋友

分类: Oracle

2010-10-21 14:07:06

undo_segment.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/undo_segment
data=undo_segment.data-`date +%Y-%m`
sqlplus '/as sysdba' @$datapath/undo_segment.sql >$datapath/undo_segment.log
#/bin/cat $datapath/undo_segment.log |egrep -v "SQL|Oracle|JServer|With|Disconnect|Connect|Total|-|rows"|sed '/^$/d' >>$datapath/$data
/bin/cat $datapath/undo_segment.log |egrep -v "SQL|Oracle|JServer|onnect|Total"|sed '/^$/d' >>$datapath/$data
#echo $datadate $datatime $values >> $datapath/$data

undo_segment.sql:

set heading off;
set feedback off;
alter session set nls_date_format='DD-MON-yyyy HH24:MI:SS';
col name for a20;
select current_date,name, waits, gets, waits/gets "Ratio" from v$rollstat a, v$rollname b where a.usn = b.usn;
exit;

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