测试网络连通性
rac2主机已经配置好了,你需要测试与rac1主机的连通性,与存储的连通性
[root@rac2 /]# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=2.08 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.504 ms
^C
--- 192.168.2.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1486ms
rtt min/avg/max/mdev = 0.504/1.293/2.082/0.789 ms
[root@rac2 /]# ping 192.168.3.55
PING 192.168.3.55 (192.168.3.55) 56(84) bytes of data.
64 bytes from 192.168.3.55: icmp_seq=1 ttl=64 time=0.291 ms
^C
--- 192.168.3.55 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 863ms
rtt min/avg/max/mdev = 0.291/0.291/0.291/0.000 ms
[root@rac2 /]# ping 192.168.3.66
PING 192.168.3.66 (192.168.3.66) 56(84) bytes of data.
64 bytes from 192.168.3.66: icmp_seq=1 ttl=64 time=0.183 ms
^C
--- 192.168.3.66 ping statistics ---
2 packets transmitted, 1 received, 50% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.183/0.183/0.183/0.000 ms
创建组和用户(rac1和rac2)
//创建组
#groupadd -g 1000 oinstall
#groupadd -g 1001 dba
#groupadd -g 1002 oper
#groupadd -g 1003 asmadmin
#groupadd -g 1004 asmdba
#groupadd -g 1005 asmoper
//创建用户
#useradd -u 1000 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -m grid
#useradd -u 1001 -g oinstall -G dba,asmdba -d /home/oracle -m oracle
//如果oracle用户已经存在
#usermod -g oinstall -G dba,asmdba -u 1001 oracle
//修改密码及验证user
passwd oracle
passwd grid
创建安装目录及授权(rac1和rac2)
#mkdir -p /u01/app/oracle
#mkdir -p /u01/app/grid
#mkdir -p /u01/app/11.2.0/grid
#mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
#chown -R grid:oinstall /u01/app/grid
#chown -R grid:oinstall /u01/app/11.2.0
#chown -R oracle:oinstall /u01/app/oracle
#chmod -R 775 /u01
#mkdir -p /u01/app/oraInventory
#chown -R grid:oinstall /u01/app/oraInventory
#chmod -R 775 /u01/app/oraInventory
#ll /u01/app/ //检查一下
total 16
drwxrwxr-x 3 grid oinstall 4096 Aug 1 14:30 11.2.0
drwxrwxr-x 2 grid oinstall 4096 Aug 1 14:29 grid
drwxrwxr-x 3 oracle oinstall 4096 Aug 1 14:30 oracle
drwxrwxr-x 2 grid oinstall 4096 Aug 1 14:30 oraInventory
配置用户环境变量(rac1和rac2)
在grid用户下:
$vi /home/grid/.bash_profile
umask 022
export ORACLE_SID=+ASM1 //注意另外的机器是+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
alias sqlplus='rlwrap sqlplus' //下面四句是因为安装了rlwrap软件需要用到的
alias asmcmd='rlwrap asmcmd'
alias dgmgrl='rlwrap dgmgrl'
alias sas='sqlplus / as sysdba'
$source .bash_profile //使配置文件生效
在oracle用户下
$vi /home/oracle/.bash_profile
umask 022
export ORACLE_SID=rac1 //注意另外的机器是rac2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export TMP=/tmp
export TMPDIR=$TMP
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export EDITOR=vi
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_PATH=.:$ORACLE_BASE/dba_scripts/sql:$ORACLE_HOME/rdbms/admin
export SQLPATH=$ORACLE_HOME/sqlplus/admin
export NLS_LANG="AMERICAN_CHINA.ZHS16GBK"
alias sqlplus='rlwrap sqlplus' //下面五句是因为安装了rlwrap软件需要用到的
alias rman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'
alias dgmgrl='rlwrap dgmgrl'
alias sas='sqlplus / as sysdba'
$source .bash_profile //使配置文件生效
root用户的环境变量
#vi /etc/profile
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=$PATH:$ORACLE_HOME/bin
系统文件设置(rac1和rac2)
//内核参数设置:
# vi /etc/sysctl.conf
# use for oracle
kernel.shmall = 2097152
kernel.shmmax = 1054472192
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 = 1048576
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#sysctl -p //确认修改内核立即生效
//配置oracle、grid用户的shell限制
#vi /etc/security/limits.conf
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft nproc 2047
grid hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
root soft nproc 2047
//修改login文件
#vi /etc/pam.d/login
session required pam_limits.so
//对默认的shell启动文件进行以下更改,以便更改所有Oracle安装所有者的ulimit设置
#vi /etc/profile
#oracle export and ulimit setting
if [ /$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
时间同步设置(rac1和rac2)
RAC 时间同步有两种方式:NTP和CTSS,这里使用CTSS是oracle自带的服务,则需要停用NTP服务(默认是开启)
#service ntpd stop
#service ntpd status
ntpd is stopped
编辑/etc/multipath.conf
获取共享存储盘的scsi_id号,依此执行如下命令。首先检查当前系统已经探测到的所有盘符&