Oracle Grid Infrastructure 事前準備
# rpm -qa | grep 12c
# rpm –qa | grep asm
###########Public ips############################################
101.21.17.51 dbs1.localdomain dbs1
101.21.17.52 dbs2.localdomain dbs2
###########Private ips############################################
192.168.0.121 dbs1-priv.localdomain dbs1-priv
192.168.0.122 dbs2-priv.localdomain dbs2-priv
###########Virtual ips############################################
101.21.17.53 dbs1-vip.localdomain dbs1-vip
101.21.17.54 dbs2-vip.localdomain dbs2-vip
###########scan ips############################################
101.16.20.55 dbs.test.com dbs
/etc/hosts內的設定如下圖所示
# service iptables stop
# chkconfig iptables off
# service ntpd stop
# mv /etc/ntp.conf /etc/ntp.conf.orig
# rm /var/run/ntpd.pid
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
如下圖所示
# grid soft nofile 1024
# grid hard nofile 65536
# grid soft nproc 2047
# grid hard nproc 16384
# grid soft stack 10240
# grid hard stack 32768
search localdomain
# service dnsmasq restart
# userdel oracle
# rm -rf /home/oracle
# rm -rf /var/mail/oracle
# groupdel oinstall
# groupdel dba
# groupadd -g 1000 oinstall
# groupadd -g 1010 dba
# groupadd -g 1020 asmadmin
# groupadd -g 1030 asmdba
# useradd -u 1100 -g oinstall -G asmadmin,asmdba grid
# mkdir -p /u01/app/12.1.0/grid ####此路徑是grid home
# mkdir -p /u01/app/grid ######此路徑是grid base
# chown -R grid:oinstall /u01
# passwd grid #####注意兩個node的password要一樣
export ORACLE_HOME=/u01/app/12.1.0/grid
export ORACLE_SID=+ASM1 ###########node2 的設定為 +ASM2
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=/u01/app/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
Export
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
如下圖所示
# useradd -u 1101 -g oinstall -G dba,asmdba oracle
# mkdir -p /u01/app/oracle/product/12.1.0 ######此路徑oracle home
# chown -R oracle:oinstall /u01/app/oracle ######此路徑oracle base
# chmod -R 775 /u01
# passwd oracle #####注意兩個node的password最好要相同
使用oracle帳號在/home/oracle/.bash_profile新增環境變數(兩個NODE都需要執行)
export ORACLE_HOME=/u01/app/oracle/product/12.1.0
export ORACLE_SID=db1 ###########node2 的設定為 db2
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib