这篇文章主要介绍“Oracle11R2 RAC的搭建过程”,在日常操作中,相信很多人在Oracle11R2 RAC的搭建过程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Oracle11R2 RAC的搭建过程”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!一:禁用selinuxvi /etc/sysconfig/selinuxSELINUX=enforcing #将此处修改为SELINUX=disabled二:关闭防火墙# /etc/rc.d/init.d/iptables stopFlushing firewall rules: [ OK ]Setting chains to policy ACCEPT: filter [ OK ]Unloading iptables modules: [ OK ]然后,针对下一次服务器重新引导关闭 UDP ICMP 拒绝(应该始终被关闭):# chkconfig iptables off 重新启动操作系统 # init 6 验证结果# /etc/rc.d/init.d/iptables statusFirewall is stopped.# getenforceDisabledcd /etc/sysconfig/network-script/vi ifcfg-eth0IPADDR=192.168.56.120NETMASK=255.255.255.0GATEWAY=192.168.56.1vi ifcfg-eth2IPADDR=192.168.0.110NETMASK=255.255.255.0GATEWAY=192.168.0.1三:编辑HOSTS#public ip192.168.56.120 linux1192.168.56.123 linux2#virtual ip192.168.56.121 linux1-vip192.168.56.124 linux2-vip#private ip192.168.0.110 linux1-priv192.168.0.111 linux2-priv#scan ip192.168.56.125 linux-scan四:挂载yum源mount /dev/cdrom /media[rhe16]name=rhe16baseurl=file:///media/Serverenabled=1gpgcheck=0gpgkey-file:///media/RPM-GPG-KEY-redhat-release五:安装依赖包yum install compat-libstdc++-33 glibc glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh compat-libcap1 compat-libstdc++ elfutils-libelf-devel gcc-c++yum install binutils compat-db compat-libstdc++-296 control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make sysstat setarch glibc-devel libaio ksh glibc-headers libgnome libgcc libgnomeui libgomp openmotif libXp六:创建用户和组groupadd -g 500 oinstallgroupadd -g 501 dbagroupadd -g 503 asmadmingroupadd -g 504 asmopergroupadd -g 505 asmdbauseradd -u 500 -g oinstall -G dba,asmdba oracleuseradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper,dba grid七:创建文件路径(1)创建inventor 路径mkdir -p /u01/app/oraInventorychown -R grid:oinstall /u01/app/oraInventorychmod -R 775 /u01/app(2)创建GI主目录mkdir -p /u01/11.2.0/gridmkdir -p /u01/grid/11.2.0/crs_1chown -R grid:oinstall /u01/11.2.0chmod -R 775 /u01/11.2.0(3)创建数据库主目录mkdir -p /u01/app/oraclemkdir -p /u01/app/oracle/cfgtoollogschown -R oracle:oinstall /u01/app/oraclechmod -R 775 /u01/app/oracle(4)创建数据库软件主目录mkdir -p /u01/app/oracle/product/11.2.0/db_1chown -R oracle:oinstall /u01/app/oracle/productchmod -R 775 /u01/app/oracle/product八:创建用户环境变量修改gird和Oracle用户的.bash_profile文件oracle:# Oracle DB 11g Environmentexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1export ORACLE_SID=orcl1export ORACLE_TERM=xtermexport NLS_LANG=AMERICAN_AMERICA. AL32UTF8export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/libexport LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib:$ORACLE_HOME/RDBMS/lib:/lib:/usr/libexport ORACLE_DOC=$ORACLE_HOME/docexport SQLPATH=$ORACLE_HOME/dbsexport PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$JAVA_HOME/bin:$PATH:/usr/vacpp/bin:/usr/ccs/binexport CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlibexport TMP=/tmpexport TMPDIR=$TMPexport NLS_DATE_FORMAT=’yyyy-mm-dd hh34:mi:ss’export NLS_TIMESTAMP_FORMAT=’yyyy-mm-dd hh34:mi:ss.ff’export NLS_TIMESTAMP_TZ_FORMAT=’yyyy-mm-dd hh34:mi:ss.ff’export EDITOR=vigrid:# Oracle DB 11g Environmentexport ORACLE_BASE=/u01/11.2.0/gridexport ORACLE_HOME=/u01/grid/11.2.0/crs_1export ORACLE_SID=+ASM1export ORACLE_TERM=xtermexport NLS_LANG=AMERICAN_AMERICA. AL32UTF8export ORA_NLS10=$ORACLE_HOME/nls/dataexport LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/libexport LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib:$ORACLE_HOME/RDBMS/lib:/lib:/usr/libexport ORACLE_DOC=$ORACLE_HOME/docexport SQLPATH=$ORACLE_HOME/dbsexport PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$JAVA_HOME/bin:$PATH:/usr/vacpp/bin:/usr/ccs/binexport CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlibexport TMP=/tmpexport TMPDIR=$TMPexport NLS_DATE_FORMAT=’yyyy-mm-dd hh34:mi:ss’export NLS_TIMESTAMP_FORMAT=’yyyy-mm-dd hh34:mi:ss.ff’export NLS_TIMESTAMP_TZ_FORMAT=’yyyy-mm-dd hh34:mi:ss.ff’export EDITOR=vi九:修改参数 修改内核参数/etc/sysctl.conf sed -i ‘s/kernel.shmmax/#kernel.shmmax/g’ /etc/sysctl.conf sed -i ‘s/kernel.shmall/#kernel.shmall/g’ /etc/sysctl.conf cat >> /etc/sysctl.conf
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 1073741824 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048586 EOF 修改oracle用户限制 cat>> /etc/security/limits.conf
oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 EOF 修改vi /etc/pam.d/loginsession required /lib/security/pam_limits.so(pam.d指的是验证登陆配置,login是登陆配置文件。)配置/etc/profileif [ $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十:增加swap空间 1.检查swap大小和硬盘空间 free -m查看内存和swap | df -h查看硬盘空间 ,得有2.7G的空间才可以 2.添加交换文件mkdir -p /opt/tempdd if=/dev/zero of=/opt/temp/swap bs=1024 count=2048000 –这个是2G 3.创建交换空间 mkswap /opt/temp/swap 4.启动新增加的2G交换空间 swapon /opt/temp/swap 5.修改/etc/fstab,使新加的2G交换空间在系统重新启动后自动生效 echo “/opt/temp/swap swap swap defaults 0 0” >>/etc/fstab 十二:建立信任机制(两个节点操作)在oracle和grid用户下建立.ssh文件夹生成密钥对mkdir .sshchmod 755 .sshssh-keygen -t rsassh-keygen -t dsa全部回车键cat .ssh/*.pub >>.ssh/authorized_keysssh oracle@lzl cat ~/.ssh/*.pub >> ~/.ssh/authorized_keysssh oracle@yq cat ~/.ssh/*.pub >> ~/.ssh/authorized_keysssh grid@lzl cat ~/.ssh/*.pub >> ~/.ssh/authorized_keysssh grid@yq cat ~/.ssh/*.pub >> ~/.ssh/authorized_keysexec ssh-agent $SHELLssh-add验证是否成功相互ssh node1 date相互ssh node2 date相互ssh node1-priv date相互ssh node2-priv date十三:UDEV共享存储1.#首先确认是 Linux 6.0以上版本[root@vrh7 dev]# cat /etc/issue Oracle Linux Server release 6.2Kernel r on an m2.#添加记录到/etc/scsi_id.configecho “options=–whitelisted –replace-whitespace” >> /etc/scsi_id.config3.#确认哪些块设备需要udev绑定[root@vrh7 dev]# ls -l sd*brw-rw—-. 1 root disk 8, 0 Jun 30 09:29 sdabrw-rw—-. 1 root disk 8, 1 Jun 30 09:29 sda1brw-rw—-. 1 root disk 8, 2 Jun 30 09:29 sda2brw-rw—-. 1 root disk 8, 16 Jun 30 09:29 sdbbrw-rw—-. 1 root disk 8, 32 Jun 30 09:29 sdcbrw-rw—-. 1 root disk 8, 48 Jun 30 09:29 sddbrw-rw—-. 1 root disk 8, 64 Jun 30 09:29 sdebrw-rw—-. 1 root disk 8, 80 Jun 30 09:29 sdf例如在本实例中 sdb-> sdf的块设备需要绑定4. 将 b->f的编号放入for 循环中,例如:# AUTO UDEV RULE BY Maclean Liu 2012/06/30for i in b c d e ;doecho “KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”, RESULT==”`/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/sd$i`”, NAME=”asm-disk$i”, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″” done就会生成sdb->sdf 设备绑定的RULE,在将这些RULE写入到/etc/udev/rules.d/99-oracle-asmdevices.rules中也可以直接利用以下脚本 ,写出RULE到99-oracle-asmdevices.rules# AUTO UDEV RULE BY Maclean Liu 2012/06/30for i in f g h;doecho “KERNEL==”sd*”, BUS==”scsi”, PROGRAM==”/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/$name”, RESULT==”`/sbin/scsi_id –whitelisted –replace-whitespace –device=/dev/sd$i`”, NAME=”asm-disk$i”, OWNER=”grid”, GROUP=”asmadmin”, MODE=”0660″” >> /etc/udev/rules.d/99-oracle-asmdevices.rulesdone5. 之后运行用root运行/sbin/start_udev 即可十四:安装cvuqdisk 软件包rpm -ivh cvuqdisk-1.0.7-1.rpmcat > /etc/ntp.conf
restrict 0.0.0.0 mask 0.0.0.0 nomodifyserver 127.127.1.0fudge 127.127.1.0 stratum 10driftfile /var/lib/ntp/driftbroadcastdelay 0.008authentica免费云主机域名te nokeys /etc/ntp/keysEOF十五:安装前检查1、安装前检查./runcluvfy.sh stage -pre crsinst -n linux1,linux2 -verbose2、检查网络和等效性./runcluvfy.sh comp nodecon -n rac1,rac2 -verbose3、安装./runInstaller到此,关于“Oracle11R2 RAC的搭建过程”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注百云网站,小编会继续努力为大家带来更多实用的文章!
相关推荐: ERROR 2006 (HY000) MySQL server has gone away
做备份恢复,导入数据的时候遇到如下错误:$mysql $c /all_20171128151154.sql ERROR 2006 (HY000) at line 1438: MySQL server has gone away上网查询了一下,发现可能是有大的字…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。