节点 | 主机名 | 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
#Public
192.168.5.111 rac1
192.168.5.112 rac2
192.168.5.113 rac3
#Virtual
192.168.5.101 rac1-vip
192.168.5.102 rac2-vip
192.168.5.103 rac3-vip
#Private
10.10.10.11 rac1-priv
10.10.10.12 rac2-priv
10.10.10.13 rac3-priv
#Scan-ip
192.168.5.200 rac-scan
新环境变量
Oracle Database
.bash_profile
export ORACLE_SID=racdb3
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=/opt/app/oracle/product/12.2.0.1/db_1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
Grid Infrastructure
.bash_profile
export ORACLE_SID=+ASM3
export ORACLE_BASE=/opt/app/grid
export ORACLE_HOME=/opt/app/12.2.0.1/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
2.备份ocr
su - root
cd /opt/app/12.2.0.1/grid/bin
./ocrconfig -showbackup
./ocrconfig -manualbackup
3.新增node环境检查
在已安装完成节点执行
su - grid
cluvfy stage -pre nodeadd -n rac3 -verbose
4.查看已安装节点
su - grid
olsnodes -n -s -t
5.查看数据库配置
srvctl config database -d racdb
6.新节点添加grid
在主节点(rac1)
su - grid
cd /opt/app/12.2.0.1/grid/addnode/
./addnode.sh
7.在安装程序中设置rac3对等性
8.执行安装脚本
9.启动添加安装database 软件
su - oracle
cd /opt/app/oracle/product/12.2.0.1/dbhome_1/addnode
./addnode.sh
10.设置rac3 ssh对等性
11.添加实例
命令添加
srvctl add instance -db racdb -instance racdb3 -node rac3
图形化添加
rac3
su - oracle
dbca
12.查看已添加实例
su - grid
lsnrctl status listener_scan1
13.查看所有实例
select * from gv$instance;
14.查看所有实例状态
su - grid
crsctl stat res -t
异常处理
添加节点时时区不同
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”
ssh-keygen