rac实施过程(linux)

时间:2012-01-29 12:13:12
【文件属性】:

文件名称:rac实施过程(linux)

文件大小:5KB

文件格式:TXT

更新时间:2012-01-29 12:13:12

rac实施过程

[root@rac01 ~]# groupadd -g 1001 dba [root@rac01 ~]# groupadd -g 1002 oinstall [root@rac01 ~]# useradd -u 1001 -g oinstall -G dba oracle [root@rac01 ~]# passwd oracle eth0 inet addr:211.152.14.110 Bcast:211.152.14.255 Mask:255.255.255.0 eth1 inet addr:10.10.10.1 Bcast:10.10.10.255 Mask:255.255.255.0 [root@rac01 ~]# vi /etc/hosts [root@rac01 ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 211.152.14.110 rac01 211.152.14.210 vip01 211.152.14.109 rac02 211.152.14.209 vip02 10.10.10.1 priv01 10.10.10.2 priv02 [root@rac01 ~]# su - oracle [oracle@rac01 ~]$ ssh-keygen -t rsa [oracle@rac02 ~]$ ssh-keygen -t rsa [oracle@test .ssh]$ cat id_rsa.pub >> authorized_keys [oracle@test .ssh]$ ssh oracle@rac02 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys exit 在两个节点上分别执行操作 [oracle@rac01 ~]$ rpm -q binutils compat-db control-center gcc glibc glibc-common gnome-libs libstdc++-3* libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21 [root@rac01 ~]# vi /etc/sysctl.conf 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 net.core.rmem_default=262144 net.core.wmem_default=262144 net.core.rmem_max=262144 net.core.wmem_max=262144 [root@rac01 ~]# sysctl -p [root@rac01 ~]# vi /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 [root@rac01 ~]# vi /etc/pam.d/login session required /lib/security/pam_limits.so [root@rac01 ~]# vi /etc/profile if [ $USER = "oracle" ];then if [ $SHELL = "/bin/bash" ];then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi [root@test ~]# mkdir /software 将所需软件上传到此处 下载ocfs2内核模块(用uname -r查看版本号) [root@rac01 ~]# uname -r 2.6.9-42.ELsmp http://oss.oracle.com/projects/ocfs2/dist/files/RedHat/RHEL4/i386/1.2.3-1/2.6.9-42.ELsmp/ocfs2 再下载ocfs2 tools(命令和启动脚本)以及ocfs2控制台 http://oss.oracle.com/projects/ocfs2-tools/dist/files/RedHat/RHEL4/i386/1.2.1-1/ocfs2-tools-1.2.1-1.i386.rpm http://oss.oracle.com/projects/ocfs2-tools/dist/files/RedHat/RHEL4/i386/1.2.1-1/ocfs2consol 安装以上三个软件 在rac01上格式化共享磁盘为两个分区,一个用于存储oracle软件,至少3000m,一个用于存储数据库文件及恢复文件,至少4000m vmware-vdiskmanager -c -s 10Gb -a lsilogic -t 3 "F:\rac\share.vmdk" 在vmx文件里面添加如下行,并在vmware setting里面吧磁盘分别加到两个节点上面 scsi0:1.present = "TRUE" scsi0:1.virtualDev = "lsilogic" scsi0:1.sharedBus = "virtual" scsi0:1.mode = "independent-persistent" scsi0:1.filename = "F:\rac\share.vmdk" scsi0:1.deviceType = "disk" disk.locking = "false" diskLib.dataCacheMaxSize = "0" diskLib.dataCacheMaxReadAheadSize = "0" diskLib.DataCacheMinReadAheadSize = "0" diskLib.dataCachePageSize = "9216" diskLib.maxUnsyncedWrites = "0" [root@rac01 ocfs2-1.2.2]# fdisk -l /dev/sdb Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 1305 10482381 5 Extended /dev/sdb5 1 366 2939832 83 Linux /dev/sdb6 367 1305 7542486 83 Linux 重新启动系统rac01和rac02,启动ocfs2console格式化两个分区,并在两个节点上分别挂载共享磁盘,方法自己解决 [root@rac01 ~]# export DISPLAY=211.152.14.200:0.0 [root@rac01 ~]# xhost + [root@rac01 ~]# ocfs2console [root@rac01 ~]# mkdir -p /orac/orahome [root@rac01 ~]# mkdir -p /orac/oradata [root@rac02 ~]# /etc/init.d/o2cb enable mount -t ocfs2 /dev/sdb1 /orac/orahome mount -t ocfs2 -o datavolume,nointr /dev/sdb2 /orac/oradata [root@rac01 ~]# /etc/init.d/o2cb configure [root@rac01 ~]# /etc/init.d/o2cb status [root@rac02 ~]# vi /etc/fstab /dev/sdb1 /orac/orahome ocfs2 _netdev 0 0 /dev/sdb2 /orac/oradata ocfs2 _netdev,datavolume,nointr 0 0 [root@rac01 ~]# mounted.ocfs2 -f Device FS Nodes /dev/sdb1 ocfs2 rac01, rac02 /dev/sdb2 ocfs2 rac01, rac02 两个节点上分别设权限 [root@rac01 ~]# mkdir /orac/crs [root@rac01 crs]# chown -R root:oinstall /orac/crs/ [root@rac01 crs]# chmod -R 775 /orac/crs/ [root@rac01 crs]# chown -R oracle:oinstall /orac/orahome/ [root@rac01 crs]# chmod -R 775 /orac/orahome/ [root@rac01 crs]# chown -R oracle:oinstall /orac/oradata/ [root@rac01 crs]# chmod -R 775 /orac/oradata/ [oracle@rac01 clusterware]$ unzip 10201_clusterware_linux32.zip [oracle@rac01 clusterware]$ ./runInstaller [root@rac01 oradata]# /orac/orahome/oraInventory/orainstRoot.sh [root@rac01 oradata]# /orac/oradata/crs/10.2.0/root.sh


网友评论