溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Oracle 12cR2 RAC安裝配置及一些坑

發(fā)布時間:2020-06-12 03:36:52 來源:網(wǎng)絡(luò) 閱讀:10466 作者:hbxztc 欄目:關(guān)系型數(shù)據(jù)庫

Oracle 12cR2版本已經(jīng)發(fā)布有一段時間,一直想測試安裝RAC,從上周末到今天用了兩個周末和今天一天的時間終于把RAC安裝成功了。這里記錄了安裝時對操作系統(tǒng)的配置,以及安裝過程中遇到的一些坑。

1、首先是操作系統(tǒng)的選擇問題,Oracle現(xiàn)在認證的操作系統(tǒng)及內(nèi)核版本如下:

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操作系統(tǒng)上

[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版本。

2、操作系統(tǒng)的資源分配問題

如果你是使用服務(wù)器,資源足夠用那么可以忽略這一條。

如果想用筆記本上的虛擬機安裝12cR2的RAC請慎重些,尤其是內(nèi)存較小(小于16G)的。

我用的筆記本內(nèi)存是12G,每個虛擬機分5G,其他應(yīng)用全部關(guān)閉,內(nèi)存一直撐在95%左右。另外同事的一臺16G內(nèi)存的筆記本在安裝grid時,多次在85%左右時虛擬機直接重啟,一直沒有安裝成功。

今天用的是公司同事配置的一臺vmware esxi虛擬服務(wù)器,內(nèi)存也只有16G,但沒有其他虛擬機在跑,每臺虛擬機分配了7G的內(nèi)存,安裝過程中內(nèi)存也一直在90%以上。

3、操作系統(tǒng)的配置

這個沒有什么好說的,直接按官方文檔的要求一步一步的配置就行,下面給出了我做的配置,有興趣的朋友可以參考:

#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的磁盤。如果空間不中會安裝時會報如下圖的錯誤:

Oracle 12cR2 RAC安裝配置及一些坑4、安裝grid

這里說一說安裝grid時需要注意的。

第一是在哪里解壓,12cR2的grid的名字與以往版本的不同,linuxx64_12201_grid_home.zip,文件名字中帶了一個home,我想這是Oracle想告訴大家這個文件直接解壓到GRID_HOME下吧。也的確如此,直接把文件解壓到指定的GRID_HOME目錄下,它不需要安裝時再把文件copy到GRID_HOME目錄下了。解壓完了記得把解壓包從GRID_HOME中移走,免得在安裝grid過程中還把這個壓縮包也傳到其他節(jié)點上去。

再來說安裝,解壓完后可以看到這個不象以前那樣有一個grid目錄,grid目錄里runInstaller腳本等文件。這個解壓就像是直接安裝了一樣,解壓出來很多的文件。而且目錄里也沒有runInstaller腳本了,取而代之的是gridSetup.sh腳本,運行這個腳本來執(zhí)行g(shù)rid的安裝。

之后在圖形界面的各種選擇與之前的版本沒有太大的區(qū)別。安裝完后執(zhí)行root.sh腳本。在執(zhí)行root.sh過程中出問題最多,這也是RAC能否安裝成功的決定性因素。我做測試的過程中出現(xiàn)了如下三種報錯:

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都沒有找到相關(guān)的文章來解決。不過今天在rhel6.7上沒有出現(xiàn)上面的問題,順利的安裝成功了。

5、安裝oracle軟件和dbca創(chuàng)建數(shù)據(jù)庫

安軟件與dbca建庫與之前的版本沒有大太區(qū)別,軟件還是用runInstaller來調(diào)圖形界面安裝,參照以往的方式安裝就行了。

就先寫到這里了,由于今天做測試時沒有想到會安裝成功,所以就沒有做截圖,但大體的流程還以往版本還是大同小異,這里也建議多對照官方文檔進行操作,可以免去不必要的一些麻煩和錯誤。


官方文檔:http://docs.oracle.com/database/122/CWLIN/toc.htm

參考:http://blog.csdn.net/ljunjie82/article/details/51577841


向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI