Oracle RAC 11.2.0.4 for Linux 安装部署

爱数据精选
爱数据精选
爱数据精选
609
文章
0
评论
2021-12-1814:50:15 评论 436 12010字
摘要

Oracle RAC 11.2.0.4 在 Linux上的 安装部署

#public192.168.52.138 rac1192.168.52.130 rac2

#private192.168.100.122 rac1-priv192.168.100.222 rac2-priv

#virtual192.168.52.111 rac1-vip192.168.52.222 rac2-vip

IPADDR=192.168.52.131GATEWAY=192.168.52.1

IPADDR=192.168.52.231GATEWAY=192.168.52.1

ORACLE-RAC 部署方案11 / 62 2.1.7 创建Oracle用户和组 在安装进行之前,需要创建组和2个用户,分别用于grid安装和oracle安装 管理,在两个节点执行相同的操作,操作如下: 节点1 [root@db1 ~]#groupadd -g 2531 dba [root@db1 ~]#groupadd -g 2530 oinstall [root@db1 ~]#groupadd -g 2532 oper [root@db1 ~]#groupadd -g 2533 asmadmin [root@db1 ~]#groupadd -g 2534 asmoper [root@db1 ~]#groupadd -g 2535 asmdba [root@db1 ~]#useradd -u 2530 -g oinstall -G dba,asmdba,oper oracle [root@db1 ~]#useradd -u 2531 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid

[root@db1 ~]# passwd oracle[root@db1 ~]# passwd grid

[root@rac1 ~]#[root@rac1 ~]# mkdir -p /u01/app/11.2.0/grid[root@rac1 ~]# mkdir -p /u01/app/grid[root@rac1 ~]# mkdir -p /u01/app/oracle[root@rac1 ~]# chown -R grid:oinstall /u01/app/11.2.0/grid[root@rac1 ~]# chown -R grid:oinstall /u01/app/grid[root@rac1 ~]# chown -R oracle:oinstall /u01/app/oracle[root@rac1 ~]# chmod -R 775 /u01/[root@rac1 ~]#

gridexport PATHexport TMP=/tmp;export TMPDIR=$TMP;export ORACLE_HOSTNAME=rac2;export ORACLE_SID=+ASM2;export ORACLE_BASE=/u01/app/grid;export ORACLE_HOME=/u01/app/11.2.0/grid;export NLS_DATE_FORMAT="yy-mm-dd HH24:MI:SS";export PATH=$ORACLE_HOME/BIN:$PATH;export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"

oracle[oracle@rac1 ~]$vi .bash_profileexport PATHexport TMP=/tmp;export TMPDIR=$TMP;export ORACLE_HOSTNAME=rac2;export ORACLE_BASE=/u01/app/oracle;export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1;export ORACLE_UNQNAME=orcl;export ORACLE_SID=orcl2;export ORACLE_TERM=xterm;export PATH=/usr/sbin:$PATH;export PATH=$ORACLE_HOME/bin:$PATH;export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export NLS_DATE_FORMAT="yy-mm-dd HH24:MI:SS";export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"

vi /etc/sysctl.conffs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 1509879808kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586

vi /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240grid soft nproc 2047grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536grid soft stack 10240

[root@rac1 ~]# vi /etc/profileif [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536

elseulimit -u 16384 -n 65536

fi

fialiasgrep="grep --color=auto"export PATH=$PATH:/u01/app/11.2.0/grid/bin

************************************这一部分需要利用ASM去创建逻辑磁盘××××××××××××××××××××××××C:Program Files (x86)VMwareVMware Workstation

vi /etc/scsi_id.confioptions=--whitelisted --replace-whitespace

vmware-vdiskmanager.exe -c -s 1g -a lsilogic -t 2 D:VmwaresharedisksOCR01.vmdkvmware-vdiskmanager.exe -c -s 1g -a lsilogic -t 2 D:VmwaresharedisksOCR02.vmdkvmware-vdiskmanager.exe -c -s 1g -a lsilogic -t 2 D:VmwaresharedisksOCR03.vmdkvmware-vdiskmanager.exe -c -s 5g -a lsilogic -t 2 D:VmwaresharedisksOCR04.vmdk

scsi_id --whitelisted --replace-whitespace --device=/dev/sdbscsi_id --whitelisted --replace-whitespace --device=/dev/sdcscsi_id --whitelisted --replace-whitespace --device=/dev/sddscsi_id --whitelisted --replace-whitespace --device=/dev/sde

vi /etc/udev/rules.d/99-oracle-asmdevices.rules

disk.locking = "FALSE"disk.EnableUUID = "TRUE"diskLib.dataCacheMaxSize = "0"diskLib.dataCacheMaxReadAheadSize = "0"diskLib.dataCacheMinReadAheadSize = "0"diskLib.dataCachePageSize = "4096"diskLib.maxUnsyncedWrites = "0"scsi1.present = "TRUE"scsi1.sharedBus = "VIRTUAL"scsi1.virtualDev = "lsilogic"scsi1:1.present = "TRUE"scsi1:1.fileName = "D:VmwaresharedisksOCR01.vmdk"scsi1:1.mode = "independent-persistent"scsi1:1.deviceType = "disk"scsi1:1.redo = ""scsi1:2.present = "TRUE"scsi1:2.fileName = "D:VmwaresharedisksOCR02.vmdk"scsi1:2.mode = "independent-persistent"scsi1:2.deviceType = "disk"scsi1:2.redo = ""scsi1:3.present = "TRUE"scsi1:3.fileName = "D:VmwaresharedisksOCR03.vmdk"scsi1:3.mode = "independent-persistent"scsi1:3.deviceType = "disk"scsi1:3.redo = ""scsi1:4.present = "TRUE"scsi1:4.fileName = "D:VmwaresharedisksOCR04.vmdk"scsi1:4.mode = "independent-persistent"scsi1:4.deviceType = "disk" scsi1:4.redo = ""

more /etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"KERNEL=="raw1", OWNER="grid", GROUP="asmadmin", MODE="660"KERNEL=="raw2", OWNER="grid", GROUP="asmadmin", MODE="660"KERNEL=="raw3", OWNER="grid", GROUP="asmadmin", MODE="660"KERNEL=="raw4", OWNER="grid", GROUP="asmadmin", MODE="660"

start_udev

ll /dev/raw

mv /var/run/ntpd.pid /var/run/ntpd.pid.old

cat /proc/sys/net/ipv4/ip_local_port_range

vi /etc/udev/rules.d/99-oracle-asmdevices.rules

*********************oracle*****************************KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29d2d708945ae9dd842d13700a8", NAME="asm-diskb", OWNER="grid",GROUP="oinstall", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c290576adcdf284f5f624f457b27", NAME="asm-diskc", OWNER="grid",GROUP="oinstall", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29be83e18a09b96ccf00746859e", NAME="asm-diskd", OWNER="grid",GROUP="oinstall", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29c62a5666ade28842a17a716fd", NAME="asm-diske", OWNER="grid",GROUP="oinstall", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29d2d708945ae9dd842d13700a8", NAME="asm-diskb", OWNER="grid",GROUP="oinstall", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c290576adcdf284f5f624f457b27", NAME="asm-diskc", OWNER="grid",GROUP="oinstall", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29be83e18a09b96ccf00746859e", NAME="asm-diskd", OWNER="grid",GROUP="oinstall", MODE="0660"KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="36000c29c62a5666ade28842a17a716fd", NAME="asm-diske", OWNER="grid",GROUP="oinstall", MODE="0660"

fdisk -l | grep "Disk /dev/asm*"

××××××××××××××××××××××××××××××××请参照ASM创建逻辑磁盘××××××××××××××××××××××××××××××××

# su - oracle[oracle@rac1 ~]$ mkdir ~/.ssh[oracle@rac1 ~]$ chmod 700 ~/.ssh[oracle@rac1 ~]$ ssh-keygen -t rsa[oracle@rac1 ~]$ ssh-keygen -t dsa[root@rac2 ~]# su - oracle[oracle@rac2 ~]$ mkdir ~/.ssh[oracle@rac2 ~]$ chmod 700 ~/.ssh[oracle@rac2 ~]$ ssh-keygen -t rsa[oracle@rac2 ~]$ ssh-keygen -t dsa

