Chinaunix首页 | 论坛 | 博客
  • 博客访问: 676375
  • 博文数量: 163
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1625
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-24 11:40
个人简介

资深Oracle数据库专家 OCM认证大师 10年数据库相关服务及开发经验 各类数据库相关方案的编写,管理及实施 数据中心数据库日常运维、大型项目割接、性能优化等方面有丰富的实战经验 客户包括: 电信,银行,保险,航空,国网,汽车,烟草等 想要一起学习探讨数据安全技术的请加qq群 256041954

文章分类

全部博文(163)

文章存档

2017年(2)

2016年(112)

2015年(38)

2014年(11)

我的朋友

分类: Oracle

2016-05-03 23:47:20

                              Oracle11g RAC 安装文档

一:安装系统包                                               

yum localinstall libaio* libgcc* libstdc* unixODBC* 

yum localinstall unixODBC-devel-2.2.14-11.AXS4.i686.rpm                                                      

yum  localinstall elfutils-libelf-devel-0.152-1.0.1.AXS4.x86_64.rpm        

yum localinstall compat-libstdc++-33-3.2.3-69.AXS4.x86_64.rpm              

yum localinstall gcc-objc++-4.4.6-4.AXS4.x86_64.rpm

yum localinstall libstdc++-4.4.6-4.AXS4.i686.rpm

yum localinstall libaio* compat* libaio* libgcc* libstdc* unix*               

rpm  -ivh unixODBC-devel-2.2.14-11.AXS4.x86_64.rpm                          

rpm -ivh unixODBC-2.2.14-11.AXS4.x86_64.rpm                                 

rpm -ivh unixODBC-devel-2.2.14-11.AXS4.x86_64.rpm                           

rpm -ivh unixODBC-2.2.14-11.AXS4.x86_64.rpm                                 

rpm -ivh unixODBC-2.2.14-11.AXS4.x86_64.rpm                                 

rpm -ivh libstdc++-docs-4.4.6-4.AXS4.x86_64.rpm                             

rpm -ivh libstdc++-devel-4.4.6-4.AXS4.x86_64.rpm                            

rpm -ivh libstdc++-4.4.6-4.AXS4.x86_64.rpm                                   

rpm -ivh libstdc++-docs-4.4.6-4.AXS4.x86_64.rpm                             

rpm -ivh libstdc++-devel-4.4.6-4.AXS4.x86_64.rpm                            

rpm -ivh libstdc++-4.4.6-4.AXS4.x86_64.rpm                                  

rpm -ivh libgcc-4.4.6-4.AXS4.x86_64.rpm                                     

rpm -ivh libaio-devel-0.3.107-10.AXS4.x86_64.rpm                            

rpm -ivh libaio-0.3.107-10.AXS4.x86_64.rpm                                  

rpm -ivh libaio-devel-0.3.107-10.AXS4.x86_64.rpm                            

rpm -ivh gcc-c++-4.4.6-4.AXS4.x86_64.rpm                                    

rpm -ivh  glibc-headers-2.12-1.80.AXS4.5.x86_64.rpm                         

rpm -ivh glibc-devel-2.12-1.80.AXS4.5.x86_64.rpm                           

rpm -ivh libaio-devel-0.3.107-10.AXS4.i686.rpm

rpm -ivh libgcc-4.4.6-4.AXS4.i686.rpm

rpm -ivh glibc-2.12-1.80.AXS4.5.i686.rpm

rpm -ivh libaio-0.3.107-10.AXS4.i686.rpm

rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm           

二: 安装集群之前的准备工作

1:查看ssh是否安装
rpm -qa |grep ssh

2:用户组及用户创建

groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1302 oper
groupadd -g 1200 dba
groupadd -g 1300 asmdba
groupadd -g 1301 asmoper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
useradd -u 1101 -g oinstall -G dba,asmdba,oper oracle
passwd oracle     passwd grid
mkdir –p /u01/grid
mkdir -p  /u01/app/grid/product/11.2.0/grid
mkdir –p /u01/app/oracle
mkdir –p /u01/app/ora11g/product/db
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chown -R oracle:oinstall /u01/app/ora11g
chmod -R 775 /u01

3)环境变量设置

NODE1

NODE2

$ whoami
grid
$ vi .bash_profile
export ORACLE_SID=+ASM1

export ORACLE_BASE=/u01/grid

#export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid

export ORACLE_TERM=xterm

