软件下载
下载linuxx64_12201_grid_home.zip和linuxx64_12201_database.zip
操作系统版本Cent OS 7.6
1、关闭selinux、防火墙、NTP
#vim /etc/selinux/config
SELINUX=disabled
# systemctl stop firewalld
# systemctl disable firewalld
# systemctl stop chronyd
# systemctl disable chronyd
# systemctl stop ntpd
# systemctl disable ntpd
2、配置hosts文件,添加以下内容
#vim /etc/hosts
# Public
10.1.1.11 rac1
10.1.1.12 rac2
# Private
172.16.1.1 rac1-priv
172.16.1.2 rac2-priv
# Virtual
10.1.1.15 rac1-vip
10.1.1.16 rac2-vip
# SCAN IP
10.1.1.19 scanip
3、内存参数调整(128GB内存 63GB tmpfs时的设置)
1)使用root创建以下文件,添加以下参数。
#vim /etc/sysctl.d/97-oracle-database-sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 16515072
kernel.shmmax = 67645734912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
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
2)执行以下命令,检查系统参数
# /sbin/sysctl –system
4、加载pam_limits.so模块
#vim /etc/pam.d/login
session required pam_limits.so
5、创建组和用户
#/usr/sbin/groupadd -g 501 oinstall
#/usr/sbin/groupadd -g 502 dba
#/usr/sbin/groupadd -g 504 asmadmin
#/usr/sbin/groupadd -g 506 asmdba
#/usr/sbin/groupadd -g 507 asmoper
#/usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid
#/usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba oracle
6、配置用户的shell limit
#vim /etc/security/limits.conf
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
7、修改profile文件,添加以下内容
#vim /etc/profile
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
8、创建Inventory目录
#mkdir -p /u01/app/oraInventory
#chown -R grid:oinstall /u01/app/oraInventory
#chmod -R 775 /u01/app/oraInventory
9、创建Grid Base 目录
#mkdir -p /u01/app/grid
#chown -R grid:oinstall /u01/app/grid
10、创建Grid Home 目录
#mkdir -p /u01/12.2.0/grid
#chown -R grid:oinstall /u01/12.2.0/grid
#chmod -R 775 /u01/12.2.0/grid
11、创建Oracle Base 目录
#mkdir -p /u01/app/oracle
#mkdir /u01/app/oracle/cfgtoollogs
#chown -R oracle:oinstall /u01/app/oracle
#chmod -R 775 /u01/app/oracle
12、创建Oracle Home 目录
#mkdir -p /u01/app/oracle/product/12.2.0/db_1
#chown -R oracle:oinstall /u01/app/oracle/product/12.2.0/db_1
#chmod -R 775 /u01/app/oracle/product/12.2.0/db_1
13、配置oracle 用户的.bash_profile
RAC1
ORACLE_SID=rac122db1; export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1; export ORACLE_HOME
ORACLE_HOSTNAME=racserver01; export ORACLE_HOSTNAME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbm
s/jlib; export CLASSPATH
RAC2
ORACLE_SID=rac122db2; export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1; export ORACLE_HOME
ORACLE_HOSTNAME=racserver02; export ORACLE_HOSTNAME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbm
s/jlib; export CLASSPATH
$source .bash_profile #使环境变量生效
14、配置grid 用户的.bash_profile
RAC1
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_HOME=/u01/12.2.0/grid; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbm
s/jlib; export CLASSPATH
RAC2
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_HOME=/u01/12.2.0/grid; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbm
s/jlib; export CLASSPATH
$source .bash_profile #使环境变量生效
15、配置ASM DISK
创建 /etc/udev/rules.d/99-grid-asmdevices-permission.rules文件,添加以下内容,所有配置完成后,重启所有节点。
#vim /etc/udev/rules.d/99-grid-asmdevices-permission.rules
ENV{DM_NAME}=="CRS*", OWNER="grid", GROUP="asmadmin", MODE="0660"
ENV{DM_NAME}=="DATA*", OWNER="grid", GROUP="asmadmin", MODE="0660"
ENV{DM_NAME}=="ARCH", OWNER="grid", GROUP="asmadmin", MODE="0660"