节点 主机名 pulic ip vip private ip scan ip
rac1 rac1 192.168.5.111 192.168.5.101 10.10.10.11 192.168.5.200
rac2 rac2 192.168.5.112 192.168.5.102 10.10.10.12
rac3 rac3 192.168.5.113 192.168.5.103 10.10.10.13

1.安装检查环境
https://www.yuque.com/docs/share/4196ef7e-8cbf-4268-87d5-ae4b775d9322?#

新添hosts 文件

vi /etc/hosts

  1. #Public
  2. 192.168.5.111 rac1
  3. 192.168.5.112 rac2
  4. 192.168.5.113 rac3
  5. #Virtual
  6. 192.168.5.101 rac1-vip
  7. 192.168.5.102 rac2-vip
  8. 192.168.5.103 rac3-vip
  9. #Private
  10. 10.10.10.11 rac1-priv
  11. 10.10.10.12 rac2-priv
  12. 10.10.10.13 rac3-priv
  13. #Scan-ip
  14. 192.168.5.200 rac-scan

新环境变量

  1. Oracle Database
  2. .bash_profile
  3. export ORACLE_SID=racdb3
  4. export ORACLE_BASE=/opt/app/oracle
  5. export ORACLE_HOME=/opt/app/oracle/product/12.2.0.1/db_1
  6. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
  7. export PATH=$ORACLE_HOME/bin:$PATH
  8. Grid Infrastructure
  9. .bash_profile
  10. export ORACLE_SID=+ASM3
  11. export ORACLE_BASE=/opt/app/grid
  12. export ORACLE_HOME=/opt/app/12.2.0.1/grid
  13. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
  14. export PATH=$ORACLE_HOME/bin:$PATH

2.备份ocr

  1. su - root
  2. cd /opt/app/12.2.0.1/grid/bin
  3. ./ocrconfig -showbackup
  4. ./ocrconfig -manualbackup

3.新增node环境检查

在已安装完成节点执行

  1. su - grid
  2. cluvfy stage -pre nodeadd -n rac3 -verbose

4.查看已安装节点

  1. su - grid
  2. olsnodes -n -s -t

5.查看数据库配置

  1. srvctl config database -d racdb

6.新节点添加grid

在主节点(rac1)

  1. su - grid
  2. cd /opt/app/12.2.0.1/grid/addnode/
  3. ./addnode.sh

7.在安装程序中设置rac3对等性

8.执行安装脚本

9.启动添加安装database 软件

  1. su - oracle
  2. cd /opt/app/oracle/product/12.2.0.1/dbhome_1/addnode
  3. ./addnode.sh

10.设置rac3 ssh对等性

11.添加实例

命令添加

  1. srvctl add instance -db racdb -instance racdb3 -node rac3

图形化添加
rac3

  1. su - oracle
  2. dbca

image.png
image.png
image.png

12.查看已添加实例

  1. su - grid
  2. lsnrctl status listener_scan1

13.查看所有实例

  1. select * from gv$instance;

14.查看所有实例状态

  1. su - grid
  2. crsctl stat res -t

异常处理

添加节点时时区不同

  1. timedatectl set-timezone Asia/Shanghai

ssh拒绝连接
ssh: connect to host olrac3 port 22: Connection refused
PRVG-9021 : File “/home/grid/.ssh/id_rsa.pub” not found on nodes “olrac3”

  1. ssh-keygen