一、实施前期准备工作
二、安装前期准备工作
配置完全相同的两台服务器,安装相同版本的Linux操作系统。留存系统光盘或者镜像文件。
我这里是RHEL6.2,系统目录大小均一致。对应RHEL6.2的系统镜像文件放在服务器上,供后面配置本地yum使用。
multipath -ll
multipath -F
multipath -v2
multipath -ll
公有网络 以及 私有网络。
公有网络:两个物理网卡eth1和eth3先做的bonding,然后公网使用绑定后的设备bond0
bond0{public IP,VIP} ScanIP(1~3个);
私有网络:eth0,eth2{2组private IP}
service ntpd stop
date
#如果时间有问题,就按下面的语法进行设定
date 072310472015 //设定日期为2015-07-23 10:47:00
hwclock -w
hwclock -r
service iptables stop
chkconfig iptables off && chkconfig ip6tables off && chkconfig libvirtd off //libvirtd这个服务会调用启动防火墙,所以一起关闭
setenforce 0
#验证防火墙状态为关闭
service iptables status
#验证都是off
chkconfig --list |grep iptables && chkconfig --list |grep ip6tables && chkconfig --list |grep libvirtd
#验证SELinux配置和当前状态
vi /etc/selinux/config
getenforce
检查依赖包,没安装的配置本地yum安装即可:
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh ksh
根据主机名和IP规划来配置/etc/hosts
#public ip
172.16.7.112 jyracdb1
172.16.7.114 jyracdb2
#private ip
192.168.10.2 jyracdb1-priv
192.168.10.1 jyracdb2-priv
192.168.20.2 jyracdb1-priv-2
192.168.20.1 jyracdb2-priv-2
#virtual ip
172.16.7.113 jyracdb1-vip
172.16.7.115 jyracdb2-vip
#scan ip
172.16.7.120 jyracdb-scan
#新建组:
groupadd -g 700 asmadmin
groupadd -g 701 asmdba
groupadd -g 702 asmoper
groupadd -g 800 oinstall
groupadd -g 801 dba
groupadd -g 802 oper
#新建用户:
useradd -g oinstall -G asmadmin,asmdba,asmoper -u 700 grid
useradd -g oinstall -G dba,asmdba,oper -u 800 oracle
#设置用户密码:
passwd oracle
passwd grid
我这里规划的是Oracle DB安装目录/opt/app/oracle,GI安装目录/opt/app/11.2.0/grid
只需要建立/opt/app目录并赋权即可。
mkdir -p /opt/app/ && chown -R oracle:oinstall /opt/app/ && chmod 775 /opt/app && ls -lh /opt
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 51539607552 //一般设置为系统内存75%单位是字节
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 生效
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 1024
session required /lib64/security/pam_limits.so
export GRID_HOME=/opt/app/11.2.0/grid
export ORACLE_HOME=/opt/app/11.2.0/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=+ASM1
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32
export ORACLE_BASE=/opt/app/grid
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG=American_america.ZHS16GBK
export GRID_HOME=/opt/app/11.2.0/grid
export ORACLE_HOME=/opt/app/11.2.0/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=+ASM2
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32
export ORACLE_BASE=/opt/app/grid
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG=American_america.ZHS16GBK
export ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=jyzhao1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/opt/app/oracle
export NLS_LANG=American_america.ZHS16GBK
export ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=jyzhao2
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/opt/app/oracle
export NLS_LANG=American_america.ZHS16GBK