echo " ulimit -u 16384 -n 65536">>/etc/profile
echo " fi">>/etc/profile
echo "fi">>/etc/profile
8.配置ORACLE环境变量
1)ORACLE用户.bash_profile
su - oracle
echo "export ORACLE_BASE=/oracle">>~/.bash_profile
echo "export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db">>~/.bash_profile
echo "export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs">>~/.bash_profile
echo "export ORACLE_SID=racdb1 # The Second Node is Named racdb2">>~/.bash_profile
echo "export PATH=$PATH:$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/dcm/bin:$ORACLE_HOME/webcache/bin:$ORACLE_HOME/opmn/bin">>~/.bash_profile
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib">>~/.bash_profile
echo "export TMPDIR=/tmp">>~/.bash_profile
echo "export TMP=/tmp">>~/.bash_profile
2)ROOT用户.bash_profile">>~/.bash_profile
su -
echo "export ORACLE_BASE=/oracle">>~/.bash_profile
echo "export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db">>~/.bash_profile
echo "export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs">>~/.bash_profile
echo "export PATH=$PATH:$ORA_CRS_HOME/bin">>~/.bash_profile
9.配置/etc/hosts网络文件
cp /etc/hosts /etc/hosts.back
echo "192.168.56.101 rac1">>/etc/hosts
echo "192.168.56.111 rac1-vip">>/etc/hosts
echo "10.10.10.101 rac1-priv">>/etc/hosts
echo "192.168.56.102 rac2">>/etc/hosts
echo "192.168.56.112 rac2-vip">>/etc/hosts
echo "10.10.10.102 rac2-priv">>/etc/hosts
10.节点间建立SSH 用户等效项
1)在各节点创建RAS与DSA密钥
su - oracle
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
注:三次回车。
ssh-keygen -t dsa
注:三次回车。
2)在欲进行RAC安装OUI的节点上,添加密钥到授权密钥文件authorized_keys中
$ssh rac1 cat ~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
$ssh rac1 cat ~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
$ssh rac2 cat ~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
$ssh rac2 cat ~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
$chmod 600 ~/.ssh/authorized_keys
3)拷贝副本到其它节点对应目录下并授权
节点一:
$scp ~/.ssh/authorized_keys rac2:/home/oracle/.ssh/
节点二:
$chmod 600 ~/.ssh/authorized_keys
4)在OUI节点上测试SSH等效性
$ssh rac1 hostname
$ssh rac2 hostname
注:如果无需输入密码就出现主机名,说明SSH配置成功。
11.配置hangcheck timer内核模块
echo "options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180">>/etc/modprobe.conf
echo "modprobe hangcheck_timer">>/etc/rc.d/rc.local
12.配置两节点LINUX操作系统时间同步<视情况定是否需要>
1)在节点一进行如下操作
cp /etc/ntp.conf /etc/ntp.conf.back
echo "restrict 10.1.120.0 mask 255.255.255.0 nomodify notrap">>/etc/ntp.conf
service ntpd start
2)在节点二进行如下操作
#crontab -e
1-59 * * * * ntpdate 10.1.120.201
13.在其中一个节点配置集群注册表OCR、表决磁盘voting共享LV
1)创建一个分区
fdisk /dev/sdd
n
p
t
8e
w
2)创建一个pv
pvcreate /dev/sdd1
pvscan
3)创建一个vg
vgcreate crsvg /dev/sdd1
vgscan
注:vgcreate datavg /dev/sdc1 /dev/sdd1 /dev/sde1
4)创建db所需的lv
lvcreate -L 300M -n lvocr1 crsvg
lvcreate -L 300M -n lvocr2 crsvg
lvcreate -L 120M -n lvvoting1 crsvg
lvcreate -L 120M -n lvvoting2 crsvg
lvcreate -L 120M -n lvvoting3 crsvg
lvcreate -L 20M -n lvasmpwd crsvg
lvscan
5)重启所有节点,加载共享磁盘信息
#reboot
6)配置lv关联至raw
cp /etc/sysconfig/rawdevices /etc/sysconfig/rawdevices.back
echo "/dev/raw/raw1 /dev/crsvg/lvocr1">>/etc/sysconfig/rawdevices
echo "/dev/raw/raw2 /dev/crsvg/lvocr2">>/etc/sysconfig/rawdevices
echo "/dev/raw/raw3 /dev/crsvg/lvvoting1">>/etc/sysconfig/rawdevices
echo "/dev/raw/raw4 /dev/crsvg/lvvoting2">>/etc/sysconfig/rawdevices