精华内容
下载资源
问答
  • centos7安装oracle12c

    2019-03-01 14:05:02
    该文档为我实际操作的安装记录,介绍了centos7配置oracle12c的方法,以及netca和dbca的步骤,并一并讲述了oracle12cEM的一些知识点。
  • CentOS7@VMware:registered: Workstation 15 Pro,分配资源:CPU:2颗,内存:4GB,硬盘空间:30GB 二、软件准备 linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip SecureCRT 三、虚拟机的...
  • Centos7安装oracle12c

    2020-10-01 22:44:28
    一、安装前准备 环境准备 查看硬盘空间(建议磁盘可使用空间20G以上) 关闭 firewalld 和 SELinux firewall-cmd --state #查看防火墙 systemctl stop firewalld #临时关闭 systemctl disable firewalld #...

    一、安装前准备

    • 环境准备在这里插入图片描述

    • 查看硬盘空间(建议磁盘可使用空间20G以上)
      在这里插入图片描述

    • 关闭 firewalld 和 SELinux

      firewall-cmd --state #查看防火墙
      systemctl stop firewalld #临时关闭
      systemctl disable firewalld #禁止开机启动
      ***如果安装了iptables-service,也可以用以下方式关闭***
      yum install -y iptables-services 
      service iptables stop #关闭防火墙
      service iptables status #检查防火墙状态
      
    • 主机&域名

      修改主机名:

      [root@centos-work ~]# vi /etc/hostname
      centos-work
      

      修改hosts文件

      [root@centos-work ~]# vi /etc/hosts
      192.168.112.100 centos-work
      

      重启虚拟机

      [root@centos-work ~]# reboot
      

    二、安装Oracle12c

    • 安装依赖包

      [root@centos-work ~]# yum -y install binutils compat-libcap1 compat-libstdc++-33 
      compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-
      devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-
      devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make 
      sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp
      
    • 检查依赖包

      [root@centos-work ~]# rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc
      gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel
      libXext libXtst libX11 libXau libxcb libXi make sysstat
      
    • 创建用户、用户组以及安装目录

      [root@centos-work ~]# groupadd oinstall ----创建oracle用户组
      [root@centos-work ~]# groupadd dba----创建oracle用户组
      [root@centos-work ~]# useradd -g oinstall -G dba oracle----将oracle用户加入新建的2个用户组
      [root@centos-work ~]# passwd oracle ----设置oracle用户的密码(123456)
      [root@centos-work ~]# mkdir -p /usr/local/apps/oracle ----创建oracle安装目录
      [root@centos-work ~]# mkdir -p /opt/oracle/oracinstall ---创建oracle安装文件所在目录
      [root@centos-work ~]# chown -R oracle:oinstall /usr/local/apps/oracle ----更改oracle目录用户组
      [root@centos-work ~]# chmod -R 775 /usr/local/apps/oracle ----更改oracle目录权限
      [root@centos-work ~]# chown -R oracle:oinstall /opt/oracle/oracinstall----更改oracle安装文件所在目录的用户组
      [root@centos-work ~]# chmod -R 755 /opt/oracle/oracinstall----更改oracleracle安装文件所在目录的操作权限
      
    • 解压安装包到/usr/local/apps/oracle/

      [oracle@centos-work docments]$ unzip linuxamd64_12102_database_1of2.zip -d /usr/local/apps/oracle/
         
      [root@centos-work docments]# unzip linuxamd64_12102_database_2of2.zip -d /usr/local/apps/oracle/
      
    • 内核参数调整

      [root@centos-work ~]# vi /etc/sysctl.conf
      
      fs.aio-max-nr = 1048576         //异步IO请求数目 推荐值是:1048576 其实它等于 1024*1024 也就是 1024K 个
      fs.file-max = 6815744           //打开的文件句柄的最大数量,防止文件描述符耗尽的问题
      kernel.shmall = 2097152         //共享内存总量 页为单位,内存除以4K所得
      kernel.shmmax = 4294967295 
      kernel.shmmni = 4096
      kernel.sem = 250 32000 100 128 
      //SEMMSL: 每个信号集的最大信号数量 SEMMNS:用于控制整个 Linux 系统中信号的最大数 SEMOPM: 内核参数用于控制每个 semop 系统调用可以执行的信号操作的数量 SEMMNI :内核参数用于控制整个 Linux 系统中信号集的最大数量
      net.ipv4.ip_local_port_range = 9000 65500  //用于向外连接的端口范围 
      net.core.rmem_default = 262144 //套接字接收缓冲区大小的缺省值
      net.core.rmem_max = 4194304   //套接字接收缓冲区大小的最大值
      net.core.wmem_default = 262144 //套接字发送缓冲区大小的缺省值
      net.core.wmem_max = 1048576   //套接字发送缓冲区大小的最大值
      
      [root@centos-work ~]# sysctl -p      //重新加载配置文件
      
    • 配置oracle用户shell limit(提高性能)

      [root@centos-work ~]# vi /etc/security/limits.conf
      
      noproc - 进程的最大数目
      stack - 最大栈大小
      nofile - 打开文件的最大数目
      soft 指的是当前系统生效的设置值
      hard 表明系统中所能设定的最大值
      soft 的限制不能比har 限制高。用 - 就表明同时设置了 soft 和 hard 的值。
      oracle:被限制的用户名,组名前面加@和用户名区别
      oracle soft nproc 2047
      oracle hard nproc 16384
      oracle soft nofile 1024
      oracle hard nofile 65536
      oracle soft stack 10240
      oracle hard stack 10240
      
    • 修改登录配置文件

      [root@centos-work ~]# vi /etc/pam.d/login
      

      在文本末尾添加:session required pam_limits.so

    • 配置oracle用户环境变量

      [root@centos-work ~]# su - oracle
      [oracle@centos-work ~]$ vi .bash_profile
      
      # use for oracle
      
      export  ORACLE_BASE=/usr/local/apps/oracle
      export  ORACLE_HOME=$ORACLE_BASE/product
      
      export  ORACLE_SID=orcl
      
      export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
      
      export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
      #防止Oracle安装界面乱码,先把语言环境改为英文
      export LANG=en_US
      
      if [ $USER = "oracle" ];then
      
         if [ $SHELL = "/bin/ksh" ];then
      
           ulimit -p 16384
      
           ulimit -n 65536
      
         else
      
          ulimit -u 16384 -n 65536
      
         fi
      
         fi
      
      
    • 使配置文件生效

      [oracle@centos-work ~]$ source .bash_profile
      
    • 切换至oracle用户

      [oracle@centos-work ~]$ export  DISPLAY=localhost:10.0
      [oracle@centos-work ~]$ echo $DISPLAY
      [oracle@centos-work ~]$ xhost +
      

      报错:

    在这里插入图片描述

    • 报错解决:

      运行如下命令安装vnc

      [root@centos-work ~]# yum install tigervnc tigervnc-server
      

      启动并配置vnc

      [root@centos-work ~]# vncserver
      

      安装xterm:

      [root@centos-work ~]# yum install xterm
      

      用Xstart连接linux服务器:

    在这里插入图片描述

    • 打开oracle安装目录

      [oracle@centos-work ~]$ xhost +
      [oracle@centos-work ~]$ cd /usr/local/apps/oracle/database/
      [oracle@centos-work database]$ ./runInstaller
      

      在这里插入图片描述

      1、配置更新以及技术支持

      在这里插入图片描述

      2、 配置安装选项:①创建并配置一个新数据库,适用于新安装数据库的用户;②只安装数据库软件,适用于数据迁移;③升级已有数据库。在这里插入图片描述

      3、配置桌面版/服务器版。
      在这里插入图片描述

      4、单实例服务器配置

      在这里插入图片描述
      5、选择安装类型

      在这里插入图片描述

      6、选择语言
      在这里插入图片描述

      7、选择数据库版本
      在这里插入图片描述
      8、指定安装位置

      在这里插入图片描述

      6.创建仓库,创建出错,因为oracle账户无法创建oraInventory目录,所以先用终端root用户创建目录。
      在这里插入图片描述

      [root@centos-work database]# mkdir -p /usr/local/apps/oraInventory
      [root@centos-work database]# chown -R oracle:oinstall /usr/local/apps/oraInventory
      [root@centos-work database]# chmod -R 775 /usr/local/apps/oraInventory
      

      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述
      在这里插入图片描述

      数据库创建完成后,会出现执行配置脚本提示窗口

      打开一个终端窗口并切换到 root 用户,按照执行配置脚本窗口提示的路径执行脚本

      [root@centos-work usr]# bash /usr/local/apps/oraInventory/orainstRoot.sh
      [root@centos-work usr]# bash /usr/local/apps/oracle/product/root.sh
      


      在这里插入图片描述
      在这里插入图片描述

      安装完成!

    展开全文
  • centos7离线安装oracle12c

    2018-07-27 09:45:12
    linux下离线安装oracle12c的详细安装过程文档,包括可能遇到问题的解决方案,oracle的所有可能需要的依赖包
  • root身份安装依赖包:yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i...

    root身份安装依赖包:

    yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp

    建立用户和组:

    groupadd oinstall

    groupadd dba

    groupadd oper

    useradd-g oinstall -G dba,oper oracleecho "123456" | passwd --stdin oracle #oracle用户的登录密码,后续登录要用,记着。

    创建安装目录:

    mkdir -p /orcl/app/oracle/product/12.1.0/db_1chown -R oracle:oinstall /orcl/appchmod -R 775 /orcl/app

    修改内核参数vi /etc/sysctl.conf,添加:

    fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall= 2097152kernel.shmmax= 1200000000kernel.shmmni= 4096kernel.sem= 250 32000 100 128net.ipv4.ip_local_port_range= 9000 65500net.core.rmem_default= 262144net.core.rmem_max= 4194304net.core.wmem_default= 262144net.core.wmem_max= 1048576

    改好后,使之生效

    sysctl -p

    另外 上面的kernel.shmmax = 1200000000可能会有问题,后面咱们再说。

    或者你直接现在就写成4098955264

    改文件限制:vi /etc/security/limits.conf,添加:

    oracle soft nproc 2047oracle hard nproc16384oracle soft nofile1024oracle hard nofile65536oracle soft stack10240

    注意:修改此文件是即时生效的,但可能要重登录后再看

    以及vi /etc/pam.d/login,添加:

    session required pam_limits.so

    修改ulimit:vi /etc/profile,添加:

    if [ $USER = "oracle" ]; then

    if [ $SHELL = "/bin/ksh" ]; thenulimit-p 16384ulimit-n 65536aelseulimit-u 16384 -n 65536

    fi

    fi

    修改环境变量。vi ~oracle/.bash_profile,添加:

    ORACLE_BASE=/orcl/app/oracle

    ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1

    ORACLE_SID=orcl

    export ORACLE_BASE ORACLE_HOME ORACLE_SID

    PATH=$ORACLE_HOME/bin:$PATH

    export PATH

    用yum remove *openjdk* 把系统自带的openjdk卸载,再安装sun jdk:rpm -ivh jdk-8u144-linux-x64.rpm。(下载地址)(openjdk环境安装oracle GUI会报class not found的错)。然后$>java -version检查一下安装是否成功。上述工作完成后,建议重启系统。

    030c48dc8a6af49cbcb50b61eea76acb.png

    以上操作命令如下:

    dd8656b5157184cd315d0631afd9fd02.png

    以oracle用户登录,开始安装:

    suoracle

    cd/orcl/app/oracleunzip linuxx64_12201_database.zipexport LANG="en_US"cd/orcl/app/oracle/database

    ./runInstaller

    注:下载好的Oracle要放到/orcl/app/oracle目录下,/orcl/app/oracle/下是2个目录:product和database。解压后的安装文件放在database下。然后就会出现安装界面,配置过程从略。需要注意的是字符集要选择unicode。如下

    0a798739728cae369cbe17be4b2b6c42.png

    1a2a99e4d62500cd041837e875c22e47.png

    128a0c105edb37ad278349af90f3274f.png

    e55ae831951657b4c0a2483e9b525c66.png

    e6c829aaccc780b4671d3557981b10c3.png

    219aaa657f54d85ff950121655382594.png

    cc8851856156a420bf414a9adbefa45c.png

    0f90937596ee5e78fb315c20c5731637.png

    安装中

    c06201542d394654ac918d9e54b83fa9.png

    安装完成

    fd312dbe36f10be64821630f602ce976.png

    然后输入dbca启动数据图形化界面装数据库

    380117e2bcd1483233cf7eb07f08c722.png

    选择配置:这里我们选择高级配置,简单的自测

    db44f3c1152960fff46be5f77a6774d6.png

    根据自己需求配置:我选择定制的数据库(custom database)

    43061de63b04e1886331615fd2cdbc9a.png

    配置数据库容器:

    4d4ac3f46e370660af261f752e805572.png

    配置数据库存储方式:

    cf08c4564db84ded003977a873fc9e5a.png

    选择快速恢复区域:

    b36419db7cddd0b80a1d23e8744b1737.png

    监听器配置:(创建数据库自动创建监听器,一定要是LISTENER默认的)

    504e2fdd6e1047fbf67c11ecf6d79318.png

    选择数据库组件:

    e4c17b3478e1a1ad1eae9e3d7797f3a6.png

    数据库安全配置:

    8b021d1520d62eb00cae82bad7a67a78.png

    内存、块、连接数量、字符集、连接模式、添加实例:

    4dce2d535754dd53ae4b201495e544a3.png

    abf0c8f8f336a14c3b63384a1b82b49c.png

    52b4805f6749c01566d984f6038ddc75.png

    8dfb634b826e82fe101f8f0843dfc96d.png

    配置Orale EM 土豪可以去订购功能强大的EM:

    b364328c273f3c224282c588fd133e5f.png

    口令配置:我是用的是统一口令

    df58200a19889e6dc177de2d83751087.png

    创建数据库配置:

    7471802a8370b46d6505881d4336f5bd.png

    总结界面:(如果没有任何错误就可以finish安装)

    请一定先执行/orcl/app/oracle/product/12.1.0/db_1/root.sh

    05cc53a0931048133b498bcfff9d1c82.png

    3e66923aa01e442907ce84d1d7c207e7.png

    cd /orcl/app/oracle/product/12.1.0/db_1

    ./root.sh

    安装完成(一切顺利,未见报错)

    de0acba8864868b7485eaf481ba2dfc9.png

    启动

    1.#su - oracle 切换到 oracle 用户且切换到它的环境

    2.$lsnrctl status 查看监听及数据库状态

    3.$lsnrctl start 启动监听

    4.$sqlplus / as sysdba 以 DBA 身份进入 sqlplus

    5.SQL>startup 启动 db

    停止

    1.#su - oracle 切换到 oracle 用户且切换到它的环境

    2.$lsnrctl stop 停止监听

    3.$sqlplus / as sysdba 以 DBA 身份进入 sqlplus

    4.SQL>SHUTDOWN IMMEDIATE 关闭 db

    展开全文
  • CentOS7安装Oracle12C

    2015-10-14 11:38:08
    实验环境:Oracle VM VirtualBox 4.2.12 操作系统:CentOS 7(LINUX7)64bit 数据库 :Oracle 12C 64bit 实验目标:熟悉LINUX7安装Oracle12C
  • 主要介绍了CentOS命令行下装oracle 12c的方法(命令行模式安装),需要的朋友可以参考下
  • Centos7安装Oracle12c

    2019-01-16 17:27:33
    centos7.*静默安装oralce12.2的笔记,不适合linux纯小白,起码懂得基本命令的作用和#和$的区别,笔记基本能复用,但要根据你电脑的内存修改一点配置和安装的目录需要按需修改
  • Centos7 安装Oracle12c

    2021-03-30 15:52:07
    我们的服务器连接Oracle时,需要安装Oracle客户端,我这里安装的时Oracle12c版本的,亲测有效 1.下载所需要的安装包(rpm格式) oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm 基本的动态库 oracle-...

    Linux安装oracle client客户端连接远程数据库

    我们的服务器连接Oracle时,需要安装Oracle客户端,我这里安装的时Oracle12c版本的,亲测有效

    百度网盘
    提取码:fnjs

    1.下载所需要的安装包(rpm格式)

    oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm 基本的动态库
    oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm 客户端sqlplus安装包
    oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm API接口文件

    2.RPM安装

    默认路径: /usr/lib/oracle/12.2/client64
    rpm -ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
    rpm -ivh oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
    rpm -ivh oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
    

    安装完成之后,创建新的目录

    mkdir -p /usr/lib/oracle/12.2/client64/network/admin
    
    chown -R oracle:oracle /usr/lib/oracle
    

    3.创建TNS

    cd /usr/lib/oracle/12.2/client64/network/admin
    
    vi tnsnames.ora
    

    下面时tnsnames.ora中的内容:

    host:远程数据库的ip地址,service_name:远程数据库的sid(一般是orcl)

    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.15)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl)
        )
      )
    

    4.配置环境

    vi .bash_profile
    export  ORACLE_HOME=/usr/lib/oracle/12.2/client64
    export  TNS_ADMIN=$ORACLE_HOME/network/admin
    export  NLS_LANG='simplified chinese_china'.ZHS16GBK
    export  LD_LIBRARY_PATH=$ORACLE_HOME/lib 
    export  PATH=$ORACLE_HOME/bin:$PATH
    

    5:生效环境变量

    source .bash_profile
    echo $OARCLE_HOME
    

    6:测试

    sqlplus username/password@orcl
    

    展开全文
  • Centos 7安装Oracle12c RAC

    千次阅读 2020-01-09 14:43:10
    1.服务器配置 [root@oracle01 ~]# df -h Filesystem SizeUsed Avail Use% Mounted on /dev/mapper/centos-root 20G1.7G 19G 9% / devtmpfs 1.5G 01.5...

    1.服务器配置

    [root@oracle01 ~]# df -h

    Filesystem               Size  Used Avail Use% Mounted on

    /dev/mapper/centos-root   20G  1.7G   19G   9% /

    devtmpfs                 1.5G     0  1.5G   0% /dev

    tmpfs                    1.5G     0  1.5G   0% /dev/shm

    tmpfs                    1.5G  9.5M  1.5G   1% /run

    tmpfs                    1.5G     0  1.5G   0% /sys/fs/cgroup

    /dev/sda1                397M  121M  277M  31% /boot

    /dev/mapper/centos-tmp   5.0G   33M  5.0G   1% /tmp

    /dev/mapper/centos-home   10G   33M   10G   1% /home

    /dev/mapper/centos-u01    61G   33M   61G   1% /u01

    tmpfs                    299M     0  299M   0% /run/user/0

    [root@oracle01 ~]# free -h

                  total        used        free      shared  buff/cache   available

    Mem:           2.9G        178M        2.3G        9.4M        487M        2.5G

    Swap:          4.0G          0B        4.0G

    [root@oracle01 ~]# ifconfig

    ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

            inet 192.168.157.137  netmask 255.255.255.0  broadcast 192.168.157.255

            inet6 fe80::9be3:4f6f:e9d5:f61f  prefixlen 64  scopeid 0x20<link>

            ether 00:0c:29:c3:19:be  txqueuelen 1000  (Ethernet)

            RX packets 37857  bytes 53794846 (51.3 MiB)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 7050  bytes 485521 (474.1 KiB)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

            inet 10.10.10.129  netmask 255.255.255.0  broadcast 10.10.10.255

            inet6 fe80::a2e3:aa14:94c6:af5d  prefixlen 64  scopeid 0x20<link>

            ether 00:0c:29:c3:19:c8  txqueuelen 1000  (Ethernet)

            RX packets 19  bytes 1732 (1.6 KiB)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 18  bytes 1352 (1.3 KiB)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

            inet 127.0.0.1  netmask 255.0.0.0

            inet6 ::1  prefixlen 128  scopeid 0x10<host>

            loop  txqueuelen 1000  (Local Loopback)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 0  bytes 0 (0.0 B)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    [root@oracle02 ~]# df -h

    Filesystem               Size  Used Avail Use% Mounted on

    /dev/mapper/centos-root   20G  1.8G   19G   9% /

    devtmpfs                 1.5G     0  1.5G   0% /dev

    tmpfs                    1.5G     0  1.5G   0% /dev/shm

    tmpfs                    1.5G  9.5M  1.5G   1% /run

    tmpfs                    1.5G     0  1.5G   0% /sys/fs/cgroup

    /dev/sda1                397M  121M  277M  31% /boot

    /dev/mapper/centos-u01    61G   33M   61G   1% /u01

    /dev/mapper/centos-tmp   5.0G   33M  5.0G   1% /tmp

    /dev/mapper/centos-home   10G   33M   10G   1% /home

    tmpfs                    299M     0  299M   0% /run/user/0

    [root@oracle02 ~]# free -h

                  total        used        free      shared  buff/cache   available

    Mem:           2.9G        174M        2.3G        9.4M        458M        2.6G

    Swap:          4.0G          0B        4.0G

    [root@oracle02 ~]# ifconfig

    ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

            inet 192.168.157.138  netmask 255.255.255.0  broadcast 192.168.157.255

            inet6 fe80::c74:76cb:6393:e10e  prefixlen 64  scopeid 0x20<link>

            ether 00:0c:29:3f:38:c6  txqueuelen 1000  (Ethernet)

            RX packets 29789  bytes 42933104 (40.9 MiB)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 4190  bytes 305947 (298.7 KiB)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

            inet 10.10.10.130  netmask 255.255.255.0  broadcast 10.10.10.255

            inet6 fe80::7832:2a05:85a6:b9b4  prefixlen 64  scopeid 0x20<link>

            ether 00:0c:29:3f:38:d0  txqueuelen 1000  (Ethernet)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 18  bytes 1352 (1.3 KiB)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

     

    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

            inet 127.0.0.1  netmask 255.0.0.0

            inet6 ::1  prefixlen 128  scopeid 0x10<host>

            loop  txqueuelen 1000  (Local Loopback)

            RX packets 0  bytes 0 (0.0 B)

            RX errors 0  dropped 0  overruns 0  frame 0

            TX packets 0  bytes 0 (0.0 B)

            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    2.IP地址规划(两个节点的/etc/hosts文件都要配置)

    # public ip

    192.168.157.137 oracle01

    192.168.157.138 oracle02

     

    # Private IP

    10.10.10.129 oracle01-priv

    10.10.10.130 oracle02-priv

     

    # Virtual IP

    192.168.157.237 oracle01-vip

    192.168.157.238 oracle02-vip

     

    # Scan IP

    192.168.157.139 oracle-cluster

     

    [root@oracle01 ~]# ping -c 4 oracle02
    PING oracle02 (192.168.157.138) 56(84) bytes of data.
    64 bytes from oracle02 (192.168.157.138): icmp_seq=1 ttl=64 time=0.300 ms
    64 bytes from oracle02 (192.168.157.138): icmp_seq=2 ttl=64 time=0.431 ms
    64 bytes from oracle02 (192.168.157.138): icmp_seq=3 ttl=64 time=0.384 ms
    64 bytes from oracle02 (192.168.157.138): icmp_seq=4 ttl=64 time=1.81 ms

    --- oracle02 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3002ms
    rtt min/avg/max/mdev =
    0.300/0.733/1.817/0.627 ms
    [root@oracle01 ~]
    # ping -c 4 oracle02-priv
    PING oracle02-priv (10.10.10.130) 56(84) bytes of data.
    64 bytes from oracle02-priv (10.10.10.130): icmp_seq=1 ttl=64 time=0.190 ms
    64 bytes from oracle02-priv (10.10.10.130): icmp_seq=2 ttl=64 time=0.249 ms
    64 bytes from oracle02-priv (10.10.10.130): icmp_seq=3 ttl=64 time=0.261 ms
    64 bytes from oracle02-priv (10.10.10.130): icmp_seq=4 ttl=64 time=0.204 ms

    --- oracle02-priv ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3001ms
    rtt min/avg/max/mdev =
    0.190/0.226/0.261/0.029 ms

     

    ===================================================================================

     

    [root@oracle02 ~]# ping -c 4 oracle01
    PING oracle01 (192.168.157.137) 56(84) bytes of data.
    64 bytes from oracle01 (192.168.157.137): icmp_seq=1 ttl=64 time=2.06 ms
    64 bytes from oracle01 (192.168.157.137): icmp_seq=2 ttl=64 time=0.592 ms
    64 bytes from oracle01 (192.168.157.137): icmp_seq=3 ttl=64 time=1.07 ms
    64 bytes from oracle01 (192.168.157.137): icmp_seq=4 ttl=64 time=1.25 ms

    --- oracle01 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3004ms
    rtt min/avg/max/mdev =
    0.592/1.248/2.067/0.532 ms
    [root@oracle02 ~]
    # ping -c 4 oracle01-priv
    PING oracle01-priv (10.10.10.129) 56(84) bytes of data.
    64 bytes from oracle01-priv (10.10.10.129): icmp_seq=1 ttl=64 time=0.327 ms
    64 bytes from oracle01-priv (10.10.10.129): icmp_seq=2 ttl=64 time=0.236 ms
    64 bytes from oracle01-priv (10.10.10.129): icmp_seq=3 ttl=64 time=0.229 ms
    64 bytes from oracle01-priv (10.10.10.129): icmp_seq=4 ttl=64 time=0.194 ms

    --- oracle01-priv ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3000ms
    rtt min/avg/max/mdev =
    0.194/0.246/0.327/0.051 ms

    3.安装依赖包

    yum install binutilscompat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-develglibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaiolibaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBCunixODBC-devel readline libtermcap-devel pdksh -y

    4.关闭selinux和配置防火墙

    [root@oracle01 ~]# vi /etc/selinux/config
    [root@oracle01 ~]# cat /etc/selinux/config

    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of three values:
    #     targeted - Targeted processes are protected,
    #     minimum - Modification of targeted policy. Only selected processes are protected.
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted

     

    ===================================================================================

     

    [root@oracle02 ~]# vi /etc/selinux/config
    [root@oracle02 ~]# cat /etc/selinux/config
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #???? enforcing - SELinux security policy is enforced.
    #???? permissive - SELinux prints warnings instead of enforcing.
    #???? disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of three values:
    #???? targeted - Targeted processes are protected,
    #???? minimum - Modification of targeted policy. Only selected processes are protected.
    #???? mls - Multi Level Security protection.
    SELINUXTYPE=targeted

     

    [root@oracle01 ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
       Active: active (running) since Fri
    2020-01-03 14:01:12 CST; 1h 58min ago
         Docs: man:firewalld(
    1)
     Main PID:
    6429 (firewalld)
       CGroup: /system.slice/firewalld.service
               └─
    6429 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

    Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
    Jan
    03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
    [root@oracle01 ~]
    # systemctl disable firewalld.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    [root@oracle01 ~]
    # systemctl stop firewalld.service
    [root@oracle01 ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:firewalld(
    1)

    Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
    Jan
    03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
    Jan
    03 16:00:08 oracle01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
    Jan
    03 16:00:09 oracle01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
    [root@oracle01 ~]
    # systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
       Active: active (running) since Fri
    2020-01-03 14:01:12 CST; 1h 58min ago
         Docs: man:firewalld(
    1)
     Main PID:
    6429 (firewalld)
       CGroup: /system.slice/firewalld.service
               └─
    6429 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

    Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
    Jan
    03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
    [root@oracle01 ~]
    # systemctl disable firewalld.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    [root@oracle01 ~]
    # systemctl stop firewalld.service
    [root@oracle01 ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:firewalld(
    1)

    Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
    Jan
    03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
    Jan
    03 16:00:08 oracle01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
    Jan
    03 16:00:09 oracle01 systemd[1]: Stopped firewalld - dynamic firewall daemon.

     

    ===========================================================================================

     

    [root@oracle02 ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
    ?? Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
    ?? Active: active (running) since Fri
    2020-01-03 14:01:18 CST; 1h 32min ago
    ???? Docs: man:firewalld(
    1)
    Main PID:
    6442 (firewalld)
    ?? CGroup: /system.slice/firewalld.service
    ?????????? └─
    6442 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

    Jan 03 14:01:16 oracle02 systemd[1]: Starting firewalld - dynamic firewall daemon...
    Jan
    03 14:01:18 oracle02 systemd[1]: Started firewalld - dynamic firewall daemon.
    [root@oracle02 ~]
    # systemctl disable firewalld.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    [root@oracle02 ~]
    # systemctl stop firewalld.service
    [root@oracle02 ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
    ?? Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
    ?? Active: inactive (dead)
    ???? Docs: man:firewalld(
    1)

    Jan 03 14:01:16 oracle02 systemd[1]: Starting firewalld - dynamic firewall daemon...
    Jan
    03 14:01:18 oracle02 systemd[1]: Started firewalld - dynamic firewall daemon.
    Jan
    03 15:34:11 oracle02 systemd[1]: Stopping firewalld - dynamic firewall daemon...
    Jan
    03 15:34:11 oracle02 systemd[1]: Stopped firewalld - dynamic firewall daemon.

    5.添加组和用户(两个节点)

    groupadd -g 60001 oinstall
    groupadd -g
    60002 dba
    groupadd -g
    60003 oper
    groupadd -g
    60004 backupdba
    groupadd -g
    60005 dgdba
    groupadd -g
    60006 kmdba
    groupadd -g
    60007 asmdba
    groupadd -g
    60008 asmoper
    groupadd -g
    60009 asmadmin
    useradd -u
    61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
    useradd -u
    61002 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
    echo "grid" | passwd --stdin grid
    echo "oracle" | passwd --stdin oracle

     

    [root@oracle01 ~]# groupadd -g 60001 oinstall
    [root@oracle01 ~]# groupadd -g 60002 dba
    [root@oracle01 ~]# groupadd -g 60003 oper
    [root@oracle01 ~]# groupadd -g 60004 backupdba
    [root@oracle01 ~]# groupadd -g 60005 dgdba
    [root@oracle01 ~]# groupadd -g 60006 kmdba
    [root@oracle01 ~]# groupadd -g 60007 asmdba
    [root@oracle01 ~]# groupadd -g 60008 asmoper
    [root@oracle01 ~]# groupadd -g 60009 asmadmin
    [root@oracle01 ~]# useradd -u 61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
    [root@oracle01 ~]# useradd -u 61002 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
    [root@oracle01 ~]# echo "grid" | passwd --stdin grid
    Changing password for user grid.
    passwd: all authentication tokens updated successfully.
    [root@oracle01 ~]
    # echo "oracle" | passwd --stdin oracle
    Changing password for user oracle.
    passwd: all authentication tokens updated successfully.
    [root@oracle01 ~]
    # id oracle
    uid=61002(oracle) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60003(oper),60004(backupdba),60005(dgdba),60006(kmdba),60007(asmdba),60009(asmadmin)
    [root@oracle01 ~]
    # id grid
    uid=61001(grid) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60007(asmdba),60008(asmoper),60009(asmadmin)

     

    =============================================================================================================

     

    [root@oracle02 ~]# groupadd -g 60001 oinstall
    [root@oracle02 ~]# groupadd -g 60002 dba
    [root@oracle02 ~]# groupadd -g 60003 oper
    [root@oracle02 ~]# groupadd -g 60004 backupdba
    [root@oracle02 ~]# groupadd -g 60005 dgdba
    [root@oracle02 ~]# groupadd -g 60006 kmdba
    [root@oracle02 ~]# groupadd -g 60007 asmdba
    [root@oracle02 ~]# groupadd -g 60008 asmoper
    [root@oracle02 ~]# groupadd -g 60009 asmadmin
    [root@oracle02 ~]# useradd -u 61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
    [root@oracle02 ~]# useradd -u 61002 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
    [root@oracle02 ~]# echo "grid" | passwd --stdin grid
    Changing password for user grid.
    passwd: all authentication tokens updated successfully.
    [root@oracle02 ~]
    # echo "oracle" | passwd --stdin oracle
    Changing password for user oracle.
    passwd: all authentication tokens updated successfully.
    [root@oracle02 ~]
    #
    [root@oracle02 ~]# id oracle
    uid=61002(oracle) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60003(oper),60004(backupdba),60005(dgdba),60006(kmdba),60007(asmdba),60009(asmadmin)
    [root@oracle02 ~]
    #
    [root@oracle02 ~]# id grid
    uid=61001(grid) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60007(asmdba),60008(asmoper),60009(asmadmin)

    6.添加目录(两个节点都要加)

    mkdir -p /u01/app/grid
    mkdir -p /u01/app/
    12.2.0/grid
    chown -R grid:oinstall /u01/app
    mkdir -p /u01/app/oraInventory
    chown -R grid:oinstall /u01/app/oraInventory
    mkdir -p /u01/app/oracle
    chown -R oracle:oinstall /u01/app/oracle

    chmod -R 775 /u01/app/oracle

    7.修改操作系统参数(两个节点都要加)

    vi /etc/security/limits.conf

    grid soft nproc 2047

    grid hard nproc 16384

    grid soft nofile 1024

    grid hard nofile 65536

    grid soft stack 10240

    grid hard stack 32768

    oracle soft nproc 2047

    oracle hard nproc 16384

    oracle soft nofile 1024

    oracle hard nofile 65536

    oracle soft stack 10240

    oracle hard stack 32768

     

    cat /etc/security/limits.d/20-nproc.conf

    #*          soft    nproc     4096

    root       soft    nproc     unlimited

    *          soft    nproc     16384

     

    vi /etc/pam.d/login

     

    session required pam_limits.so

     

    kernel.shmmax参数:需要根据实际物理内存计算,此处按节点物理内存计算;建议kernel.shmmax参数取值为节点物理内存的70%,单位为字节,即物理内存*70%*1024*1024*1024。
    kernel.sem参数:如果客户单个数据库需要支持的process数超过12000,请按照实际情况配置

     

    [root@oracle01 ~]# MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')

    [root@oracle01 ~]# echo SHMMAX=$(expr $MEMTOTAL*4/5)

    SHMMAX=3133755392*4/5

    [root@oracle01 ~]# echo SHMALL=$(expr $MEMTOTAL/4*1024)

    SHMALL=3133755392/4*1024

    [root@oracle01 ~]# vi /etc/sys

    sysconfig/          sysctl.conf         sysctl.conf.bak     sysctl.d/           systemd/            system-release      system-release-cpe

    [root@oracle01 ~]# vi /etc/sysc

    sysconfig/       sysctl.conf      sysctl.conf.bak  sysctl.d/

    [root@oracle01 ~]# vi /etc/sysctl.conf

    [root@oracle01 ~]#

    [root@oracle01 ~]# cat /etc/sysctl.conf

    fs.aio-max-nr = 1048576

    fs.file-max = 6815744

    kernel.shmmax = 2507004313

    kernel.shmall = 12241232

    kernel.shmmni = 4096

    kernel.sem = 250 32000 100 128

    net.ipv4.ip_local_port_range = 9000 65500

    net.core.rmem_default = 262144

    net.core.rmem_max = 4194304

    net.core.wmem_default = 262144

    net.core.wmem_max = 1048576

    kernel.panic_on_oops = 1

     

    [root@oracle01 ~]# sysctl -p

    fs.aio-max-nr = 1048576

    fs.file-max = 6815744

    kernel.shmmax = 2507004313

    kernel.shmall = 12241232

    kernel.shmmni = 4096

    kernel.sem = 250 32000 100 128

    net.ipv4.ip_local_port_range = 9000 65500

    net.core.rmem_default = 262144

    net.core.rmem_max = 4194304

    net.core.wmem_default = 262144

    net.core.wmem_max = 1048576

    kernel.panic_on_oops = 1

    8. 配置用户变量

     

    节点一:

    [grid@oracle01:/home/grid]$cat .bash_profile

    # .bash_profile

    # Get the aliases and functions

    if [ -f ~/.bashrc ]; then

            . ~/.bashrc

    fi

     

    # User specific environment and startup programs

    PATH=$PATH:$HOME/.local/bin:$HOME/bin

     

    export PATH

     

    umask 022

    export TMP=/tmp

    export LANG=en_US

    export TMPDIR=$TMP

    export ORACLE_HOSTNAME=oracle01

    export ORACLE_SID=+ASM1

    export ORACLE_TERM=xterm

    export ORACLE_BASE=/u01/app/grid

    export ORACLE_HOME=/u01/app/12.2.0/grid

    export NLS_DATE_FORMAT="yyyy-mm-ddHH24:MI:SS"

    export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

    export THREADS_FLAG=native

    if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

            if [ $SHELL = "/bin/ksh" ];then

                    ulimit -p 16384

                    ulimit -n 65536

            else

                    ulimit -u 16384 -n 65536

            fi

                    umask 022

    fi

    [grid@oracle01:/home/grid]$source .bash_profile

     

    [root@oracle01 ~]# su - oracle

    [oracle@oracle01 ~]$ vi .bash_profile

    [oracle@oracle01 ~]$ source .bash_profile

    [oracle@oracle01:/home/oracle]$cat .bash_profile

    # .bash_profile

    # Get the aliases and functions

    if [ -f ~/.bashrc ]; then

            . ~/.bashrc

    fi

     

    # User specific environment and startup programs

    PATH=$PATH:$HOME/.local/bin:$HOME/bin

     

    export PATH

     

    umask 022

    export TMP=/tmp

    export LANG=en_US

    export TMPDIR=$TMP

    export ORACLE_HOSTNAME=oracle01

    export ORACLE_UNQNAME=rac

    export ORACLE_SID=rac01

    export ORACLE_TERM=xterm

    export ORACLE_BASE=/u01/app/oracle

    export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1

    export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

    export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

    export THREADS_FLAG=native

    if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

            if [ $SHELL = "/bin/ksh" ];then

                    ulimit -p 16384

                    ulimit -n 65536

            else

                    ulimit -u 16384 -n 65536

            fi

                    umask 022

    fi

     

    节点二:

    [root@oracle02 ~]# su - grid

    [grid@oracle02 ~]$ vi .bash_profile

    [grid@oracle02 ~]$ cat .bash_profile

    # .bash_profile

    # Get the aliases and functions

    if [ -f ~/.bashrc ]; then

            . ~/.bashrc

    fi

     

    # User specific environment and startup programs

    PATH=$PATH:$HOME/.local/bin:$HOME/bin

     

    export PATH

     

    umask 022

    export TMP=/tmp

    export LANG=en_US

    export TMPDIR=$TMP

    export ORACLE_HOSTNAME=oracle02

    export ORACLE_SID=+ASM2

    export ORACLE_TERM=xterm;export ORACLE_TERM

    export ORACLE_BASE=/u01/app/grid

    export ORACLE_HOME=/u01/app/12.2.0/grid

    export NLS_DATE_FORMAT="yyyy-mm-ddHH24:MI:SS"

    export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

    export THREADS_FLAG=native

    if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

            if [ $SHELL = "/bin/ksh" ];then

                    ulimit -p 16384

                    ulimit -n 65536

            else

                    ulimit -u 16384 -n 65536

            fi

                    umask 022

    fi

     

    [grid@oracle02 ~]$ source .bash_profile

     

    [root@oracle02 ~]# su - oracle

    [oracle@oracle02 ~]$ vi .bash_profile

    [oracle@oracle02 ~]$ cat .bash_profile

    # .bash_profile

    # Get the aliases and functions

    if [ -f ~/.bashrc ]; then

            . ~/.bashrc

    fi

     

    # User specific environment and startup programs

    PATH=$PATH:$HOME/.local/bin:$HOME/bin

     

    export PATH

     

    umask 022

    export TMP=/tmp

    export LANG=en_US

    export TMPDIR=$TMP

    export ORACLE_HOSTNAME=oracle02

    export ORACLE_UNQNAME=rac

    export ORACLE_SID=rac02

    export ORACLE_TERM=xterm

    export ORACLE_BASE=/u01/app/oracle

    export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1

    export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

    export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

    export THREADS_FLAG=native

    if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

            if [ $SHELL = "/bin/ksh" ];then

                    ulimit -p 16384

                    ulimit -n 65536

            else

                    ulimit -u 16384 -n 65536

            fi

                    umask 022

    fi

     

    [oracle@oracle02 ~]$ source .bash_profile

     

    9.配置SSH无密码登陆(两节点)

     

    节点1:

     

    [root@oracle01 ~]# su - grid

    Last login: Sat Jan  4 12:37:40 CST 2020 on pts/0

    [grid@oracle01:/home/grid]$ssh

    ssh          ssh-add      ssh-agent    ssh-copy-id  sshd         sshd-keygen  ssh-keygen   ssh-keyscan

    [grid@oracle01:/home/grid]$ssh-keygen

    Generating public/private rsa key pair.

    Enter file in which to save the key (/home/grid/.ssh/id_rsa):

    Created directory '/home/grid/.ssh'.

    Enter passphrase (empty for no passphrase):

    Enter same passphrase again:

    Your identification has been saved in /home/grid/.ssh/id_rsa.

    Your public key has been saved in /home/grid/.ssh/id_rsa.pub.

    The key fingerprint is:

    SHA256:7ieUDFT+LZ+ZUReTPnG9Oqae07YeULYoTONGe9zS8Vw grid@oracle01

    The key's randomart image is:

    +---[RSA 2048]----+

    |       ..      oo|

    |      ..       o=|

    |     .  .+   +o E|

    |      . =.+.*.==.|

    |       oSBo*o+.o.|

    |       .= oooO   |

    |       ..   O..  |

    |       .. .o.o.  |

    |        .o.o+o.  |

    +----[SHA256]-----+

    [grid@oracle01:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub grid@192.168.157.138

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

    ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

    ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    grid@192.168.157.138's password:

    Permission denied, please try again.

    grid@192.168.157.138's password:

     

    Number of key(s) added: 1

     

    Now try logging into the machine, with:   "ssh 'grid@192.168.157.138'"

    and check to make sure that only the key(s) you wanted were added.

     

    [grid@oracle01:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub grid@192.168.157.137

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

    ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

    ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    grid@192.168.157.137's password:

     

    Number of key(s) added: 1

     

    Now try logging into the machine, with:   "ssh 'grid@192.168.157.137'"

    and check to make sure that only the key(s) you wanted were added.

     

    [grid@oracle01:/home/grid]$exit

    logout

    [root@oracle01 ~]# su - oracle

    Last login: Sat Jan  4 12:46:13 CST 2020 on pts/0

    [oracle@oracle01:/home/oracle]$ssh-keygen

    Generating public/private rsa key pair.

    Enter file in which to save the key (/home/oracle/.ssh/id_rsa):

    Created directory '/home/oracle/.ssh'.

    Enter passphrase (empty for no passphrase):

    Enter same passphrase again:

    Your identification has been saved in /home/oracle/.ssh/id_rsa.

    Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.

    The key fingerprint is:

    SHA256:+jSLEAkSRHqrkvUR5YVg4noCKRQL9yOEUXTCfUfo4rk oracle@oracle01

    The key's randomart image is:

    +---[RSA 2048]----+

    |*@O.+..+o        |

    |=*o*.o+..        |

    |*.= +o..         |

    |o+ +.+.          |

    |o +.+o  S        |

    | * .oo .         |

    |+   o.. o        |

    |.   E. + o       |

    |      . o        |

    +----[SHA256]-----+

    [oracle@oracle01:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub oracle@192.168.157.138

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

    ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

    ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    oracle@192.168.157.138's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'oracle@192.168.157.138'"

    and check to make sure that only the key(s) you wanted were added.

    [oracle@oracle01:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub oracle@192.168.157.137

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

    ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

    ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    oracle@192.168.157.137's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'oracle@192.168.157.137'"

    and check to make sure that only the key(s) you wanted were added.

     

    [root@oracle01 ~]# ssh-keygen

    Generating public/private rsa key pair.

    Enter file in which to save the key (/root/.ssh/id_rsa):

    Enter passphrase (empty for no passphrase):

    Enter same passphrase again:

    Your identification has been saved in /root/.ssh/id_rsa.

    Your public key has been saved in /root/.ssh/id_rsa.pub.

    The key fingerprint is:

    SHA256:abP1A7fcXyhDMX2dN0e5TZ1bj0SoV1axfJvJjKZEaCw root@oracle01

    The key's randomart image is:

    +---[RSA 2048]----+

    |             o.oB|

    |        . . ..=+B|

    |       E + oo+.B%|

    |        o.o .o=+@|

    |        S oooo * |

    |       . +.*oo . |

    |        .  .B o .|

    |             + ..|

    |                .|

    +----[SHA256]-----+

    [root@oracle01 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.157.138

    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    root@192.168.157.138's password:

     

    Number of key(s) added: 1

     

    Now try logging into the machine, with:   "ssh 'root@192.168.157.138'"

    and check to make sure that only the key(s) you wanted were added.

     

    [root@oracle01 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.157.137

    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

    ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

    ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

    Are you sure you want to continue connecting (yes/no)? yes

    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    root@192.168.157.137's password:

     

    Number of key(s) added: 1

     

    Now try logging into the machine, with:   "ssh 'root@192.168.157.137'"

    and check to make sure that only the key(s) you wanted were added.

     

    节点2:

     

    [root@oracle02 ~]# su - grid

    Last login: Sat Jan  4 12:49:13 CST 2020 on pts/0

    [grid@oracle02:/home/grid]$

    [grid@oracle02:/home/grid]$ssh-keygen

    Generating public/private rsa key pair.

    Enter file in which to save the key (/home/grid/.ssh/id_rsa):

    Enter passphrase (empty for no passphrase):

    Enter same passphrase again:

    Your identification has been saved in /home/grid/.ssh/id_rsa.

    Your public key has been saved in /home/grid/.ssh/id_rsa.pub.

    The key fingerprint is:

    SHA256:vPazYJaAmjXlpedX8AJj4WYTMtNvGMJKaLk7xA7yPrA grid@oracle02

    The key's randomart image is:

    +---[RSA 2048]----+

    |   o .+.o        |

    |  + . o=oo       |

    | o o ...X+.      |

    |o + .+ B.+oo     |

    |.= .+ + S.. o    |

    |. =+ . + o o     |

    | +o.    O .      |

    |E o    + +.      |

    |   .      oo     |

    +----[SHA256]-----+

    [grid@oracle02:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub grid@192.168.157.137

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

    ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

    ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    grid@192.168.157.137's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'grid@192.168.157.137'"

    and check to make sure that only the key(s) you wanted were added.

    [grid@oracle02:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub grid@192.168.157.138

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

    ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

    ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    grid@192.168.157.138's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'grid@192.168.157.138'"

    and check to make sure that only the key(s) you wanted were added.

    [grid@oracle02:/home/grid]$

    [grid@oracle02:/home/grid]$exit

    logout

    [root@oracle02 ~]# su - oracle

    Last login: Sat Jan  4 12:51:01 CST 2020 on pts/0

    [oracle@oracle02:/home/oracle]$ssh-keygen

    Generating public/private rsa key pair.

    Enter file in which to save the key (/home/oracle/.ssh/id_rsa):

    Enter passphrase (empty for no passphrase):

    Enter same passphrase again:

    Your identification has been saved in /home/oracle/.ssh/id_rsa.

    Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.

    The key fingerprint is:

    SHA256:9AOgZtzCmbOs4Za1k4oVsL46EkxpgxOgfyERWlgEn2E oracle@oracle02

    The key's randomart image is:

    +---[RSA 2048]----+

    |+=E.  .          |

    |+= * = .         |

    |=.= % . o        |

    |oO = = . o       |

    |=.= =   S o      |

    |oo B o     .     |

    | o* +            |

    |o+.. .           |

    |=o.              |

    +----[SHA256]-----+

    [oracle@oracle02:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub grid@192.168.157.137

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

    ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

    ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    grid@192.168.157.137's password:

    Permission denied, please try again.

    grid@192.168.157.137's password:

    Permission denied, please try again.

    grid@192.168.157.137's password:

    [oracle@oracle02:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub oracle@192.168.157.137

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    oracle@192.168.157.137's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'oracle@192.168.157.137'"

    and check to make sure that only the key(s) you wanted were added.

    [oracle@oracle02:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub oracle@192.168.157.138

    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

    ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

    ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

    Are you sure you want to continue connecting (yes/no)? yes

    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    oracle@192.168.157.138's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'oracle@192.168.157.138'"

    and check to make sure that only the key(s) you wanted were added.

     

    [root@oracle02 ~]# ssh-keygen

    Generating public/private rsa key pair.

    Enter file in which to save the key (/root/.ssh/id_rsa):

    Enter passphrase (empty for no passphrase):

    Enter same passphrase again:

    Your identification has been saved in /root/.ssh/id_rsa.

    Your public key has been saved in /root/.ssh/id_rsa.pub.

    The key fingerprint is:

    SHA256:+2GbnG/KaCrnOlXLMhiDg8DYqe1kkc/xYfjtCojpZns root@oracle02

    The key's randomart image is:

    +---[RSA 2048]----+

    |o. o .           |

    |o.= o o          |

    |.+ = = o         |

    |o * = o o        |

    | * o + +S.       |

    |o o o + +.       |

    |.    o +. o      |

    | + Eo o .* =.    |

    |o.o .*oo. O+.    |

    +----[SHA256]-----+

    [root@oracle02 ~]#

    [root@oracle02 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.157.137

    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

    ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

    ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

    Are you sure you want to continue connecting (yes/no)? yes

    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    root@192.168.157.137's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'root@192.168.157.137'"

    and check to make sure that only the key(s) you wanted were added.

    [root@oracle02 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.157.138

    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

    The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

    ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

    ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

    Are you sure you want to continue connecting (yes/no)? yes

    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

    root@192.168.157.138's password:

    Number of key(s) added: 1

    Now try logging into the machine, with:   "ssh 'root@192.168.157.138'"

    and check to make sure that only the key(s) you wanted were added.

     

    10.共享存储

     

    10.1 创建共享存储

     

    该步骤可以用cmd命令也可以用图形界面,本文采用命令行进行添加。

    在cmd 中进入 WMware Workstation安装目录,执行命令创建磁盘:

     

    D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 6GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\ocr.vmdk"

    Creating disk 'D:\Virtual Machines\rac12c-sharedisk\ocr.vmdk'

      Create: 100% done.

    Virtual disk creation successful.

     

    D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\fra.vmdk"

    Creating disk 'D:\Virtual Machines\rac12c-sharedisk\fra.vmdk'

      Create: 100% done.

    Virtual disk creation successful.

     

    D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\data.vmdk"

    Creating disk 'D:\Virtual Machines\rac12c-sharedisk\data.vmdk'

      Create: 100% done.

    Virtual disk creation successful.

     

    D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\mgmt.vmdk"

    Creating disk 'D:\Virtual Machines\rac12c-sharedisk\mgmt.vmdk'

      Create: 100% done.

    Virtual disk creation successful.

     

    D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\arch.vmdk"

    Creating disk 'D:\Virtual Machines\rac12c-sharedisk\arch.vmdk'

      Create: 100% done.

    Virtual disk creation successful

     

     

    注意:12c R1OCR磁盘组最少需要5501MB的空间。

    [INS-30515] Insufficient space available in the selected disks.

    Cause - Insufficient space available in the selected Disks. At least, 5,501 MB of free space is required. 

    Action - Choose additional disks such that the total size should be at least 5,501 MB.

     

    10.2 修改配置文件

     

    关闭两台虚拟机,用记事本打开 虚拟机名字.vmx,即打开配置文件,2个节点都需要修改。

     

    添加以下内容,其中,scsix:y 表示第x个总线上的第y个设备

     

    #shared disks configure

    disk.EnableUUID="TRUE"
    disk.locking = "FALSE"
    scsi1.shared = "TRUE"
    diskLib.dataCacheMaxSize = "0"
    diskLib.dataCacheMaxReadAheadSize = "0"
    diskLib.dataCacheMinReadAheadSize = "0"
    diskLib.dataCachePageSize= "4096"
    diskLib.maxUnsyncedWrites = "0"

    scsi1.present = "TRUE"
    scsi1.virtualDev = "lsilogic"
    scsil.sharedBus = "VIRTUAL"

    scsi1:0.present = "TRUE"
    scsi1:0.mode = "independent-persistent"
    scsi1:0.fileName = "D:\Virtual Machines\rac12c-sharedisk\ocr.vmdk"
    scsi1:0.deviceType = "disk"
    scsi1:0.redo = ""

    scsi1:1.present = "TRUE"
    scsi1:1.mode = "independent-persistent"
    scsi1:1.fileName = "D:\Virtual Machines\rac12c-sharedisk\data.vmdk"
    scsi1:1.deviceType = "disk"
    scsi1:1.redo = ""

    scsi1:2.present = "TRUE"
    scsi1:2.mode = "independent-persistent"
    scsi1:2.fileName = "D:\Virtual Machines\rac12c-sharedisk\fra.vmdk"
    scsi1:2.deviceType = "disk"
    scsi1:2.redo = ""

    scsi1:3.present = "TRUE"
    scsi1:3.mode = "independent-persistent"
    scsi1:3.fileName = "D:\Virtual Machines\rac12c-sharedisk\arch.vmdk"
    scsi1:3.deviceType = "disk"
    scsi1:3.redo = ""

    scsi1:4.present = "TRUE"
    scsi1:4.mode = "independent-persistent"
    scsi1:4.fileName = "D:\Virtual Machines\rac12c-sharedisk\mgmt.vmdk"
    scsi1:4.deviceType = "disk"
    scsi1:4.redo = ""

     

    10.3 重新打开VMware

     

    关闭 VMware Workstation 软件重新打开,此时看到共享磁盘正确加载则配置正确,这里尤其注意第二个节点,2个节点的硬盘配置和网络适配器的配置应该是一样的,若不一样请检查配置。

    之后重启虚拟机

     

    [root@oracle01 ~]# fdisk -l | grep /dev/sd

    Disk /dev/sdb: 6442 MB, 6442450944 bytes, 12582912 sectors

    Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors

    Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors

    /dev/sda1   *        2048      821247      409600   83  Linux

    /dev/sda2          821248   209715199   104446976   8e  Linux LVM

    Disk /dev/sde: 10.7 GB, 10737418240 bytes, 20971520 sectors

    Disk /dev/sdd: 10.7 GB, 10737418240 bytes, 20971520 sectors

    Disk /dev/sdf: 10.7 GB, 10737418240 bytes, 20971520 sectors

    [root@oracle01 ~]# fdisk -l | grep  "Disk /dev/sd"

    Disk /dev/sdb: 6442 MB, 6442450944 bytes, 12582912 sectors

    Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors

    Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors

    Disk /dev/sde: 10.7 GB, 10737418240 bytes, 20971520 sectors

    Disk /dev/sdd: 10.7 GB, 10737418240 bytes, 20971520 sectors

    Disk /dev/sdf: 10.7 GB, 10737418240 bytes, 20971520 sectors

     

     

    11.设置共享存储

     

    检查UUID,两个节点的UUID必须一致:

    [root@oracle01 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdb

    36000c290a8f5dd6c3150d2e49bde5183

    [root@oracle01 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdc

    36000c296c1e9562d242fd56571092a91

    [root@oracle01 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdd

    36000c292da65f477ffc932927cb35c08

    [root@oracle01 ~]# /usr/lib/udev/scsi_id -g -u /dev/sde

    36000c29b3a17f0629d504249a7508d24

    [root@oracle01 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdf

    36000c29b15d777ab379b1b882f9be1be

     

    [root@oracle02 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdb

    36000c290a8f5dd6c3150d2e49bde5183

    [root@oracle02 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdc

    36000c296c1e9562d242fd56571092a91

    [root@oracle02 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdd

    36000c292da65f477ffc932927cb35c08

    [root@oracle02 ~]# /usr/lib/udev/scsi_id -g -u /dev/sde

    36000c29b3a17f0629d504249a7508d24

    [root@oracle02 ~]# /usr/lib/udev/scsi_id -g -u /dev/sdf

    36000c29b15d777ab379b1b882f9be1be

     

    创建磁盘组(udev)

     

    新增的每个磁盘都要用fdisk处理一下(只执行一个节点,另外一个节点会同步),

    [root@oracle01 ~]# fdisk /dev/sdg

    Welcome to fdisk (util-linux 2.23.2).

     

    Changes will remain in memory only, until you decide to write them.

    Be careful before using the write command.

     

    Device does not contain a recognized partition table

    Building a new DOS disklabel with disk identifier 0xd89e766a.

     

    Command (m for help): n

    Partition type:

       p   primary (0 primary, 0 extended, 4 free)

       e   extended

    Select (default p):

    Using default response p

    Partition number (1-4, default 1):

    First sector (2048-104857599, default 2048):

    Using default value 2048

    Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):

    Using default value 104857599

    Partition 1 of type Linux and of size 50 GiB is set

     

    Command (m for help): w

    The partition table has been altered!

     

    Calling ioctl() to re-read partition table.

    Syncing disks.

     

     

    [root@oracle01 rules.d]# pwd
    /etc/udev/rules.d
    [root@oracle01 rules.d]
    # cat 99-oracle-asmdevics.rules

    KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c290a8f5dd6c3150d2e49bde5183", RUN+="/bin/sh -c 'mknod /dev/asmdisk_ocr b $major $minor; chown grid:asmadmin /dev/asmdisk_ocr; chmod 0660 /dev/asmdisk_ocr'"

    KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c296c1e9562d242fd56571092a91", RUN+="/bin/sh -c 'mknod /dev/asmdisk_data01 b $major $minor; chown grid:asmadmin /dev/asmdisk_data01; chmod 0660 /dev/asmdisk_data01'"

    KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c292da65f477ffc932927cb35c08", RUN+="/bin/sh -c 'mknod /dev/asmdisk_fra b $major $minor; chown grid:asmadmin /dev/asmdisk_fra; chmod 0660 /dev/asmdisk_fra'"

    KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29b3a17f0629d504249a7508d24", RUN+="/bin/sh -c 'mknod /dev/asmdisk_arch b $major $minor; chown grid:asmadmin /dev/asmdisk_arch; chmod 0660 /dev/asmdisk_arch'"

    KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29b15d777ab379b1b882f9be1be", RUN+="/bin/sh -c 'mknod /dev/asmdisk_data02 b $major $minor; chown grid:asmadmin /dev/asmdisk_data02; chmod 0660 /dev/asmdisk_data02'"

    KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2975c24408268b1acee46816143", RUN+="/bin/sh -c 'mknod /dev/asmdisk_mgmt b $major $minor; chown grid:asmadmin /dev/asmdisk_mgmt; chmod 0660 /dev/asmdisk_mgmt'"

    [root@oracle01 ~]# /sbin/udevadm control --reload-rules
    [root@oracle01 ~]# /sbin/udevadm trigger --type=devices --action=change
    [root@oracle01 rules.d]# ll /dev/asm*

    brw-rw---- 1 grid asmadmin 8, 64 Jan  7 09:59 /dev/asmdisk_arch

    brw-rw---- 1 grid asmadmin 8, 32 Jan  7 09:59 /dev/asmdisk_data

    brw-rw---- 1 grid asmadmin 8, 32 Jan  7 10:04 /dev/asmdisk_data01

    brw-rw---- 1 grid asmadmin 8, 80 Jan  7 10:04 /dev/asmdisk_data02

    brw-rw---- 1 grid asmadmin 8, 48 Jan  7 09:59 /dev/asmdisk_fra

    brw-rw---- 1 grid asmadmin 8, 80 Jan  7 09:59 /dev/asmdisk_mgmt

    brw-rw---- 1 grid asmadmin 8, 16 Jan  7 09:59 /dev/asmdisk_ocr

     

    [root@oracle01 rules.d]# scp 99-oracle-asmdevics.rules root@192.168.157.138:/etc/udev/rules.d/

    99-oracle-asmdevics.rules

    [root@oracle02 ~]# /sbin/udevadm control --reload-rules

    [root@oracle02 ~]# /sbin/udevadm trigger --type=devices --action=change

    [root@oracle02 ~]# ll /dev/asm*

    brw-rw---- 1 grid asmadmin 8, 64 Jan  7 10:06 /dev/asmdisk_arch

    brw-rw---- 1 grid asmadmin 8, 32 Jan  7 10:06 /dev/asmdisk_data01

    brw-rw---- 1 grid asmadmin 8, 80 Jan  7 10:06 /dev/asmdisk_data02

    brw-rw---- 1 grid asmadmin 8, 48 Jan  7 10:06 /dev/asmdisk_fra

    brw-rw---- 1 grid asmadmin 8, 96 Jan  7 10:06 /dev/asmdisk_mgmt

    brw-rw---- 1 grid asmadmin 8, 16 Jan  7 10:06 /dev/asmdisk_ocr

    12.安装图形界面

    [root@orcl12c ~]# yum install tigervnc-server

    [root@orcl12c ~]# yum install xdpyinfo

    [root@oracle01 ~]# vncserver

    You will require a password to access your desktops.

     

    Password:

    Verify:

    Passwords don't match - try again

    Password:

    Verify:

    Would you like to enter a view-only password (y/n)? y

    Password:

    Verify:

    xauth:  file /root/.Xauthority does not exist

    New 'oracle01:1 (root)' desktop is oracle01:1

    Creating default startup script /root/.vnc/xstartup

    Creating default config /root/.vnc/config

    Starting applications specified in /root/.vnc/xstartup

    Log file is /root/.vnc/oracle01:1.log

    [root@oracle01 ~]# export DISPLAY=localhost:0.0

    [root@oracle01 ~]# cd 安装目录

    [root@oracle01 ~]# ./runInstaller

     

     

     

     

    这里怎么选择看

    (1)先在节点一执行/u01/app/oraInventory/orainstRoot.sh,再到节点二执行/u01/app/oraInventory/orainstRoot.sh

    (2)然后执行节点一执行/u01/app/grid-install/root.sh,再节点二执行/u01/app/grid-install/root.sh

     

     

     

    原因:

    由于配置/etc/hosts来解析SCAN,导致未来走DNS来进行SCAN的解析,爆出此错误,可以考虑略掉

    解决办法:ping scan ip 如果可以ping通,忽略即可。

     

    [root@oracle01 oraInventory]# cat /etc/hosts

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

     

    # public ip

    192.168.157.137 oracle01

    192.168.157.138 oracle02

     

     

    # Private IP

    10.10.10.129 oracle01-priv

    10.10.10.130 oracle02-priv

     

    # Virtual IP

    192.168.157.237 oracle01-vip

    192.168.157.238 oracle02-vip

     

    # Scan IP

    192.168.157.139 oracle-cluster

    [root@oracle01 oraInventory]# ping -c 4 192.168.157.139

    PING 192.168.157.139 (192.168.157.139) 56(84) bytes of data.

    64 bytes from 192.168.157.139: icmp_seq=1 ttl=64 time=0.017 ms

    64 bytes from 192.168.157.139: icmp_seq=2 ttl=64 time=0.025 ms

    64 bytes from 192.168.157.139: icmp_seq=3 ttl=64 time=0.026 ms

    64 bytes from 192.168.157.139: icmp_seq=4 ttl=64 time=0.028 ms

     

    --- 192.168.157.139 ping statistics ---

    4 packets transmitted, 4 received, 0% packet loss, time 3000ms

    rtt min/avg/max/mdev = 0.017/0.024/0.028/0.004 ms

    [root@oracle01 oraInventory]# ping -c 4 oracle-cluster

    PING oracle-cluster (192.168.157.139) 56(84) bytes of data.

    64 bytes from oracle-cluster (192.168.157.139): icmp_seq=1 ttl=64 time=0.019 ms

    64 bytes from oracle-cluster (192.168.157.139): icmp_seq=2 ttl=64 time=0.027 ms

    64 bytes from oracle-cluster (192.168.157.139): icmp_seq=3 ttl=64 time=0.026 ms

    64 bytes from oracle-cluster (192.168.157.139): icmp_seq=4 ttl=64 time=0.029 ms

     

    --- oracle-cluster ping statistics ---

    4 packets transmitted, 4 received, 0% packet loss, time 3000ms

    rtt min/avg/max/mdev = 0.019/0.025/0.029/0.005 ms

     

    至此,grid安装完成

     

    12.配置磁盘组

     

    [grid@oracle01 ~]$ export DISPLAY=192.168.213.23:0.0

    [grid@oracle01 ~]$ asmca

     

     

    13.安装数据库软件

    [oracle@oracle01 database]$ export DISPLAY=192.168.213.23:0.0

    [oracle@oracle01 database]$ ./runInstaller

    Starting Oracle Universal Installer...

     

    Checking Temp space: must be greater than 500 MB.   Actual 2662 MB    Passed

    Checking swap space: must be greater than 150 MB.   Actual 1767 MB    Passed

    Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-01-07_01-48-07PM. Please wait ...[oracle@oracle01 database]$

     

     

     

     

     

     

     

     

     

     

     

     

    先节点一执行:/u01/app/oracle/product/12.2.0/db_1/root.sh,再执行/u01/app/oracle/product/12.2.0/db_1/root.sh

     

     

    14.dbca建库:

    [grid@oracle01 ~]$ crsctl status res -t

    --------------------------------------------------------------------------------

    Name           Target  State        Server                   State details      

    --------------------------------------------------------------------------------

    Local Resources

    --------------------------------------------------------------------------------

    ora.ARCH.dg

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.ASMNET1LSNR_ASM.lsnr

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.DATA.dg

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.FRA.dg

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.LISTENER.lsnr

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.MGMT.dg

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.OCR.dg

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.chad

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.net1.network

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    ora.ons

                   ONLINE  ONLINE       oracle01                 STABLE

                   ONLINE  ONLINE       oracle02                 STABLE

    --------------------------------------------------------------------------------

    Cluster Resources

    --------------------------------------------------------------------------------

    ora.LISTENER_SCAN1.lsnr

          1        ONLINE  ONLINE       oracle02                 STABLE

    ora.MGMTLSNR

          1        ONLINE  ONLINE       oracle02                 169.254.82.84 10.10.

                                                                 10.130,STABLE

    ora.asm

          1        ONLINE  ONLINE       oracle01                 Started,STABLE

          2        ONLINE  ONLINE       oracle02                 Started,STABLE

          3        OFFLINE OFFLINE                               STABLE

    ora.cvu

          1        ONLINE  ONLINE       oracle02                 STABLE

    ora.mgmtdb

          1        ONLINE  ONLINE       oracle02                 Open,STABLE

    ora.oracle01.vip

          1        ONLINE  ONLINE       oracle01                 STABLE

    ora.oracle02.vip

          1        ONLINE  INTERMEDIATE oracle01                 FAILED OVER,STABLE

    ora.qosmserver

          1        ONLINE  ONLINE       oracle02                 STABLE

    ora.rac.db

          1        ONLINE  ONLINE       oracle01                 Open,HOME=/u01/app/o

                                                                 racle/product/12.2.0

                                                                 /db_1,STABLE

          2        ONLINE  ONLINE       oracle02                 Open,HOME=/u01/app/o

                                                                 racle/product/12.2.0

                                                                 /db_1,STABLE

    ora.scan1.vip

          1        ONLINE  ONLINE       oracle02                 STABLE

    --------------------------------------------------------------------------------

    展开全文
  • CentOS7 安装 Oracle 12C

    2021-06-01 15:56:01
    第一次在Linux环境下安装Oracle,搜索关键字:CentOS7 安装 Oracle 12C。 看了近十篇帖子,流程都差不多:下载依赖包 > 关闭防火墙 > 修改内核参数 > 新增用户 > 修改用户相关配置 > 安装JDK > ...
  • Centos7.*静默安装Oralce12.2的笔记,不适合Linux纯小白,起码懂得基本命令的作用和#和$的区别,笔记基本能复用,但要根据你电脑的内存修改一点配置和安装的目录需要按需修改
  • 文章目录一、监听配置 一、监听配置 # 切换到oracle用户 su - oracle # 启动监听图形化页面 netca dbca
  • CentOS 7 安装 Oracle 12c 最佳实践

    千次阅读 2019-09-28 22:32:28
    本例操作系统版本:CentOS 7.7、数据库版本:Oracle 12c(12.2) 安装步骤如下分解: 1.关闭防火墙,禁止防火墙开机自启 systemctl stop firewalld.service --关闭防火墙 systemctl disable firewalld.service – ...
  • centos安装oracle12c

    2018-11-23 15:21:38
    介绍centos6系统下安装oracle12c的全过程。很详细。初学者实用。
  • CentOS7安装Oracle 12c

    2021-04-29 14:50:58
    CentOS7安装Oracle 12c 环境: CentOS7@VMware12,分配资源:CPU:2颗,内存:4GB,硬盘空间:30GB Oracle 12C企业版64位 下载地址:...
  • CentOS7安装 Oracle 12c

    千次阅读 2017-02-17 16:58:32
    折腾好久终于在Centos安装上了oracle12c。国内好多类似文章基本都一样,但是按照那些方法并没有成功。最终还是按照国外一个的教程安装上了。 以下是原文,网络配置部分可以忽略。   In this tutorial, we ...
  • CentOS7安装Oracle12c图文详解

    万次阅读 2018-10-29 11:27:25
    CentOS7@VMware12,分配资源:CPU:2颗,内存:4GB,硬盘空间:30GB Oracle 12C企业版64位 下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 过程纪要: root...
  • Centos 7 Oracle 12C 超详细安装
  • CentOS7安装Oracle 12C

    2016-08-28 07:44:32
    实验环境:Oracle VM VirtualBox 4.2.12 ...实验目标:熟悉LINUX7安装Oracle12C   操作演示: (1)、安装Linux7操作系统 略 (2)、官网下载oracle软件包 略 (3)、下载oracle12
  • 这是经过测试环境测试后,在正式环境中安装完成成功的...安装教程超级详细,CentOS7.5静默安装ORACLE12C教程,包含安装所需的配置文件db_install.rsp、dbca.rsp、netca.rsp、listener.ora、tnsnames.ora等详细信息。
  • 写下这篇文章时候,我刚刚看到这个页面:除了心累,还叹了...首先啊,我先说明一下,这个oracle数据库必须是图形化安装,无论是windows还是linux,所以小白们如果需要安装在Linux上,最好在装系统时候,就装上GUI...
  • Oracle 12cR1官方文档中的rpm依赖包,支持CentOS 7.X和Redhat 7.X等64位Linux操作系统。
  • Linux Centos7安装Oracle12c第二版本

    万次阅读 2017-08-10 16:20:41
    环境: CentOS7@VMware12,分配...Oracle12C企业版64位 下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 过程纪要: root身份安装依赖包: yum -y install binutil
  • Centos7安装oracle12C

    2020-09-05 23:41:18
    注:本教程在结合网上教程,自己实际安装记录! 准备软件: 1.12c数据库安装包:linuxx64_12201_database.zip 2.jdk的rpm包:jdk-8u201-linux-x64.rpm 数据库安装流程: 1.安装依赖: yum -y install binutils ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,227
精华内容 1,290
关键字:

centos7安装oracle12c