export TMP=/tmp

export TMPDIR=$TMP

PATH=$PATH:$HOME/bin

export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

~ $ whoami
oracle
$ vi .bash_profile
ORACLE_SID=MOEUUMDB1

export ORACLE_SID

ORACLE_UNQNAME=MOEUUMDB

export ORACLE_UNQNAME

ORACLE_BASE=/home/app/oracle

export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/db

export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH

export PATH

$ whoami
grid
$ vi .bash_profile
export ORACLE_SID=+ASM2

export ORACLE_BASE=/u01/grid

#export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid

export ORACLE_TERM=xterm

export TMP=/tmp

export TMPDIR=$TMP

PATH=$PATH:$HOME/bin

export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

$ whoami
oracle
$ vi .bash_profile
ORACLE_SID=MOEUUMDB1

export ORACLE_SID

ORACLE_UNQNAME=MOEUUMDB

export ORACLE_UNQNAME

ORACLE_BASE=/home/app/oracle

export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/db

export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH

export PATH

 

3硬件检查

grep MemTotal /proc/meminfo

grep SwapTotal /proc/meminfo

df -h
df -h /tmp

free

uname –m

如果虚拟内存不足增加:

dd if=/dev/zero of=/home/swap/swapadd bs=1024 count=12242880

mkswap /home/swap/swapadd

swapon /home/swap/swapadd

4:网络配置

127.0.0.1 localhost.localdomain localhost

#public ip

192.168.89.163  yyzcdb1

192.168.89.164  yuzcdb2

#priv ip

172.0.0.5  yyzcdb1-priv

172.0.0.6  yyzcdb2-priv

#vip ip

192.168.89.165  yyzcdb1-vip

192.168.89.166  yyzcdb2-vip

#scan ip

192.168.89.167  yyzcdb-scan

5软件环境设置

cat /proc/version

uname -r

 

rpm -q package_name(根据官方文档提示验证:安装时根据最上面命令)

6关闭NTP

# /sbin/service ntpd stop

# chkconfig ntpd off

# rm /etc/ntp.conf

or, mv /etc/ntp.conf to /etc/ntp.conf.org.

7:系统用户设置

/etc/security/limits.conf

grid                 soft    nproc   2047

grid                 hard    nproc   16384

grid                 soft    nofile  1024

grid                 hard    nofile  65536

grid                 hard    stack   10240

oracle               soft    nproc   2047

oracle               hard    nproc   16384

oracle               soft    nofile  1024

oracle               hard    nofile  65536

oracle               hard    stack   10240

 

8:系统安装限制设置

# cat >> /etc/pam.d/login << EOF
session required /lib64/security/pam_limits.so
EOF

vi /etc/sysconfig/selinux

#modify by lcs for oracle

#old SELINUX=enforcing

SELINUX=disabled

1) 永久性生效,重启后不会复原

开启: chkconfig iptables on

关闭: chkconfig iptables off

2) 即时生效,重启后复原

开启: service iptables start

关闭: service iptables stop

# cat >> /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
    umask 022
fi

9:系统内核设置
以下操作RAC每个节点同样进行:

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

# /sbin/sysctl -p

raw /dev/raw/raw1  /dev/mapper/mpathc

chown  grid:oinstall /dev/mapper/mpath0

chmod 644 /dev/mapper/mpath0          

chown  grid:oinstall /dev/mapper/mpath0

chmod 644 /dev/mapper/mpath0 

 

开机启动的脚本配置到/etc/rc.d/rc.local中

vi /etc/rc.local

chown  grid:oinstall /dev/mapper/mpath0

chmod 644 /dev/mapper/mpath0          

chown  grid:oinstall /dev/mapper/mpath0

chmod 644 /dev/mapper/mpath0 

 

raw /dev/raw/raw1  /dev/mapper/mpathc

raw /dev/raw/raw2  /dev/mapper/mpathd

raw /dev/raw/raw3  /dev/mapper/mpathe

raw /dev/raw/raw4  /dev/mapper/mpathf

raw /dev/raw/raw5  /dev/mapper/mpathg

 

chown grid:oinstall /dev/raw/raw1    

chown grid:oinstall /dev/raw/raw2    

chown grid:oinstall /dev/raw/raw3    

chown grid:oinstall /dev/raw/raw4    

chown grid:oinstall /dev/raw/raw5    

chown grid:oinstall /dev/mapper/mpathc

