zoukankan      html  css  js  c++  java
  • Redhat7.x静默安装19C客户端

    1.配置hosts级语言环境

    echo "192.168.10.200 oracle" >> /etc/hosts && cat /etc/hosts
    echo "export LANG=en_US.UTF-8" >> ~/.bash_profile && source ~/.bash_profile

    2.创建组、用户并设置密码

    groupadd -g 501 oinstall
    groupadd -g 502 dba 
    groupadd -g 503 oper
    groupadd -g 504 backupdba
    groupadd -g 505 kmdba
    useradd -u 601 -g oinstall -G dba,oper,backupdba,kmdba oracle
    passwd oracle

    3.创建客户端所需目录并授予相应的权限

    mkdir -p /u01/app/oracle/product/19.3.0/db_1
    mkdir -p /u01/app/oraInventory
    chown -R oracle:oinstall /u01/
    chmod -R 755 /u01/

    4.配置本地镜像源,安装依赖包

    cd /etc/yum.repos.d/ && mkdir bk
    mv *.repo bk/
    mkdir -p /mnt/cdrom
    mount /dev/sr0 /mnt/cdrom
    echo "[REHL]" >> /etc/yum.repos.d/eheng.repo
    echo "name=Linux 7.x DVD" >> /etc/yum.repos.d/eheng.repo
    echo "baseurl=file:///mnt/cdrom" >> /etc/yum.repos.d/eheng.repo
    echo "gpgcheck=0" >> /etc/yum.repos.d/eheng.repo
    echo "enabled=1" >> /etc/yum.repos.d/eheng.repo

    compat-libstdc++-33-3.2.3-72.el7.x86_64这个包需要用rpm安装

    yum install autoconf -y
    yum install automake -y
    yum install binutils -y
    yum install binutils-devel -y
    yum install bison -y
    yum install cpp -y
    yum install dos2unix -y
    yum install ftp -y
    yum install gcc -y
    yum install gcc-c++ -y
    yum install lrzsz -y
    yum install python-devel -y
    yum install compat-db* -y
    yum install compat-gcc-34 -y
    yum install compat-gcc-34-c++ -y
    yum install compat-libcap1 -y
    yum install compat-libstdc++-33 -y
    yum install compat-libstdc++-33.i686 -y
    yum install glibc-* -y
    yum install glibc-*.i686 -y
    yum install libXpm-*.i686 -y
    yum install libXp.so.6 -y
    yum install libXt.so.6 -y
    yum install libXtst.so.6 -y
    yum install libXetxt -y
    yum install libXetxt.i686 -y
    yum install libXtst -y
    yum install libXtst.i686 -y
    yum install libX11 -y
    yum install libX11.i686 -y
    yum install libXau -y
    yum install libXau.i686 -y
    yum install libxcb -y
    yum install libxcb.i686 -y
    yum install libXi -y
    yum install libXi.i686 -y
    yum install libstdc++-docs -y
    yum install libgcc_s.so.1 -y
    yum install libstdc++.i686 -y
    yum install libstdc++-devel -y
    yum install libstdc++-devel.i686 -y
    yum install libaio -y
    yum install libaio-devel -y
    yum install libaio.i686 -y
    yum install libaio.i686-devel -y
    yum install ksh -y
    yum install libXp -y
    yum install numactl -y
    yum install numactl-devel -y
    yum install make -y
    yum install sysstat -y
    yum install unixODBC -y
    yum install unixODBC-devel -y
    yum install elfutils-libelf-devel-0.97 -y
    yum install elfutils-libelf-devel -y
    yum install redhat-lsb-core -y

    5.关闭防火墙与selinux

    systemctl stop firewalld
    systemctl status firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disable/g' /etc/selinux/config && cat /etc/selinux/config
    配置oracle用户环境变量
    PS1="[`whoami`@`hostname`:"'$PWD]$'
    alias sqlplus="rlwrap sqlplus"
    alias rman="rlwrap rman"
    export PS1
    export TMP=/tmp
    export LANG=en_US.UTF-8
    export TMPDIR=$TMP
    export TZ=Asia/Shanghai
    export ORACLE_HOSTNAME=oracle
    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1; export ORACLE_HOME
    ORACLE_TERM=xterm; export ORACLE_TERM
    NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
    NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
    PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19.3.0/db_1/bin:$ORACLE_HOME/bin; export PATH
    THREADS_FLAG=native; export THREADS_FLAG
    

    6.编辑client_install.rsp文件

    UNIX_GROUP_NAME=oinstall
    INVENTORY_LOCATION=/u01/app/oraInventory/
    ORACLE_HOME=/u01/app/oracle/product/19.3.0/db_1
    ORACLE_BASE=/u01/app/oracle/
    oracle.install.client.installType=Administrator

    7.静默安装客户端

    ./runInstaller -silent -responseFile /u01/app/client/response/client_install.rsp -ignoreSysPrereqs
    --root用户执行脚本
    /u01/app/oraInventory/orainstRoot.sh

    8.配置客户端监听

    netca -silent -responseFile /u01/app/client/response/netca.rsp
    注:如若失败,请再次执行
    --编辑tnsnames.ora如没有此文件,则新建即可
    roobbin1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.40)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = roobbin)
          (SID = roobbin1)
        )
      )

    9.测试客户端是否正常

    [oracle@oracle:/u01/]$sqlplus sys/oracle@roobbin1 as sysdba
    
    SQL*Plus: Release 19.0.0.0.0 - Production on Wed May 19 20:57:21 2021
    Version 19.3.0.0.0
    
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.3.0.0.0
    
    SQL> select instance_name,status from v$instance;
    
    INSTANCE_NAME     STATUS
    ---------------- ------------
    roobbin1     OPEN
    
    SQL> exit
  • 相关阅读:
    一本通1647迷路
    一本通1646GT 考试
    矩阵
    矩阵快速幂
    数学基础
    清北学堂学习经验(论颓废)
    钟皓曦第二天讲课
    P3275 [SCOI2011]糖果
    P1270 “访问”美术馆
    P2015 二叉苹果树
  • 原文地址:https://www.cnblogs.com/Roobbin/p/14787385.html
Copyright © 2011-2022 走看看