oracle11g rac安装部署

1、虚拟机配置

2、上传oracle软件包(在第一个节点上传即可)

-rw-r--r-- 1 root root 1395582860 Nov  7  2014 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 root root 1151304589 Nov  7  2014 p13390677_112040_Linux-x86-64_2of7.zip

-rw-r--r-- 1 root root 1205251894 Nov  7  2014 p13390677_112040_Linux-x86-64_3of7.zip

3、配置Yum源用于安装oracle依赖包(两个节点都要做)

[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls -l
total 4
-rw-r--r-- 1 root root 71 Aug 21 05:54 kobe.repo
[root@localhost yum.repos.d]# cat kobe.repo 
[kobe]
name=kobe
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=0

4、挂载光盘(两个节点都要)

[root@localhost yum.repos.d]# mkdir /mnt/cdrom
[root@localhost yum.repos.d]# mount /dev/cdrom /mnt/cdrom

mount: block device /dev/cdrom is write-protected, mounting read-only

5、安装oracle依赖包

yum install -y binutils-* compat-libstdc++-33-* elfutils-libelf-* elfutils-libelf-devel-* gcc-* gcc-c++-* glibc-* glibc-common-* glibc-devel-* glibc-headers-* ksh-* libaio-* libgcc-* libstdc++-* make-* sysstat-* unixODBC-* unixODBC-devel-* compat-libcap*

6、/etc/hosts文件配置

第一个节点

192.168.1.53 itpux1
#public ip ent1
192.168.1.53    itpux1
192.168.1.54    itpux2
#priv ip ent2
192.168.40.133  itpux1prv
192.168.40.134  itpux2prv
#vip ip
192.168.1.128   itpux1vip
192.168.1.129   itpux2vip
#scan ip

192.168.1.185   itpuxscan

第二个节点

192.168.1.54 itpux2
#public ip ent1
192.168.1.53    itpux1
192.168.1.54    itpux2
#priv ip ent2
192.168.40.133  itpux1prv
192.168.40.134  itpux2prv
#vip ip
192.168.1.128   itpux1vip
192.168.1.129   itpux2vip
#scan ip

192.168.1.185   itpuxscan

7、配置主机名

第一个节点

[root@localhost yum.repos.d]# hostname itpux1
[root@localhost yum.repos.d]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no

HOSTNAME=itpux1

第二个节点

[root@localhost yum.repos.d]# hostname itpux2
[root@localhost yum.repos.d]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no

HOSTNAME=itpux2

8、添加用户和组

[root@itpux1 ~]# /usr/sbin/groupadd -g 501 oinstall
[root@itpux1 ~]# /usr/sbin/groupadd -g 502 dba
[root@itpux1 ~]# /usr/sbin/groupadd -g 503 oper
[root@itpux1 ~]# /usr/sbin/groupadd -g 504 asmadmin
[root@itpux1 ~]# /usr/sbin/groupadd -g 505 asmoper
[root@itpux1 ~]# /usr/sbin/groupadd -g 506 asmdba
[root@itpux1 ~]# /usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
[root@itpux1 ~]# /usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
[root@itpux1 ~]# 
[root@itpux1 ~]# echo "oracle" |passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@itpux1 ~]# echo "grid"|passwd --stdin grid
Changing password for user grid.

passwd: all authentication tokens updated successfully.

9、创建目录

[root@itpux1 ~]# mkdir -p /u01/app/grid
[root@itpux1 ~]# mkdir -p /u01/app/11.2.0/grid
[root@itpux1 ~]# chown -R grid:oinstall /u01
[root@itpux1 ~]# mkdir -p /u01/app/oraInventory
[root@itpux1 ~]# chown -R grid:oinstall /u01/app/oraInventory
[root@itpux1 ~]# mkdir -p /u01/app/oracle
[root@itpux1 ~]# chown -R oracle:oinstall /u01/app/oracle

[root@itpux1 ~]# chmod -R 775 /u01

10、

修改/etc/security/limits.conf文件
vi /etc/security/limits.conf
#ORACLE SETTING
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

oracle hard stack 32768

11、vi /etc/security/limits.d/90-nproc.conf

#* soft nproc 1024
* - nproc 16384
root soft nproc unlimited

12、[root@itpux1 ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.

SELINUXTYPE=targeted

[root@itpux1 ~]# setenforce 0

13、

[root@itpux1 ~]# service iptables stop

[root@itpux1 ~]# chkconfig iptables off

14、

vi /etc/pam.d/login

#ORACLE SETTING
session required pam_limits.so

15、

vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 1147483648
kernel.shmall = 524288
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
让配置生效:
sysctl -p

16、停止ntp服务

[root@itpux1 ~]# service ntpd status
ntpd is stopped
[root@itpux1 ~]# chkconfig ntpd off
[root@itpux1 ~]# cp /etc/ntp.conf /etc/ntp.conf.bak

[root@itpux1 ~]# rm -rf /etc/ntp.conf


17、[grid@itpux1 ~]$ cat .bash_profile 
# .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export PS1
umask 022
alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux1
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022

fi


[oracle@itpux1 ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs


PATH=$PATH:$HOME/bin

export PATH
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux1
export ORACLE_UNQNAME=itpuxdb
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=itpuxdb1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022

fi


节点2

[grid@itpux2 ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export PS1
umask 022
alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux2
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi

[oracle@itpux2 ~]$ cat .bash_profile
# .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux2
export ORACLE_UNQNAME=itpuxdb
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=itpuxdb2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi

配置SSH信任关系

1).在主节点itpux1上以grid,oracle用户身份生成用户的公匙和私匙
# su - oracle (su - grid)
$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa

2).在副节点itpux2上执行相同的操作,确保通信无阻
# su - oracle (su - grid)
$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa

3).在主节点itpux1上oracle(grid)用户执行以下操作
$ cat ~/.ssh/id_rsa.pub >> ./.ssh/authorized_keys
$ cat ~/.ssh/id_dsa.pub >> ./.ssh/authorized_keys
$ ssh itpux2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh itpux2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ scp ~/.ssh/authorized_keys itpux2:~/.ssh/authorized_keys

4).主节点itpux1上执行检验操作
$ ssh itpux1 date
$ ssh itpux2 date
$ ssh itpux1prv date
$ ssh itpux2prv date

5).在副节点itpux2上执行检验操作
$ ssh itpux1 date
$ ssh itpux2 date
$ ssh itpux1prv date
$ ssh itpux2prv date

设置asm磁盘

第一个节点:
raw配置
vi /etc/udev/rules.d/60-raw.rules 
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf1",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add",KERNEL=="raw*", OWNER="grid", GROUP="asmadmin", MODE="660"


start_udev
ll /dev/raw
raw -qa
第二个节点:
vi /etc/udev/rules.d/60-raw.rules 
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf1",RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add",KERNEL=="raw*", OWNER="grid", GROUP="asmadmin", MODE="660"
partprobe
raw -qa
start_udev
ll /dev/raw





  • 6
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值