ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 11.2.0.4 rac + redhat server 6.2

11.2.0.4 rac + redhat server 6.2

原创 Linux操作系统 作者:cactus0509 时间:2013-11-20 15:43:00 0 删除 编辑
1. 创建 1G的 lun for vote disk/ocr disk
2. 创建 20G 的lun for flash recover area
3. 创建 500G for data

drwxr-xr-x. 7 oracle oinstall       4096 Aug 27 12:46 database
drwxr-xr-x. 7 oracle oinstall       4096 Aug 27 12:33 grid
-rw-r--r--. 1 oracle oinstall 1395582860 Nov 17 21:01 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r--. 1 oracle oinstall 1151304589 Nov 17 21:01 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r--. 1 oracle oinstall 1205251894 Nov 17 21:03 p13390677_112040_Linux-x86-64_3of7.zip --grid

#chech network
ifconfig -a | grep eth


[root@rac2 ~]# cat /etc/hosts
127.0.0.1       localhost.localdomain   localhost
# Public
192.168.12.91   rac1.localdomain        rac1
192.168.12.93   rac2.localdomain        rac2
# Private
10.10.0.91      rac1-priv.localdomain   rac1-priv
10.10.0.92      rac2-priv.localdomain   rac2-priv
# Virtual
192.168.12.92   rac1-vip.localdomain    rac1-vip
192.168.12.94   rac2-vip.localdomain    rac2-vip
# SCAN
192.168.12.95   scan.localdomain        scan

nas: 192.168.12.99

使用iscsi openfiler作为共享存储。
1. 各个节点安装 yum install iscsi-initiator-utils.x86_64
2. 启动 iscsi 服务,service iscsi restart
3. scan iscsi
[root@rac1 ~]# iscsiadm  -m discovery -t sendtargets -p 192.168.12.99:3260
iscsiadm: This command will remove the record [iface: default, target: iqn.2006-01.com.openfiler:tsn.e9ccef7f9888, portal: 192.168.12.99,3260], but a session is using it. Logout session then rerun command to remove record.
192.168.12.99:3260,1 iqn.2006-01.com.openfiler:fra
192.168.12.99:3260,1 iqn.2006-01.com.openfiler:data
192.168.12.99:3260,1 iqn.2006-01.com.openfiler:ocrdisk

[root@rac2 ~]# iscsiadm  -m discovery -t sendtargets -p 192.168.12.99:3260
iscsiadm: This command will remove the record [iface: default, target: iqn.2006-01.com.openfiler:tsn.e9ccef7f9888, portal: 192.168.12.99,3260], but a session is using it. Logout session then rerun command to remove record.
192.168.12.99:3260,1 iqn.2006-01.com.openfiler:fra
192.168.12.99:3260,1 iqn.2006-01.com.openfiler:data
192.168.12.99:3260,1 iqn.2006-01.com.openfiler:ocrdisk

mount node:
iscsiadm -m node -T iqn.2006-01.com.openfiler:fra -p 192.168.12.99:3260 -l
iscsiadm -m node -T iqn.2006-01.com.openfiler:data -p 192.168.12.99:3260 -l
iscsiadm -m node -T iqn.2006-01.com.openfiler:ocrdisk -p 192.168.12.99:3260 -l


查看当前会话连接的iscsi target
iscsiadm -m node session


#fdisk 查看 分区

安装RAC
http://www.oracle-base.com/articles/rac/articles-rac.php

1.安装包
#
yum install  libcap* libcap.so.1 compat-libcap1-1.10-1.x86_64 compat-libstdc++  elfutils-libelf-devel   glibc-devel   gcc   gcc-c++   libaio-devel libstdc++-devel  unixODBC unixODBC-devel  sysstat  binutils  elfutils-libelf   glibc  glibc-common  libaio  libgcc  libstdc++  make   libXp  libXp-devel  libXau-devel

#2.update system

vi /etc/sysctl.conf

echo " kernel.shmmni = 4096 " >> /etc/sysctl.conf
echo " kernel.sem = 250 32000 100 128 " >> /etc/sysctl.conf
echo " fs.file-max = 6815744 " >> /etc/sysctl.conf
echo " fs.aio-max-nr = 1048576 " >> /etc/sysctl.conf
echo " net.ipv4.ip_local_port_range = 9000 65500 " >> /etc/sysctl.conf
echo " net.core.rmem_default=262144 " >> /etc/sysctl.conf
echo " net.core.rmem_max=4194304 " >> /etc/sysctl.conf
echo " net.core.wmem_default=262144 " >> /etc/sysctl.conf
echo " net.core.wmem_max=1048586 " >> /etc/sysctl.conf

