一、基础结构:
二、存储规划:
1、 GRID集群组件磁盘组
+dggrid: 1个,由三个10G磁盘组成normal
2、 数据库安装磁盘组
+dgsystem:用于数据库基本表空间,控制文件,参数文件等
+dgrecovery:用于归档与闪回日志空间
+dgdata:用户数据库业务表空间
三、IP规划:
Oraclenode1:
publicip : bond0 :192.168.10.103
vip:192.168.10.105
privateip :bond2 :192.168.14.3
oraclenode2:
publicip : bond0 :192.168.10.104
vip:192.168.10.106
privateip :bond2 :192.168.14.4
scanip :192.168.10.107
四、软件版本:
操作系统:CentOS 7.2
数据库:ORACLE12c R1
集群管理软件:ORACLEGRID 12.0.1.2
五、系统环境配置:
注意:如下配置除非特别说明,否则两个节点都需要操作
1、安装软件依赖
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
2、修改host文件
#在两台主机修改host文件,添加如下内容:
vim /etc/hosts
#public ip bond0
192.168.10.103 oraclenode1
192.168.10.104 oraclenode2
#private ip bond2
192.168.14.3 oraclenode1pri
192.168.14.4 oraclenode2pri
#vip ip
192.168.10.105 oraclenode1vip
192.168.10.106 oraclenode2vip
#scan ip
192.168.10.107 oraclenodescan
3、关闭selinux和配置防火墙
setenforce 0
firewall-cmd --set-defaults-zone=trusted
4、添加组与用户
#在两个节点增加用户与组:
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
5、添加目录
mkdir -p /data/oracle/app/grid
mkdir -p /data/oracle/app/12.1.0.2/grid
chown -R grid:oinstall /data/oracle
mkdir -p /data/oracle/app/oraInventory
chown -R grid:oinstall /data/oracle/app/oraInventory
mkdir -p /data/oracle/app/oracle
chown -R oracle:oinstall /data/oracle/app/oracle
chmod -R 775 /data/oracle
6、修改操作系统参数
vim/etc/security/limits.conf
#ORACLE SETTING
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
vim/etc/security/limits.d/20-nproc.conf
# Change this
* soft nproc 1024
# To this
* - nproc 16384
vim/etc/pam.d/login
#ORACLE SETTING
session required pam_limits.so
MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')
SHMMAX=$(expr $MEMTOTAL \*4 / 5)
SHMMNI=4096
SHMALL=$(expr $MEMTOTAL /\( 4 \* 1024 \))
cp /etc/sysctl.conf /etc/sysctl.conf.bak
cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = $SHMMAX
kernel.shmall = $SHMALL
kernel.shmmni = $SHMMNI
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
EOF
# kernel.shmmax大于共享内存区,小于物理内存
# kernel.shmall物理内存/4K
让配置生效:
sysctl –p
#使用centos 7.2 安装grid时,需要修改这个参数,不然会报错
vim /etc/systemd/logind.conf
RemoveIPC=no
systemctldaemon-reload
systemctlrestart systemcd-logind