weblogic12c静默安装

安装前的准备工作

编写weblogic12c静默安装脚本

创建脚本文件installWeblogic12c.sh

#!/usr/bin/env bash
# Author:fy
# Email:fy_xiaoer@126.com
# Date: 2020/1/17 8:43

# 记录当前运行脚本的路径
CURR_DIR="$(dirname $0)"

# 全局脚本的返回值
RETVAL=0

#=================================================================================
# 函数名称: usage
# 函数功能: 打印帮助信息,并退出程序
# 函数输出: 1
# 函数说明:
#=================================================================================
usage(){
  # 帮助信息
  cat <<- EOF
  Usage: (bash|sh) $0 <wls.rsp> <oraInst.loc> <fmw_12.1.3.0.0_wls.jar> [<basicWLSDomain.py> <wlst.sh>]
  wls.rsp rsp文件
  oraInst.loc loc文件
  fmw_12.1.3.0.0_wls.jar weblogic安装jar包
  basicWLSDomain.py 域模板文件
  ./home/weblogic/Oracle/Middleware12/wlserver/common/bin/wlst.sh 创建目录的程序,绝对路径
EOF
    exit 1
}

fileIsExist(){
    if [[ ! -f $1 ]];then
        echo "$1 文件不存在!"
        exit 1
    fi
}

#=================================================================================
# 函数名称: mian
# 函数功能: 主函数。
# 函数输出:
# 函数说明:
#=================================================================================
main(){
if [[ ${#@} -ne 0 ]] && [[ "${@#"--help"}" = "" ]]; then
    usage
fi

if [[ $# -eq 3 ]];then
        echo "参数校验开始"
        # wls.rsp
        rspFile=$1
        # oraInst.loc
        locFile=$2
        # fmw_12.1.3.0.0_wls.jar
        jarFile=$3

         # 判断文件是否存在
        fileIsExist $rspFile
        fileIsExist $locFile
        fileIsExist $jarFile
     elif [[ $# -eq 5 ]];then
        # wls.rsp
        rspFile=$1
        # oraInst.loc
        locFile=$2
        # fmw_12.1.3.0.0_wls.jar
        jarFile=$3
        # ./home/weblogic/Oracle/Middleware12/wlserver/common/bin/wlst.sh
        domainFile=$5
        # basicWLSDomain.py
        basicDomainFile=$4
        # 判断文件是否存在
        fileIsExist $rspFile
        fileIsExist $locFile
        fileIsExist $jarFile
        fileIsExist $basicDomainFile
        fileIsExist $domainFile
    else
      usage
    fi
    
    # 判断 java版本是否是1.7
    array=(`java -version 2>&1 |awk 'NR==1{gsub(/"/,"");print $3}'| tr '_' ' ' `)
    if [[ "$array" != "1.7.0" ]];then
        echo "java 版本不是1.7,无法使用该脚本"
        RETVAL=1
        return $RETVAL
    fi

     echo "参数校验通过"
     echo "开始安装weblogic"

    java -jar $jarFile -silent -responseFile $rspFile -invPtrLoc $locFile

    if [[ $? -ne 0 ]];then
       echo "安装失败"
       RETVAL=1
       return $RETVAL
    fi

    if [[ -f $basicDomainFile && -f $domainFile ]];then
       sh $domainFile $basicDomainFile
    fi

    return $RETVAL
}

main $*

修改wls.rsp文件,指定ORACLE_HOME

[ENGINE]

#DO NOT CHANGE THIS.

Response File Version=1.0.0.0.0

[GENERIC]

#he oracle home location. This can be an existing Oracle Home or a new Oracle Home

#根据实际情况,指定ORACLE_HOME
ORACLE_HOME=/home/weblogic/Oracle/Middleware12

#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.

INSTALL_TYPE=WebLogic Server

#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.

MYORACLESUPPORT_USERNAME=

#Provide the My Oracle Support Password

MYORACLESUPPORT_PASSWORD=<SECURE VALUE>

#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration

DECLINE_SECURITY_UPDATES=true

#Set this to true if My Oracle Support Password is specified

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#Provide the Proxy Host

PROXY_HOST=

#Provide the Proxy Port

PROXY_PORT=

#Provide the Proxy Username

PROXY_USER=

#Provide the Proxy Password

PROXY_PWD=<SECURE VALUE>

#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]

COLLECTOR_SUPPORTHUB_URL=

修改oraInst.loc文件,指定inventory_loc

#Oracle Installer Location File Location
#Fri Jan 10 18:21:24 CST 2020
inst_group=users
#根据实际情况,指定inventory_loc
inventory_loc=/home/weblogic/Oracle

静默安装

sh installWeblogic12c.sh /home/weblogic/wls.rsp /home/weblogic/oraInst.loc fmw_12.1.3.0.0_wls.jar
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值