#sysctl -p

#3. /etc/security/limits.conf
echo "grid               soft    nproc   2047 " >> /etc/security/limits.conf
echo "grid               hard    nproc   16384 " >> /etc/security/limits.conf
echo "grid               soft    nofile  1024 " >> /etc/security/limits.conf
echo "grid               hard    nofile  65536 " >> /etc/security/limits.conf

echo "oracle               soft    nproc   2047 " >> /etc/security/limits.conf
echo "oracle               hard    nproc   16384 " >> /etc/security/limits.conf
echo "oracle               soft    nofile  1024 " >> /etc/security/limits.conf
echo "oracle               hard    nofile  65536 " >> /etc/security/limits.conf


#/etc/pam.d/login
echo "session    required     /lib64/security/pam_limits.so" >> /etc/pam.d/login

#/etc/profile

if [ \$USER = "oracle" ] ||  [ \$USER = "grid" ] ; then
  if [ \$SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi

# add oracle/grid user

groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1200 dba
groupadd -g 1201 oper
groupadd -g 1300 asmdba
groupadd -g 1301 asmoper

useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper grid
useradd -u 1101 -g oinstall -G dba,oper,asmdba oracle

#modify password
passwd oracle
passwd grid


#Install the following package from the Oracle grid media after you've defined groups.
# 2个节点上安装cvuqdisk-1.0.9-1.rpm (grid包内)
    cd /home/oracle/software/grid
    rpm -Uvh cvuqdisk-1.0.9-1.rpm


#disable firewall
vi /etc/selinux/config
SELINUX=disabled


# shutdown ntp  service
service ntpd stop
mv /etc/ntp.conf /etc/ntp.conf.orig
rm /var/run/ntpd.pid
chkconfig  ntpd off

#如果是使用ntp服务,需要增加-x
If you want to use NTP, you must add the "-x" option into the following line in the "/etc/sysconfig/ntpd" file.
    OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
Then restart NTP.
# service ntpd restart

# 创建主目录
mkdir -p  /u01/app/11.2.0.4/grid
mkdir -p /u01/app/oracle/product/11.2.0.4/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

#设置环境变量 rac1/rac2

#su - oracle
vi /home/oracle/grid_env

ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

$chmod u+x grid_env


# su -  oracle
vi /home/oracle/.bashrc
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=rac1; export ORACLE_HOSTNAME
ORACLE_UNQNAME=RAC; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
GRID_HOME=/u01/app/11.2.0.4/grid; export GRID_HOME
DB_HOME=$ORACLE_BASE/product/11.2.0.4/db_1; export DB_HOME
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi

alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'



$ vi /home/oracle/db_env
ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


#chech network
ifconfig -a | grep eth

#创建用户等效性
2个节点上执行如下
$
mkdir ~/.ssh
chmod 755 ~/.ssh
ssh-keygen -t dsa

#将rac1/rac2节点的公钥拷贝到rac1节点的 authorized_keys
rac1$
   cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
   ssh oracle@rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys


#将rac1/rac2节点的公钥拷贝到rac2节点的 authorized_keys
rac2$
   cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
   ssh oracle@rac1 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys


# 检查环境
cd /home/oracle/grid
./runcluvfy.sh  stage -pre crsinst -n rac1,rac2 -fixup -verbose



#udev 绑定磁盘
先将磁盘分区。 再udev
http://www.oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux-5-and-6.php

# echo  "options=-g" >>  /etc/scsi_id.config

# create udev file
[root@rac2 ~]# /sbin/scsi_id -g -u -d /dev/sdb
14f504e46494c45524538583332352d6b5072502d52716646
[root@rac2 ~]# /sbin/scsi_id -g -u -d /dev/sdc
14f504e46494c45527353705834552d306e63422d61427365
[root@rac2 ~]# /sbin/scsi_id -g -u -d /dev/sdd
14f504e46494c4552454f494e566e2d315a5a612d56324657


vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="14f504e46494c45527861566e4e712d477273722d4a5a7a4d", NAME="asm-fr", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="14f504e46494c45527353705834552d306e63422d61427365", NAME="asm-data", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="14f504e46494c4552454f494e566e2d315a5a612d56324657", NAME="asm-votedisk", OWNER="oracle", GROUP="dba", MODE="0660"

# /sbin/start_udev


# 安装集群件
1. 安装grid 安装votedisk/ocr盘
2. 只安装database软件
3. asmca创建FR,DATA2个目录, dbca创建数据库。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8455750/viewspace-777118/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2010-09-14

  • 博文量
    4
  • 访问量
    6820