remote staspack

时间:2024-01-15 16:23:14
输入文件:$HOME/utility/statspack11g/statspack.env, $HOME/utility/statspack11g/dblist,$HOME/utility/statspack11g/exec_snap.sh
输出文件:
输入变量:snapint,purgeint,snaplvl,other
输出变量: #!/bin/ksh
#set -x echo "\n"
date
echo "Start Collecting database statistics..."
. $HOME/utility/statspack/statspack.env if [ $# -ne 1 ]
then
echo ""
echo " Usage: $0 minutes";
echo ""
exit;
fi
INTERVAL=${1} pmon_process=ora_pmon_${ORACLE_SID} if [ -z "`ps -ef | grep ${pmon_process}$ | grep -v grep`" ]
then
echo `date +%Y%m%d%H%M%S`: statdb is not running in this machine
exit;
fi cd $SCRIPT_DIR #grep -v '^#' $SCRIPT_DIR/dblist| awk '{print $1 $2 $3}'| while read login snapint purgeint
grep -v '^#' $SCRIPT_DIR/dblist| while read login snapint purgeint snaplvl other
do
if [ "$snapint" = "$INTERVAL" ]
then
# sppurge.sh $login $purgeint
# exec_snap.sh $login $snaplvl &
$SCRIPT_DIR/exec_snap.sh $login $snaplvl
echo "$SCRIPT_DIR/exec_snap.sh $login $snaplvl"
fi MINUTE=`date +%M`
HOUR=`date +%H` done