zoukankan      html  css  js  c++  java
  • remote staspack

    输入文件:$HOME/utility/statspack11g/statspack.env, $HOME/utility/statspack11g/dblist,$HOME/utility/statspack11g/exec_snap.sh
    输出文件:
    输入变量:snapint,purgeint,snaplvl,other
    输出变量:
    
    
    #!/bin/ksh
    #set -x
    
    
    
    echo "
    "
    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
  • 相关阅读:
    2019年8月20日 item系列
    变量和字符
    python命名规则
    五大常用算法之贪心算法
    过河卒
    组成三位数
    编码问题
    FatMouse' Trade
    A Boring Game
    螺旋矩阵
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/6027323.html
Copyright © 2011-2022 走看看