chown grid:oinstall /dev/mapper/mpathd

chown grid:oinstall /dev/mapper/mpathe

chown grid:oinstall /dev/mapper/mpathf

chown grid:oinstall /dev/mapper/mpathg

chmod 775  /dev/raw/raw1             

chmod 775  /dev/raw/raw2             

chmod 775  /dev/raw/raw3             

chmod 775  /dev/raw/raw4             

chmod 775  /dev/raw/raw5             

chmod 775  /dev/mapper/mpathc        

chmod 775  /dev/mapper/mpathd        

chmod 775  /dev/mapper/mpathe        

chmod 775  /dev/mapper/mpathf        

chmod 775  /dev/mapper/mpathg

chown grid:oinstall mpathc

chown grid:oinstall mpathd

chown grid:oinstall mpathe

chown grid:oinstall mpathf

chown grid:oinstall mpathg

chmod 644 mpathc

chmod 644 mpathd

chmod 644 mpathe

chmod 644 mpathf

chmod 644 mpathg

 

10安装集群之前可以使用下面命令验证环境

./runcluvfy.sh stage -post hwos -n idc1spplsrmdb01,idc1spplsrmdb02 -verbose

./runcluvfy.sh stage -pre crsinst -n idc1spplsrmdb01,idc1spplsrmdb02 -fixup -verbose

./runcluvfy.sh stage -pre crsinst -n idc1spplsrmdb01,idc1spplsrmdb02  –verbose

11启动图形界面安装grid

12启动图形界面安装Oracle数据库软件

13dbca创建数据库

备注:

 Redhat 下多路径配置

linux redhat 6.5 多路径配置


|1、查看是否有多路径软件

rpm -qa|grep device-mapper


2、如果没有,安装

device-mapper-multipath

device-mapper

在安装盘的Packages中


#rpm -ivh device-mapper-multipath-libs.*

#rpm -ivh device-mapper-****.rpm

#rpm -ivh device-mapper-multipath-**8.rpm


3、设置开机启动

查看是否开机自启动

chkconfig --list|grep multipathd

设置成开机自启动

chkconfig --level 2345 multipathd on

检查安装是否正常,内核中是否存在

#modprobe -l|grep multipath

kernel/drivers/md/dm-multipath.ko


重启加载内核或手工加载

#modprobe dm-multipath

#modprobe dm-round-robin

#service multipathd start

 

4、生产multipath配置文件

#/sbin/mapathcnf --enable

#ls /etc/multipath.conf


5、multipath配置文件

默认情况下multipath生成dm设备之后,会同时在/dev/mapper/下生成以磁盘wwid为名的符号链接指向对应的dm设备。如果想生成mpath设备,则需要打开user_friendly_names选项

defaults {

        user_friendly_names yes

}



blacklist {

        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"

        devnode "^hd[a-z]"

        devnode "^dcssblk[0-9]*"

        device {

                vendor "DGC"

                product "LUNZ"

        }

        device {

                vendor "IBM"

                product "S/390.*"

        }

 device {

                vendor  "ATA"

 }

      device {

                vendor  "3ware"

        }

device {

                vendor  "AMCC"

        }

device {

                vendor  "HPT"

        }

        wwid "3600605b00a9885501d93232c3391b1f1"

        wwid "E0AE835EDFA407A"

        device {

                vendor Raritan

                product Virtual_Disc_1

        }

        wwid "*"

}

 


blacklist_exceptions {

        wwid "36006016066003e000e3d0cd3fc60e511"

        wwid "36006016066003e00db37a2c8fc60e511"

        wwid "36006016066003e00fdee54ddfc60e511"

}

multipaths {

        multipath {

                uid 0

                gid 0

                wwid "36006016066003e000e3d0cd3fc60e511"

                mode 0600

                alias mpathb

        }

        multipath {

                uid 0

                gid 0

                wwid "36006016066003e00db37a2c8fc60e511"

                mode 0600

                alias mpathc

        }

        multipath {

                uid 0

                gid 0

                wwid "36006016066003e00fdee54ddfc60e511"

                mode 0600

                alias mapthd

        }

获取wwid的方法

1、multipath -v3|grep 3600

2、/var/lib/multipth/bindings   但是我没有找到这个文件,可能跟操作系统版本有关。


multipath -ll查看多路径

service multipathd restart

multipath -F重新定义别名后删除不用的路径

multipath -v2 重新扫描







阅读(1409) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~