虚拟化容器,大数据,DBA,中间件,监控。

Centos7上使用oracle 12C(12.1.0.2) 自动化静默安装脚本

04 06月
作者:admin|分类:DBA运维

oracle 12C(12.1.0.2) 自动化静默安装脚本

脚本使用安装前配置点击打开链接

需要使用root用户执行(尽量安装纯净的OS环境) 下载脚本:https://github.com/domdanrtsey/Oracle12c_autoinstall.git


点击打开链接下载-安装脚本

  1. 安装前请将Oracle 12C安装包(linuxamd64_12102_database_1of2.zip、 linuxamd64_12102_database_2of2.zip )放置在 /opt/ 目录下(脚本提示是/opt,实际可随意存放)

  2. 系统需要具备512MB的swap交换分区

  3. OS可连通互联网(如果不通外网,可以使用如下方法,将依赖包下载下来,再上传到目标服务器安装,以解决依赖问题)

    安装插件 
    # yum -y install yum-plugin-downloadonly 
    创建目录 
    # mkdir /root/mypackages/ 
    下载依赖 
    # yum install --downloadonly --downloaddir=/root/mypackages/ 
    yum install -y binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 glibc glibc.i686 \
  4. OS提前配置以下信息(根据实际情况,配置如下信息)

    • 配置本机静态IP地址 HostIP与 hostname

    • 脚本中Oracle用户密码 ORACLE_OS_PWD默认为Danrtsey.com 请根据需要在脚本中修改

    • 脚本默认的processessessions值 如下,请根据实际直接在脚本中修改

      alter system set processes=500 scope=spfile; 
      alter system set sessions=555 scope=spfile;
  5. 预先将需要修改的配置信息记录下来,安装时根据脚本提示直接粘贴即可,涉及的信息如下

    数据库的SID名称:

    ORACLE_SID=orcl 
    脚本执行提示如下: 
    read -p 'Please input the ORACLE_SID(e.g:orcl):' S1 
    Please input the ORACLE_SID(e.g:orcl):

    ORACLE_BASE路径:

    ORACLE_BASE=/u01/oracle 
    脚本执行提示如下: 
    read -p 'Please input the ORACLE_BASE(e.g:/u01/oracle):' S1 
    Please input the ORACLE_BASE(e.g:/u01/oracle):

    ORACLE_HOM路径:

    ORACLE_HOME=/u01/oracle/product/12c/dbhome_1 
    脚本执行提示如下: 
    read -p 'Please input the ORACLE_HOME(e.g:/u01/oracle/product/12c/dbhome_1):' S1 
    Please input the ORACLE_HOME(e.g:/u01/oracle/product/12c/dbhome_1):

    数据库安装包1的存放路径:

    脚本执行提示如下: 
    read -p 'Please input the zip file location(e.g:/opt/linuxamd64_12102_database_1of2.zip):' zfileone 
    Please input the zip file location(e.g:/opt/linuxamd64_12102_database_1of2.zip):

    数据库安装包2的存放路径:

    脚本执行提示如下: 
    read -p 'Please input the zip file location(e.g:/opt/linuxamd64_12102_database_2of2.zip):' zfiletwo 
    Please input the zip file location(e.g:/opt/linuxamd64_12102_database_2of2.zip):

    数据库安装sys密码:

    installSysPassword=orcl20200202 
    脚本执行提示如下: 
    read -p 'Please input the installSysPassword(e.g:orcl20200202):' S1 
    Please input the installSysPassword(e.g:orcl20200202):

    数据库sys用户密码:

    SYSPASSWORD=orcl20200202 
    脚本执行提示如下: 
    read -p "Please input the SYSPASSWORD(e.g:orcl20200202):" S1 
    Please input the SYSPASSWORD(e.g:orcl20200202):

    数据库连接用户名:

    USER_NAME=orcl 
    脚本执行提示如下: 
    read -p "Please input the USER_NAME(e.g:orcl):" S1 
    Please input the USER_NAME(e.g:orcl):

    数据库连接用户名密码:

    USER_PASSWD=orcl2020 
    脚本执行提示如下: 
    read -p "Please input the USER_PASSWD(e.g:orcl2020):" S1 
    Please input the USER_PASSWD(e.g:orcl2020):

    数据库临时表空间名称:

    TMP_DBF=orcl_temp 
    脚本执行提示如下: 
    read -p "Please input the TMP_DBF(e.g:orcl_temp):" S1 
    Please input the TMP_DBF(e.g:orcl_temp):

    数据库数据表空间名称:

    DATA_DBF=orcl_data 
    脚本执行提示如下: 
    read -p "Please input the DATA_DBF(e.g:orcl_data):" S1 
    Please input the DATA_DBF(e.g:orcl_data):
  6. 脚本执行忽略如下错误提示

    /u01/database/response/netca.rsp:行30: [GENERAL]: 未找到命令 
    /u01/database/response/netca.rsp:行62: [oracle.net.ca]: 未找到命令 
    或是 
    /u01/database/response/netca.rsp:LINE30: [GENERAL]: command not found 
    /u01/database/response/netca.rsp:LINE62: [oracle.net.ca]: command not found

支持系统

  • CentOS 7.X 64

说明:脚本已经配置oracle服务自启动,并配置为系统服务,启动与停止时使用root用户操作

停止 #service oracle stop 
启动 #service oracle start

熟知以上说明之后,开始操作安装部署

# chmod +x oracle12.1.0.2_install.sh 
# sh -x oracle12.1.0.2_install.sh



浏览1246 评论0
返回
目录
返回
首页
Shell 基本运算符 Windows下Oracle因主机名或IP变动,导致EM无法启动的问题。