在节点1上进行互信配置:[oracle@rac1 ~]$ touch ~/.ssh/authorized_keys[oracle@rac1 ~]$ cd ~/.ssh[oracle@rac1 .ssh]$ ssh rac1 cat ~/.ssh/id_rsa.pub >> authorized_keys[oracle@rac1 .ssh]$ ssh rac2 cat ~/.ssh/id_rsa.pub >> authorized_keys[oracle@rac1 .ssh]$ ssh rac1 cat ~/.ssh/id_dsa.pub >> authorized_keys[oracle@rac1 .ssh]$ ssh rac2 cat ~/.ssh/id_dsa.pub >> authorized_keys

在rac1把存储公钥信息的验证文件传送到rac2上[oracle@rac1 .ssh]$ pwd/home/oracle/.ssh[oracle@rac1 .ssh]$ scp authorized_keys rac2:/home/oracle/.sshoracle@rac2"s password:authorized_keys 100% 1644 1.6KB/s 00:00

设置验证文件的权限在每一个节点执行:$ chmod 600 ~/.ssh/authorized_keys

启用用户一致性在你要运行OUI的节点以oracle用户运行(这里选择rac1):[oracle@rac1 .ssh]$ exec /usr/bin/ssh-agent $SHELL[oracle@rac1 .ssh]$ ssh-addIdentity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa)Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa)

验证ssh配置是否正确以oracle用户在所有节点分别执行:ssh rac1 datessh rac2 datessh rac1-priv datessh rac2-priv date

******************************grid********************************[root@rac1 ~]# su - grid[oracle@rac1 ~]$ mkdir ~/.ssh[oracle@rac1 ~]$ chmod 700 ~/.ssh[oracle@rac1 ~]$ ssh-keygen -t rsa[oracle@rac1 ~]$ ssh-keygen -t dsa[root@rac2 ~]# su - grid[oracle@rac2 ~]$ mkdir ~/.ssh[oracle@rac2 ~]$ chmod 700 ~/.ssh[oracle@rac2 ~]$ ssh-keygen -t rsa[oracle@rac2 ~]$ ssh-keygen -t dsa

在节点1上进行互信配置:[oracle@rac1 ~]$ touch ~/.ssh/authorized_keys[oracle@rac1 ~]$ cd ~/.ssh[oracle@rac1 .ssh]$ ssh rac1 cat ~/.ssh/id_rsa.pub >> authorized_keys[oracle@rac1 .ssh]$ ssh rac2 cat ~/.ssh/id_rsa.pub >> authorized_keys[oracle@rac1 .ssh]$ ssh rac1 cat ~/.ssh/id_dsa.pub >> authorized_keys[oracle@rac1 .ssh]$ ssh rac2 cat ~/.ssh/id_dsa.pub >> authorized_keys

在rac1把存储公钥信息的验证文件传送到rac2上[oracle@rac1 .ssh]$ pwd/home/oracle/.ssh[oracle@rac1 .ssh]$ scp authorized_keys rac2:/home/grid/.sshoracle@rac2"s password:authorized_keys 100% 1644 1.6KB/s 00:00

设置验证文件的权限在每一个节点执行:$ chmod 600 ~/.ssh/authorized_keys

启用用户一致性在你要运行OUI的节点以oracle用户运行(这里选择rac1):[oracle@rac1 .ssh]$ exec /usr/bin/ssh-agent $SHELL[oracle@rac1 .ssh]$ ssh-addIdentity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa)Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa)

验证ssh配置是否正确以oracle用户在所有节点分别执行:ssh rac1 datessh rac2 datessh rac1-priv datessh rac2-priv date

./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose

./runcluvfy.sh comp ssa -n rac1,rac2 -s /dev/raw1,/dev/raw2,/dev/raw3

rac1-vip.localdomainrac2-vip.localdomain

192.168.31.202

ifconfig eth0:1 192.168.52.111 netmask 255.255.255.0 downifconfig eth0:1 192.168.52.222 netmask 255.255.255.0 down

