RHEL6.7下Oracle 12cR2 RAC安装配置及问题解决
RHEL6.7下Oracle 12cR2 RAC安装配置及问题解决
1、操作系统的选择Oracle现在认证的操作系统及内核版本如下:
Oracle Linux 7:
Oracle Linux 7 with the Unbreakable Enterprise kernel 3:3.8.13-35.3.1.el7uek.x86_64 or later
Oracle Linux 7 with the Red Hat Compatible kernel: 3.10.0-54.0.1.el7.x86_64 or later
Oracle Linux 6:
Oracle Linux 6.4 with the Unbreakable Enterprise kernel 2: 2.6.39-400.211.1.el6uek.x86_64or later
Oracle Linux 6.4 with the Red Hat Compatible kernel: 2.6.32-358.el6.x86_64 or later
Red Hat Enterprise Linux 7:
Red Hat Enterprise Linux 7: 3.10.0-54.0.1.el7.x86_64 or later
Red Hat Enterprise Linux 6:
Red Hat Enterprise Linux 6.4: 2.6.32-358.el6.x86_64 or later
SUSE Linux Enterprise Server:
SUSE Linux Enterprise Server 12 SP1: 3.12.49-11.1 or later
安装在rhel6.7操作系统上
[root@rhel6 ~]# uname -a
Linux rhel6 2.6.32-573.el6.x86_64 #1 SMP Wed Jul 1 18:23:37 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@rhel6 ~]# cat /etc/RedHat-release
Red Hat Enterprise Linux Server release 6.7 (Santiago)
2、操作系统的资源分配问题
如果使用服务器,资源足够用那么可以忽略这一条。
如果用笔记本上的虚拟机安装12c R2的RAC请慎重,尤其是内存较小(小于16G)的。
用公司配置的一台vmware esxi虚拟服务器,内存也只有16G,但没有其他虚拟机在跑,每台虚拟机分配了7G的内存,安装过程中内存也一直在90%以上。
3、操作系统的配置
直接按官方文档的要求一步一步的配置
# rpm install packages
yum install -y binutils* compat-libcap1* compat-libstdc++* compat-libstdc++*686* e2fsprogs-libs* glibc*686* glibc* glibc-devel* glibc-devel*686* ksh* libgcc*686* libgcc* libs* libstdc++* libstdc++*686* libstdc++-devel* libstdc++*686* libaio* libaio*686* libaio-devel* libaio-devel*686* libXtst* libXtst*686* libX11*686* libX11* libXau*686* libXau* libxcb*686* libxcb* libXi* libXi*686* make* sysstat* unixODBC* unixODBC-devel* unixODBC*686* unixODBC-devel*686* net-tools* smartmontools* nfs-utils* e2fsprogs*
#configure kernel
[root@localhost ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 67108864
kernel.shmmax = 274877906944
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
#configure user limit
[root@localhost ~]# /etc/security/limits.conf
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft stack 10240
grid hard stack 32768
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
#configure pam
[root@localhost ~]# /etc/pam.d/login
session required pam_limits.so
#configure network
[root@localhost ~]# /etc/hosts
#public
192.168.1.31 rac1
192.168.1.33 rac2
#private
192.168.0.11 rac1-priv
192.168.0.12 rac2-priv
#virtual
192.168.1.32 rac1-vip
192.168.1.34 rac2-vip
#scan ip
192.168.1.35 rac-scan
#configure hostname
[root@localhost ~]# /etc/sysconfig/network
HOSTNAME=rac1
#disable transparent hugepages
[root@localhost ~]# vim /etc/rc.local
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
#disable fireware
[root@localhost ~]# service iptables stop && chkconfig --del iptables
#disable selinux
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
#create users and groups
[root@localhost ~]# groupadd -g 54421 oinstall
groupadd -g 54422 dba
groupadd -g 54423 oper
groupadd -g 54424 backupdba
groupadd -g 54425 dgdba
groupadd -g 54426 kmdba
groupadd -g 54428 asmoper
groupadd -g 54427 asmdba
groupadd -g 54429 asmadmin
groupadd -g 54430 racdba
useradd -u 54321 -g oinstall -G dba,asmdba,oper,asmadmin,asmdba,backupdba,dgdba,asmoper,kmdba,racdba oracle
useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper grid
echo oracle |passwd --stdin oracle
echo oracle |passwd --stdin grid
#configure directories
[root@localhost ~]# mkdir -p /u01/app/12.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/12.2.0/db_1
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/12.2.0
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01
#configure environment variables
rac1:
[root@localhost ~]# su - grid
vim ~/.bash_profile
export ORACLE_SID=+ASM1
export ORACLE_HOME=/u01/app/12.2.0/grid
export ORACLE_BASE=/u01/app/grid
export PATH=$ORACLE_HOME/bin:$PATH
[root@localhost ~]# su - oracle
vim ~/.bash_profile
export ORACLE_SID=rac1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rac2:
[root@localhost ~]# su - grid
export ORACLE_SID=+ASM2
export ORACLE_HOME=/u01/app/12.2.0/grid
export ORACLE_BASE=/u01/app/grid
export PATH=$ORACLE_HOME/bin:$PATH
[root@localhost ~]# su - oracle
export ORACLE_SID=rac2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
#configure ssh
[root@localhost ~]# ssh-keygen -t dsa
ssh-keygen -t tsa
ssh rac1 cat ~/.ssh/id_rsa.pub >> authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> authorized_keys
ssh rac1 cat ~/.ssh/id_dsa.pub >> authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> authorized_keys
#configure raw disks
[root@localhost ~]# raw /dev/raw/raw1 /dev/sdb
raw /dev/raw/raw2 /dev/sdc
raw /dev/raw/raw3 /dev/sdd
raw /dev/raw/raw4 /dev/sde
raw /dev/raw/raw5 /dev/sdf
raw /dev/raw/raw6 /dev/sdg
chown grid:asmadmin /dev/raw/raw*
说下配置磁盘,在Oracle12c里引入了MGMTDB的概念,这个在12.1的RAC里是与OCR在同一个磁盘组里,而且占用的空间大概有几个G,但到了12c R2中,MGMT可以与OCR在同一个磁盘组也可以单独使用一个磁盘组,Oracle默认是单独使用,但在12c R2中MGMTDB占的空间特别的大,要求磁盘空间要在38G以上才行。这里分配的空间容量是sdb和sdc做OCR的磁盘,每个2G,sdd和sde做MGMT的磁盘,每个20G,sdf和sdg做DATA的磁盘。
http://docs.oracle.com/database/122/CWLIN/toc.htm