ITPub博客

首页 > Linux操作系统 > Linux操作系统 > informix增加逻辑日志—Linux Shell

informix增加逻辑日志—Linux Shell

原创 Linux操作系统 作者:jifei0611 时间:2010-06-07 10:56:30 0 删除 编辑

#/bin/bash
#create date:2010/06/05
#author: oak
#function : add logical logs for informix
#file name: add_logical_logs.sh
export INFORMIXDIR=/u/inf7.3
export NCONFIG=onconfig.top
export PATH=$INFORMIXDIR/bin:$PATH
#get the physical log dbspace name
#if there are multiple lines include "PHYSDBS" in onconfig.top file,this shell doesn't work well
dbspace_name=`grep "\" $INFORMIXDIR/etc/$ONCONFIG | awk '{print $2}'`
#echo $dbspace_name
logdbspace=`onstat -d | grep "\<$dbspace_name\>"`
if [ $? -eq 0 ];then
    echo -n "Please input the number of the logical logs,you want to add:"
    read logical_log_number
    # validate the input is number
    expr $logical_log_number + 0 >/dev/null 2>&1
    if [ $? -eq 0 ];then
        while [ $logical_log_number -gt 0 ]
        do
            onparams -a -d $dbspace_name
            #echo $logical_log_number
            let logical_log_number=logical_log_number-1
        done
    else
        echo "$logical_log_number is not number"
    fi

else
   echo "dbspace:${dbspace_name} is not exist."
   echo "Please check ${ONCONFIG} file."
fi

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7419833/viewspace-664540/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-01-12

  • 博文量
    143
  • 访问量
    289346