redhat5.6+Oracle_RAC
1.0安装前准备工作
1.1下载所需要的rac包
从Oracle OTN下载三个包,包名如下:
10201_database_linux32.zip
10201_clusterware_linux32.zip
补丁:
补丁
acle/projects/compat-oracle/files/Enterprise_Linux/
quattorsrv.lal.in2p3.fr/packages/os/sl470-x86_64/base/SL/RPMS/
ASMLIB包:
oracleasm-support-2.1.7-1.el5.i386.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-2.6.18-238.el5-2.0.5-1.el5.i686.rpm
设置系统时间
rac1:date -s "20111116 11:35:59"
rac2:date -s "20111116 11:36:04"
. 依次安装下面的包
rpm -q libXp openmotif compat libaio ---检查是否有安装
rpm –ivh libXp-1.0.0-8.i386.rpm
…
引用:
libXp-1.0.0-8.i386.rpm
openmotif22-2.2.3-18.i386.rpm
compat-db-4.2.52-5.1.i386.rpm
compat-gcc-34-3.4.6-4.i386.rpm
compat-gcc-34-c++-3.4.6-4.i386.rpm
compat-libstdc++-33-3.2.3-61.i386.rpm
libaio-0.3.106-3.2.i386.rpm
一部分:安装系统包及设置环境变量
创建组oinstall,dba,用户oracle
[root@node1 ~]# groupadd oinstall
[root@node1 ~]# groupadd dba
[root@node1 ~]# useradd -g oinstall -G dba oracle or useradd -d /home/oracle -g oinstall -G dba oracle
设置oracle用户密码
[root@node1 ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
提示:
[root@node1 ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
如果是非虚机安装,要注意记录下用户和组ID,在其它机器上创建同名组时,务必确认组ID和用户ID与此相同。
配置内核参数oracle10g客户端安装步骤
[root@node1 ~]# vi /f
增加或修改下列内容
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
提示,上述参数中通常只有一项需要我们更改,即kernel.shmmax,该参数推荐设定为物理内存的一半,由于安装crs的时候要求内存至少512M,因此我们此处也按照512*1024*1024来设置。
然后:
[root@node1 Server]# sysctl -p
让设置生效
7、提高 Oracle 用户的 shell 限制
设置oracle使用的文件数权限
[root@node1 ~]# vi /etc/f
增加下列内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
修改安全限制
[root@node1 ~]# vi /etc/pam.d/login
增加:
session required /lib/security/pam_limits.so
配置Hangcheck计时器
[root@node1 ~]# vi /etc/rc.local
增加:
modprobe hangcheck-timer hangcheck-tick=30 hangcheck_margin=180
1.修改/etc/hosts
127.0.0.1 localhost
#Pub
lic
192.168.12.251 rac1.augurit rac1
192.168.12.252 rac2.augurit rac2
#Private
10.10.10.251 rac1-priv.augurit rac1-priv
10.10.10.252 rac2-priv.augurit rac2-priv
#Virtual
192.168.12.253 rac1-vip.augurit rac1-vip
192.168.12.254 rac2-vip.augurit rac2-vip
2.修改/home/oracle/.bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/augurit/ora10g
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=rac1
# For RAC
export ORA_CRS_BASE=/oracle_crs
export ORA_CRS_HOME=$ORA_CRS_BASE/product/10.2.0/crs
export ORA_ASM_HOME=$ORACLE_BASE/product/10.2.0/asm
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH:$ORA_CRS_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
执行 source /home/oracle/.bash_profile
3.建目录
rac1:~ # mkdir -p $ORACLE_HOME
rac1:~ # mkdir -p $ORA_CRS_HOME
rac1:~ # mkdir -p $ORA_ASM_HOME
rac1:~ # chmod -R 775 $ORACLE_BASE
rac1:~ # chmod -R 775 $ORA_CRS_BASE
rac1:~ # chown -R root:oinstall $ORA_CRS_BASE
rac1:~ # chown -R oracle:oinstall $ORACLE_BASE
4.分区
fdisk -l
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
配置裸设备
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="/dev/sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add", KERNEL=="/dev/sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"
KERNEL=="raw[1]", OWNER="root", GROUP="oinstall", MODE="660"
KERNEL=="raw[2]", OWNER="oracle", GROUP="oinstall", MODE="660"
start_udev
复制生成第二节点rac2,并配等效性及ASM
生成节点2 rac2
将节点rac1复制一份,改名为rac2,在节点1和节点2的Red Hat Linux.vmx文件中加入如下内容:
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
scsi1.sharedBus = "virtual"
scsi1:0.deviceType = "disk"
scsi1:1.deviceType = "disk"
scsi1:2.deviceType = "disk"
启动节点2,修改ip地址和机器名为rac2,再修改.bash_profile文件将其rac1,改为rac2
二部分:配等效性及ASM
在 rac1 上执行
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ mkdir ~/.ssh
[oracle@rac1 ~]$ chmod 700 ~/.ssh
[oracle@rac1 ~]$ ssh-keygen -t rsa
[oracle@rac1 ~]$ ssh-keygen -t dsa
在 rac2 上执行
[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
在 rac1 上执行
[oracle@rac1 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[oracle@rac1 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[oracle@rac1 ~]$ ss
h rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
The authenticity of host 'rac2 (192.168.12.252)' can't be established.
RSA key fingerprint is 9c:f0:83:74:de:49:0f:99:9b:7d:db:da:b6:d5:03:66.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.12.252' (RSA) to the list of known hosts.
oracle@rac2's password:
[oracle@rac1 ~]$ ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
oracle@rac2's password:
[oracle@rac1 ~]$ scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
oracle@rac2's password:
authorized_keys 100% 1988 1.9KB/s 00:00
[oracle@rac1 ~]$
在每个节点上测试连接。验证当您再次运行以下命令时,系统是否不提示您输入口令。
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
ssh rac1.augurit date
ssh rac2.augurit date
ssh rac1-priv.augurit date
ssh rac2-priv.augurit date
配ASM盘
rac1上配如下:
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm createdisk DATA1 /dev/sdd1
/etc/init.d/oracleasm enable
rac2上配如下:
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
三部分:安装oracle部分
先检查下:clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
1.运行CRS安装脚本
(1).在rac1运行/augurit/ora10g/oraInventory/orainstRoot.sh
(2).在rac2运行/augurit/ora10g/oraInventory/orainstRoot.sh
(3).分别修改两节点的srvctl和vipca,分区加入这一行即可。 unset LD_ASSUME_KERNEL
(4).在rac1运行/oracle_crs/product/10.2.0/crs/root.sh
(5).在rac2运行/oracle_crs/product/10.2.0/crs/root.sh
(6).在节点2上运行(用oracle用户登陆执行如下:root用户也行)
./oifcfg getif
.
/oifcfg setif -global eth0/192.168.12.0:public
./oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
并在节点1上运行
[oracle@rac1 bin]$ ./oifcfg getif
eth0 192.168.12.0 global public
eth1 10.10.10.0 global cluster_interconnect
2.以root用户在rac2上运行vipca
3.点确定,完成crs安装界面
4.分别在两节点上执行crs_stat -t,检查crs的安装情况
[oracle@rac2 bin]$ crs_stat -t
Name Type Target State Host
-
-----------------------------------------------------------
ora.rac1.gsd application ONLINE ONLINE rac1
s application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora.rac2.gsd application ONLINE ONLINE rac2
s application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
5.安装数据软件。
[oracle@rac1 data
base]$ pwd
/drmeng/database
[oracle@rac1 database]$ ./runInstaller
分别在rac1,rac2上以root用户运行:/augurit/ora10g/product/10.2.0/db_1/root.sh完成即可
6.配网络监听,在rac1上以oracle用户运行netca
[oracle@rac1 database]$
[oracle@rac1 database]$ netca
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Default local naming configuration complete.
<
<
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
7.创数据oracle实例rac
[oracle@rac1 database]$ dbca
如果不到asm盘。就手工输入asm盘的路径:ev/oracleasm/disks/DATA1'
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论