Oracle 12cR2版本已經發布有一段時間,一直想測試安裝RAC,從上週末到今天用了兩個週末和今天一天的時間終於把RAC安裝成功了。這裏記錄了安裝時對操做系統的配置,以及安裝過程當中遇到的一些坑。css
一、首先是操做系統的選擇問題,Oracle如今認證的操做系統及內核版本以下:node
Oracle Linux 7:linux
Oracle Linux 7 with the Unbreakable Enterprise kernel 3:3.8.13-35.3.1.el7uek.x86_64 or later
c++
Oracle Linux 7 with the Red Hat Compatible kernel: 3.10.0-54.0.1.el7.x86_64 or later數據庫
Oracle Linux 6:
bash
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
session
Red Hat Enterprise Linux 7:oracle
Red Hat Enterprise Linux 7: 3.10.0-54.0.1.el7.x86_64 or later
app
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)
之因此選擇使用rhel6.7,是由於以前在rhel7.2和OEL7.3上嘗試安裝過,但由於多是有BUG或使用的筆記本的資源不夠用致使沒有安裝成功。不過在rhel7.2上即便安裝單實例的grid會報錯CLSRSC-400: A system reboot is required to continue installing.。因而就選擇了rhel6.7版本。
二、操做系統的資源分配問題
若是你是使用服務器,資源足夠用那麼能夠忽略這一條。
若是想用筆記本上的虛擬機安裝12cR2的RAC請慎重些,尤爲是內存較小(小於16G)的。
我用的筆記本內存是12G,每一個虛擬機分5G,其餘應用所有關閉,內存一直撐在95%左右。另外同事的一臺16G內存的筆記本在安裝grid時,屢次在85%左右時虛擬機直接重啓,一直沒有安裝成功。
今天用的是公司同事配置的一臺vmware esxi虛擬服務器,內存也只有16G,但沒有其餘虛擬機在跑,每臺虛擬機分配了7G的內存,安裝過程當中內存也一直在90%以上。
三、操做系統的配置
這個沒有什麼好說的,直接按官方文檔的要求一步一步的配置就行,下面給出了我作的配置,有興趣的朋友能夠參考:
#install rpms
yum install -y binutils*
yum install -y compat-libcap1*
yum install -y compat-libstdc++*
yum install -y compat-libstdc++*686*
yum install -y e2fsprogs*
yum install -y e2fsprogs-libs*
yum install -y glibc*686*
yum install -y glibc*
yum install -y glibc-devel*
yum install -y glibc-devel*686*
yum install -y ksh*
yum install -y libgcc*686*
yum install -y libgcc*
yum install -y libs*
yum install -y libstdc++*
yum install -y libstdc++*686*
yum install -y libstdc++-devel*
yum install -y libstdc++*686*
yum install -y libaio*
yum install -y libaio*686*
yum install -y libaio-devel*
yum install -y libaio-devel*686*
yum install -y libXtst*
yum install -y libXtst*686*
yum install -y libX11*686*
yum install -y libX11*
yum install -y libXau*686*
yum install -y libXau*
yum install -y libxcb*686*
yum install -y libxcb*
yum install -y libXi*
yum install -y libXi*686*
yum install -y make*
yum install -y net-tools*
yum install -y nfs-utils*
yum install -y sysstat*
yum install -y smartmontools*
yum install -y unixODBC*
yum install -y unixODBC-devel*
yum install -y unixODBC*686*
yum install -y unixODBC-devel*686*
#configure kernel
/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
/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
/etc/pam.d/login
session required pam_limits.so
#configure network
/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
/etc/sysconfig/network
HOSTNAME=rac1
#disable transparent hugepages
vi /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
service iptables stop
chkconfig --del iptables
#disable selinux
/etc/selinux/config
SELINUX=disabled
#create users and groups
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
passwd oracle
passwd grid
#configure directories
mkdir -p /u01/app/12.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/12.2.0/db1
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:
grid
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
oracle
export ORACLE_SID=rac1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db1
export PATH=$ORACLE_HOME/bin:$PATH
rac2:
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
oracle
export ORACLE_SID=rac2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db1
export PATH=$ORACLE_HOME/bin:$PATH
#configure ssh
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
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,但到了12cR2中,MGMT能夠與OCR在同一個磁盤組也能夠單獨使用一個磁盤組,Oracle默認是單獨使用,但在12cR2中MGMTDB佔的空間特別的大,要求磁盤空間要在38G以上才行。因此我這裏分配的空間容量是sdb和sdc作OCR的磁盤,每一個2G,sdd和sde作MGMT的磁盤,每一個20G,sdf和sdg作DATA的磁盤。若是空間不中會安裝時會報以下圖的錯誤:
這裏說一說安裝grid時須要注意的。
第一是在哪裏解壓,12cR2的grid的名字與以往版本的不一樣,linuxx64_12201_grid_home.zip,文件名字中帶了一個home,我想這是Oracle想告訴你們這個文件直接解壓到GRID_HOME下吧。也的確如此,直接把文件解壓到指定的GRID_HOME目錄下,它不須要安裝時再把文件copy到GRID_HOME目錄下了。解壓完了記得把解壓包從GRID_HOME中移走,省得在安裝grid過程當中還把這個壓縮包也傳到其餘節點上去。
再來講安裝,解壓完後能夠看到這個不象之前那樣有一個grid目錄,grid目錄裏runInstaller腳本等文件。這個解壓就像是直接安裝了同樣,解壓出來不少的文件。並且目錄裏也沒有runInstaller腳本了,取而代之的是gridSetup.sh腳本,運行這個腳原本執行grid的安裝。
以後在圖形界面的各類選擇與以前的版本沒有太大的區別。安裝完後執行root.sh腳本。在執行root.sh過程當中出問題最多,這也是RAC可否安裝成功的決定性因素。我作測試的過程當中出現了以下三種報錯:
CLSRSC-400: A system reboot is required to continue installing.
CRS-1704: Initialization of the required component GPNP failed; details at (:CSSSC00005:) in
CRS-2674: Start of 'ora.cssd' on 'node1' failed
Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-170325AM010920.log for details.
2017/03/25 01:10:23 CLSRSC-184: Configuration of ASM failed
2017/03/25 01:10:27 CLSRSC-258: Failed to configure and start ASM
Died at /u01/app/12.2.0/grid/crs/install/crsinstall.pm line 2091.
查了GOOGLE和MOS都沒有找到相關的文章來解決。不過今天在rhel6.7上沒有出現上面的問題,順利的安裝成功了。
五、安裝oracle軟件和dbca建立數據庫
安軟件與dbca建庫與以前的版本沒有大太區別,軟件仍是用runInstaller來調圖形界面安裝,參照以往的方式安裝就好了。
就先寫到這裏了,因爲今天作測試時沒有想到會安裝成功,因此就沒有作截圖,但大致的流程還以往版本仍是大同小異,這裏也建議多對照官方文檔進行操做,能夠免去沒必要要的一些麻煩和錯誤。