zoukankan      html  css  js  c++  java
  • Web工程软件升级之数据库升级(二)

    升级前检查

    1. 用户是否存在

    awk -F: '{if($1 == "xxx") print $1}' /ect/passwd  

    用户名

    awk -F: '{if($1 == "xxx") print $6}' /ect/passwd  

    用户home目录是否存在也要判断

    2.  oracle 连接检查

    conn xx/xx@ORALCESID

    3. 执行数据库脚本

    sqlplus /nolog >>${sqllog} << EOF
    conn ${USERNAME}/${PASSWORD}@${SID}
    @${script脚本文件}
    commit;
    exit
    EOF

    if [ $? -eq 0 ]; then
    echo "upgrade db all success!"
    else
    echo "upgrade bmp dberror!"
    return 1
    fi

    4. 检查数据库脚本执行结果

    typeset result=`grep "ERROR" ${sqllog}`
    if [ "X${result}" != "X" ];then
    cat ${sqllog}
    return 1
    fi
    result=`grep "Not connected" ${sqllog}`
    if [ "X${result}" != "X" ];then
    cat ${sqllog}
    return 1
    fi

  • 相关阅读:
    systemd管理服务
    卷积神经网络
    matplotlib-3.2.1
    pandas-1.0.3
    numpy-1.18.4
    降维
    无监督学习-聚类
    集成学习
    人工神经网络
    贝叶斯分类
  • 原文地址:https://www.cnblogs.com/unixshell/p/3197913.html
Copyright © 2011-2022 走看看