linux版本:OEL6.3 Oracle版本:11.2.0.3 虚拟机:VBOX
学RAC买书千万不要买刘炳林的RAC,垃圾中的战斗机还如此贵~~还是大话RAC经典。
一、操作系统设置
1.# cat /etc/hosts 配置/etc/hosts 网络192.168.1.181 vmac1 vmac1.oracle.com192.168.1.182 vmac1-vip192.168.1.183 vmac2 vmac2.oracle.com192.168.1.184 vmac2-vip192.168.1.186 vmac-cluster vmac-cluster-scan172.168.1.18 vmac1-priv172.168.1.19 vmac2-priv2.关闭NTP,检查防火墙及SELINUX是否关闭。[root@bysrac1 ~]# servicentpd statusntpd is stopped[root@bysrac1 ~]# chkconfig ntpd off[root@bysrac1 ~]# service iptables statusFirewall is stopped.[root@bysrac1 ~]# getenforceDisabled3.修改SSH解决超时自动断开问题[root@oel-01 ~]# cd /etc/ssh/[root@oel-01 ssh]# grep "ClientAlive" sshd_config#ClientAliveInterval 0#ClientAliveCountMax 3[root@oel-01 ssh]# cp sshd_config sshd_config.bak[root@oel-01 ssh]# sed -i "s/#ClientAliveInterval 0/ClientAliveInterval 60/g" sshd_config[root@oel-01 ssh]# grep "ClientAlive" sshd_configClientAliveInterval 60#ClientAliveCountMax 3[root@oel-01 ssh]# sed -i "s/#ClientAliveCountMax 3/ClientAliveCountMax 10/g" sshd_config[root@oel-01 ssh]# grep "ClientAlive" sshd_configClientAliveInterval 60ClientAliveCountMax 104. 创建用户和组groupadd -g 5000 asmadmingroupadd -g 5001 asmdbagroupadd -g 5002 asmopergroupadd -g 6000 oinstallgroupadd -g 6001 dbagroupadd -g 6002 operuseradd -g oinstall -G asmadmin,asmdba,asmoper griduseradd -g oinstall -G dba,asmdba oraclepasswd oraclepasswd gridmkdir /s01mkdir /g01chown oracle:oinstall /s01chown grid:oinstall /g015.挂载光盘dfmount /dev/cdrom /mnt/cdromormount -o loop /mnt/raid/oracle linux 6.4.iso /mnt/cdrom[root@vmac6 ~]# cd /etc/yum.repos.d[root@vmac6 yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6.repo.bak[root@vmac6 yum.repos.d]# touch public-yum-ol6.repo[root@vmac6 yum.repos.d]# vi public-yum-ol6.repo [base]name=isobaseurl=file:///mnt/cdromgpgcheck=1enabled=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-oracle[root@vmac1 ~]# yum install oracle-rdbms-server-11gR2-preinstall-1.0-6.el66.上一步执行完,oracle的限制参数默认已经生成,需要额外添加grid用户的参数[root@bysrac1 ~]# cat /etc/security/limits.conf# grid-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024grid soft nofile 1024# grid-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536grid hard nofile 65536# grid-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047grid soft nproc 2047# grid-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384grid hard nproc 16384# grid-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KBgrid soft stack 10240# grid-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KBgrid hard stack 327687.安装rlwrap软件[root@bysrac2 Server]# yum install readline-devel-5.1-3.el5.i386.rpm[root@bysrac2 ~]# cd /home/oracle[root@bysrac2 oracle]# lsoradiag_oracle rlwrap-0.37.tar.gz[root@bysrac2 oracle]# tar -zxvf rlwrap-0.37.tar.gz[root@bysrac2 oracle]# cd rlwrap-0.37[root@bysrac2 rlwrap-0.37]# ./configure[root@bysrac2 rlwrap-0.37]# make[root@bysrac2 rlwrap-0.37]# make install8.检查配置:[root@bysrac1 ~]# su - grid[grid@bysrac1 ~]$ ulimit -acore file size (blocks, -c) 0dataseg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 14123max locked memory (kbytes, -l) 3500000max memory size (kbytes, -m) unlimitedopen files (-n) 131072pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) 8192cpu time (seconds, -t) unlimitedmax user processes (-u) 131072virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited[root@bysrac1 ~]# su - oracle[oracle@bysrac1 ~]$ ulimit -acore file size (blocks, -c) 0dataseg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 14123max locked memory (kbytes, -l) 3500000max memory size (kbytes, -m) unlimitedopen files (-n) 131072pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) 8192cpu time (seconds, -t) unlimitedmax user processes (-u) 131072virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited9.重启计算机
二、环境变量设定
6.配置grid 用户profilemkdir /g01/orabase 第一个节点:export GRID_HOME=/g01/11ggrid/app/11.2.0/gridexport ORACLE_HOME=/g01/11ggrid/app/11.2.0/gridexport PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/binexport ORACLE_SID=+ASM1export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32export ORACLE_BASE=/g01/orabaseexport ORA_NLS10=$ORACLE_HOME/nls/dataexport NLS_LANG="Simplified Chinese"_China.AL32UTF8 第二个节点:export GRID_HOME=/g01/11ggrid/app/11.2.0/gridexport ORACLE_HOME=/g01/11ggrid/app/11.2.0/gridexport PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/binexport ORACLE_SID=+ASM2export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32export ORACLE_BASE=/g01/orabaseexport ORA_NLS10=$ORACLE_HOME/nls/dataexport NLS_LANG="Simplified Chinese"_China.AL32UTF87.root用户的环境变量export GRID_HOME=/g01/11ggrid/app/11.2.0/gridexport ORACLE_HOME=/g01/11ggrid/app/11.2.0/gridexport PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin8.oracle用户的环境变量mkdir /s01/orabase第一个节点export ORACLE_HOME=/s01/oracle/app/oracle/product/11.2.0/dbhome_1export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/binexport ORACLE_SID=PROD1export ORACLE_UNQNAME=PROD1export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32export ORACLE_BASE=/s01/orabaseexport ORA_NLS10=$ORACLE_HOME/nls/dataexport NLS_LANG="Simplified Chinese"_China.AL32UTF8 第二个节点 export ORACLE_HOME=/s01/oracle/app/oracle/product/11.2.0/dbhome_1export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/binexport ORACLE_SID=PROD2export ORACLE_UNQNAME=PROD2export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32export ORACLE_BASE=/s01/orabaseexport ORA_NLS10=$ORACLE_HOME/nls/dataexport NLS_LANG="Simplified Chinese"_China.AL32UTF8