11.2.0.4 rac + redhat server 6.2

cactus0509發表於2013-11-20
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


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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章