. 关闭ipv4防火墙(两个节点):
[root@RAC01 ~]# service iptables stop
[root@RAC01 ~]# service iptables status
iptables: Firewall is not running. . 关闭ipv6防火墙(两个节点)
[root@RAC01 ~]# service ip6tables stop
[root@RAC01 ~]# service ip6tables status
ip6tables: Firewall is not running. . 将防火禁用,开启禁止启动(两个节点)
[root@RAC01 ~]# chkconfig iptables off
[root@RAC01 ~]# chkconfig iptables --list
iptables :off :off :off :off :off :off :off
[root@RAC01 ~]# chkconfig ip6tables off
[root@RAC01 ~]# chkconfig ip6tables --list
ip6tables :off :off :off :off :off :off :off . 关闭seLinux(两个节点)
[root@RAC01 ~]# setenforce
[root@RAC01 ~]# getenforce
Permissive . 修改/etc/selinux/config文件中如下参数,改为disabled,防止开启启动seLinux(两个节点)
[root@RAC01 ~]# vim /etc/selinux/config
SELINUX=disabled . 配置yum源(两个节点)
[root@RAC01 ~]# mkdir /mnt/rhel6
[root@RAC01 ~]# mount /dev/cdrom /mnt/rhel6/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@RAC01 ~]# vi /etc/yum.repos.d/rhel-source.repo
[rhel-source]
name=Rhel-Source
baseurl=file:///mnt/rhel6
enabled=
gpgcheck= . 添加用户和组(两个节点)两个节点用户和组的id必须相同
[root@RAC01 ~]# groupadd -g oinstall
[root@RAC01 ~]# groupadd -g dba
[root@RAC01 ~]# useradd -m -u -g oinstall -G dba -d /home/grid -s /bin/bash grid
[root@RAC01 ~]# useradd -m -u -g oinstall -G dba -d /home/oracle -s /bin/bash oracle
[root@RAC01 ~]# id oracle
uid=(oracle) gid=(oinstall) groups=(oinstall),(dba)
[root@RAC01 ~]# id grid
uid=(grid) gid=(oinstall) groups=(oinstall),(dba)
[root@RAC01 ~]# passwd oracle
[root@RAC01 ~]# passwd grid
[root@RAC01 ~]# id nobody
uid=(nobody) gid=(nobody) groups=(nobody) . 配置/etc/scsi_id.config文件,如果没有,添加该文件(两个节点)
[root@RAC01 ~]# vi /etc/scsi_id.config
options=--whitelisted --replace-whitespace . 查看磁盘挂载情况(两个节点)
[root@RAC01 ~]# fdisk -l . 查看磁盘uuid(两个节点)
[root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdb
1ATA_VBOX_HARDDISK_VB9c35185d-71839d24
[root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdc
1ATA_VBOX_HARDDISK_VB877f7039-af2e1093
[root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdd
1ATA_VBOX_HARDDISK_VBb7f2953b-98c4b5b0
[root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sde
1ATA_VBOX_HARDDISK_VB14675203-e79b1889 . 添加配置文件,使用udev进行绑定
[root@RAC01 ~]# vi /etc/udev/rules.d/-oracle-asmdevices.rules
KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB9c35185d-71839d24",NAME="asm-disk1",OWNER="oracle",GROUP="oinstall",MODE=""
KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB877f7039-af2e1093",NAME="asm-disk2",OWNER="oracle",GROUP="oinstall",MODE=""
KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VBb7f2953b-98c4b5b0",NAME="asm-disk3",OWNER="oracle",GROUP="oinstall",MODE=""
KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB14675203-e79b1889",NAME="asm-disk4",OWNER="oracle",GROUP="oinstall",MODE="" . 将该配置文件拷贝到节点2
[root@RAC01 ~]# scp /etc/udev/rules.d/-oracle-asmdevices.rules 192.168.56.11:/etc/udev/rules.d/-oracle-asmdevices.rules . 开启udev,查看是否生效,并查看磁盘的权限(两个节点)
[root@RAC01 ~]# start_udev(两个节点)
Starting udev: [ OK ] [root@RAC01 ~]# ls -l /dev/asm*
brw-rw----. oracle oinstall , Feb : /dev/asm-disk1
brw-rw----. oracle oinstall , Feb : /dev/asm-disk2
brw-rw----. oracle oinstall , Feb : /dev/asm-disk3
brw-rw----. oracle oinstall , Feb : /dev/asm-disk4 . 配置时间同步(两个节点)
[root@RAC01 etc]# service ntpd stop
Shutting down ntpd: [ OK ]
[root@RAC01 etc]# service ntpd status
ntpd is stopped
[root@RAC01 etc]# chkconfig ntpd off
[root@RAC01 etc]# chkconfig ntpd --list
ntpd :off :off :off :off :off :off :off
[root@RAC01 etc]# mv /etc/ntp.conf /etc/ntp.conf.bak
[root@RAC01 etc]# rm /var/run/ntpd.pid . 创建安装目录(两个节点)
[root@RAC01 etc]# mkdir -p /u01/app/grid
[root@RAC01 etc]# mkdir -p /u01/app/11.2./grid
[root@RAC01 etc]# chown -R grid:oinstall /u01
[root@RAC01 etc]# mkdir -p /u01/app/oracle
[root@RAC01 etc]# chown oracle:oinstall /u01/app/oracle
[root@RAC01 etc]# chmod -R /u01 . 修改环境变量文件,添加如下几行(两个节点)
[root@RAC01 etc]# su - grid
[grid@RAC01 ~]$ vi .bash_profile
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2./grid
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp . 查看grid用户的环境变量是否生效(两个节点)
[grid@RAC01 ~]$ exit
[root@RAC01 etc]# su - grid
[grid@RAC01 ~]$ echo $PATH
/u01/app/11.2./grid/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/grid/bin:/usr/local/bin/:. . 修改oracle用户的环境变量,添加如下几行(两个节点)
[root@RAC01 etc]# su - oracle
[oracle@RAC01 ~]$ vi .bash_profile
export ORACLE_SID=orcl1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2./db_1
export ORACLE_UNQNAME=orcl
export PATH=$ORACLE_HOME/bin:$PATH . 查看oracle用户环境变量是否生效(两个节点)
[oracle@RAC01 ~]$ exit
[root@RAC01 etc]# su - oracle
[oracle@RAC01 ~]$ echo $PATH
/u01/app/oracle/product/11.2./db_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin . 修改hosts记录,如下(两个节点)
[root@RAC01 etc]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.10 RAC01
192.168.56.11 RAC02
192.168.56.13 RAC01-vip
192.168.56.14 RAC02-vip
192.168.56.15 RAC-scan
10.0.0.10 RAC01-priv
10.0.0.11 RAC02-priv . 修改/etc/security/limits.conf,添加如下几行(两个节点)
[root@RAC01 etc]# vi /etc/security/limits.conf
grid soft nproc
grid hard nproc
grid soft nofile
grid hard nofile
oracle soft nproc
oracle hard nproc
oracle soft nofile
oracle hard nofile . 修改/etc/pam.d/login ,添加下面一行(两个节点)
[root@RAC01 etc]# vi /etc/pam.d/login
session required pam_limits.so . 修改/etc/sysctl,添加下面几行(两个节点)
[root@RAC01 etc]# vi /etc/sysctl.conf
fs.aio-max-nr =
fs.file-max =
kernel.msgmni =
kernel.msgmax =
kernel.msgmnb =
kernel.shmall =
kernel.shmmax =
kernel.shmmni =
kernel.sem =
net.ipv4.ip_local_port_range =
net.core.rmem_default =
net.core.rmem_max =
net.core.wmem_default =
net.core.wmem_max =
net.ipv4.tcp_wmem =
net.ipv4.tcp_rmem = . 使修改生效(两个节点)
[root@RAC01 etc]# sysctl -p . 创建临时路径,上传安装包(单节点)
[root@RAC01 tmp]# mkdir -p /tmp/orasoft . 将安装包进行解压(单节点)
[root@RAC01 tmp]# cd orasoft/
[root@RAC01 orasoft]# ls
p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_3of7.zip p13390677_112040_Linux-x86-64_2of7.zip pdksh-5.2.-.el5_8..i386.rpm
[root@RAC01 orasoft]# unzip p13390677_112040_Linux-x86-64_1of7.zip
[root@RAC01 orasoft]# unzip p13390677_112040_Linux-x86-64_2of7.zip
[root@RAC01 orasoft]# unzip p13390677_112040_Linux-x86-64_3of7.zip . 安装依赖包(两个节点)
[root@RAC01 tmp]# yum install -y binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel sysstat make elfutils-libelf-devel compat-libstdc++--3.2.
Complete! . 解压完成之后,可以看到生成grid的database文件(单节点)
[root@RAC01 orasoft]# ls
database grid pdksh-5.2.-.el5_8..i386.rpm . 安装pdksh包,首先卸载ksh包,在进行安装(两个节点)
[root@RAC01 ~]# rpm -e ksh
[root@RAC01 ~]# rpm -ivh pdksh-5.2.-.el5_8..i386.rpm --nodeps . 安装GI(单节点)
[root@RAC01 orasoft]# export DISPLAY=192.168.56.1:0.0
[root@RAC01 orasoft]# xhost +
[root@RAC01 orasoft]# su - grid
[grid@RAC01 ~]$ cd /tmp/orasoft/grid/
[grid@RAC01 grid]$ ./runInstaller
[grid@RAC01 grid]$ exit . 安装ORACLE(单节点)
[root@RAC01 orasoft]# su - oracle
[oracle@RAC01 ~]$ cd /tmp/orasoft/database/
[oracle@RAC01 database]$ ./runInstaller . 添加ASM磁盘(单节点)
[grid@RAC01 ~]$ asmca . 安装数据库(单节点)
[root@RAC01 orasoft]# su - oracle
[oracle@RAC01 ~]$ dbca 截图太懒