138DEVICE="eth0:1"BOOTPROTO=noneIPADDR=192.168.52.111NETMASK=255.255.255.0GATWAY=192.168.52.1DNS1=192.168.52.1IPV6INIT="yes"NM_CONTROLLED="yes"ONBOOT="yes"TYPE="Ethernet"NAME="System eth0:1"UUID="952e2ba0-36e9-428a-9c5f-19a6e9d3b49e"HWADDR=00:0C:29:FA:65:40PREFIX=24GATEWAY=192.168.52.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noLAST_CONNECT=1506326854

130DEVICE="eth0:1"BOOTPROTO=noneIPADDR=192.168.52.222NETMASK=255.255.255.0GATWAY=192.168.52.1IPV6INIT="yes"NM_CONTROLLED="yes"ONBOOT="yes"TYPE="Ethernet"NAME="System eth0:1"PREFIX=24DEFROUTE=yesHWADDR=00:0C:29:9E:E6:2EGATEWAY=192.168.52.1IPV4_FAILURE_FATAL=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noUUID=7758ac79-c4a2-dd87-1760-71284a316d00LAST_CONNECT=1506492590

service ntpd stop

节点1:[root@quyu11 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak节点2:[root@quyu12 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak

[grid@quyu11 ~]$ crsctl check ctss[grid@quyu11 ~]$ crsctl check ctss

service iptables saveservice iptables stop

ln -s libcap.so.2.16 libcap.so.1ln -s libcap.so.2.16 libcap.so.1

Check: Package existence for "libstdc++-devel(x86_64)" Node Name Available Required Status ------------ ------------------------ ------------------------ ----------rac2 missing libstdc++-devel(x86_64)-3.4.6 failed rac1 missing libstdc++-devel(x86_64)-3.4.6 failed Result: Package existence check failed for "libstdc++-devel(x86_64)"

Check: Package existence for "gcc-c++(x86_64)" Node Name Available Required Status ------------ ------------------------ ------------------------ ----------rac2 missing gcc-c++(x86_64)-3.4.6 failed rac1 missing gcc-c++(x86_64)-3.4.6 failed Result: Package existence check failed for "gcc-c++(x86_64)"

Check: Package existence for "libaio-devel(x86_64)" Node Name Available Required Status ------------ ------------------------ ------------------------ ----------rac2 missing libaio-devel(x86_64)-0.3.105 failed rac1 libaio-devel(x86_64)-0.3.107-10.el6 libaio-devel(x86_64)-0.3.105 passed Result: Package existence check failed for "libaio-devel(x86_64)"

[root@rac1-priv rpm]# rpm -Uvh gcc-4.4.7-18.el6.x86_64.rpmwarning: gcc-4.4.7-18.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEYerror: Failed dependencies:cpp = 4.4.7-18.el6 is needed by gcc-4.4.7-18.el6.x86_64libgcc >= 4.4.7-18.el6 is needed by gcc-4.4.7-18.el6.x86_64libgomp = 4.4.7-18.el6 is needed by gcc-4.4.7-18.el6.x86_64

crs-4639虚拟机 ORACLE 双节点集群拉起步骤:第一步 双节点 root用户start_udev

第二步 双节点 root用户/u01/app/11.2.0/grid/crs/install/roothas.pl -deconfig -force -verbose

第三步 双节点 root用户/u01/app/11.2.0/grid/root.sh

第四步 检查集群状态crs_stat -v -t

--磁盘组检查select name,state,type,total_mb,free_mbFrom v$asm_diskgroup;

--ASM磁盘空间检查select group_number,path,state,total_mb,free_mbfrom v$asm_disk;————————————————

End.

爱数据网作者:Joe

作者介绍:通信和金融行业高级数据建模工程师 

本文为挖数网作者原创文章,未经允许禁止转载,需要转载请微信联系授权(微信号:lovedata0520)

更多文章前往爱数据社区网站首页浏览http://www.itongji.cn/

  • 我的微信公众号
  • 微信扫一扫
  • weinxin
  • 我的微信公众号
  • 微信扫一扫
  • weinxin
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: