Linux7.2安装ORACLE12C_RAC
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux7.2安装ORACLE12C_RAC相关的知识,希望对你有一定的参考价值。
ASM磁盘空间规划
OCR+VOTING 8G三个NORMAL冗余
MGMT 80G 外部冗余
1、硬件检测
内存(最少8G)
grep MemTotal /proc/meminfo
swap空间(4-16G equal to RAM more than 16GB:16GB )
grep SwapTotal /proc/meminfo
/tmp目录大小 >2G
df -h /tmp
空闲内存
free
内核版本:
uname -r
df -h /dev/shm
2、系统版本
cat /etc/oracle-release
cat /etc/redhat-release
lsb_release -id
uname -r
3、修改主机名:
节点1:
hostname dwdb1
hostnamectl --static set-hostname dwdb1
节点2:
hostname dwdb2
hostnamectl --static set-hostname dwdb2
4、关闭防火墙:
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
看状态
firewall-cmd --state
systemctl stop firewalld.service
systemctl disable firewalld.service
5、配置主机名和IP地址对应关系
vi /etc/hosts 添加如下内容
public
10.1.11.1 dwdb1
10.1.11.2 dwdb2
private
20.1.1.39 dwdb1-priv
20.1.1.40 dwdb2-priv
vip
10.1.11.161 dwdb1-vip
10.1.11.162 dwdb2-vip
scanip
10.1.11.163 scan-dwdb
修改/etc/sysconfig/network
NOZEROCONF=yes
6、安装依赖包:(oracle linux 7.2依赖包如下,具体可参考官方文档)
yum install -y binutils-2.23.52.0.1-12.el7
yum install -y compat-libcap1-1.10-3.el7
yum install -y compat-libstdc++-33-3.2.3-71.el7
yum install -y glibc-2.17-36.el7
yum install -y glibc-devel-2.17-36.el7
yum install -y ksh
yum install -y libaio-0.3.109-9.el7
yum install -y libaio-devel-0.3.109-9.el7
yum install -y libX11-1.6.0-2.1.el7
yum install -y libXau-1.0.8-2.1.el7
yum install -y libXi-1.7.2-1.el7
yum install -y libXtst-1.2.2-1.el7
yum install -y libgcc-4.8.2-3.el7
yum install -y libstdc++-4.8.2-3.el7
yum install -y libstdc++-devel-4.8.2-3.el7
yum install -y libxcb-1.9-5.el7
yum install -y make-3.82-19.el7
yum install -y nfs-utils-1.3.0-0.21.el7.x86_64
yum install -y net-tools-2.0-0.17.20131004git.el7
yum install -y smartmontools-6.2-4.el7
yum install -y sysstat-10.1.5-1.el7
yum install -y compat-libcap1-1.10
yum install -y sysstat-10.1.5
yum install -y libaio-devel-0.3.109
7、关闭transparent hugepages,设置hugepages
查看transparent hugepage
Red Hat Enterprise Linux kernels:
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
Other kernels:
cat /sys/kernel/mm/transparent_hugepage/enabled
oracle linux 7.2 没有开启transparent hugepages,忽略。
8、启用Name Service Cache Deamon
yum install -y nscd
systemctl start nscd
systemctl enable nscd
7、verifying the Disk I/O Scheduler on Linux
cat /sys/block/${ASM_DISK}/queue/scheduler
noop [deadline] cfq
8、配置NTP时间同步
ntpdate 10.1.30.231
vi /etc/ntp.conf 修改以下内容
server 10.1.30.231 iburst
server 10.1.30.232 iburst
systemctl enable ntpd.service
/etc/init.d/ntpd start
/chkconfig ntpd on
/chkconfig --list ntpd
systemctl restart chronyd.service
systemctl enable chronyd.service
9、网络配置(/etc/sysctl.conf)
private address to 2
public address to 1
bond1 p4p1 em3 20.1.1.39 private
bond0 p5p1 p6p1 10.1.11.1 public
net.ipv4.conf.p4p1.rp_filter=2
net.ipv4.conf.em3.rp_filter=2
net.ipv4.conf.p5p1.rp_filter=1
net.ipv4.conf.p6p1.rp_filter=1
10、用户和组:
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle
/usr/sbin/useradd -u 54331 -g oinstall -G dba,asmdba,asmoper,asmadmin grid
passwd oracle
hagj5Xc2GokR
passwd grid
a31K0eBBJMXW
11、目录:
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 71 /u01/app/oraInventory
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01/app/grid
mkdir -p /u01/12.2.0/grid
chown -R grid:oinstall /u01/12.2.0/grid
chmod -R 71 /u01/12.2.0/grid
mkdir -p /u01/app/oracle
mkdir /u01/app/oracle/fetology
chown -R oracle:oinstall /u01/app/oracle
chmod -R 71 /u01/app/oracle
mkdir -p /u01/app/oracle/product/12.2.0/db_1
chown -R oracle:oinstall /u01/app/oracle/product/12.2.0/db_1
chmod -R 71 /u01/app/oracle/product/12.2.0/db_1
12、环境变量
节点1:
--oracle用户
export ORACLE_SID=dwdb1
export ORACLE_BASE=/u01/app/oracle/
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1
export 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
--grid
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/12.2.0/grid
export 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
节点2:
--oracle用户
export ORACLE_SID=dwdb2
export ORACLE_BASE=/u01/app/oracle/
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_1
export 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
--gird
export ORACLE_SID=+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/12.2.0/grid
export 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
13、防火墙
/etc/init.d/iptables stop
chkconfig iptables off
networkmanager
chkconfig NetworkManager off
linux6上关闭防火墙和selinux,root下执行:
service iptables stop
chkconfig iptables off
service ip6tables stop
chkconfig ip6tables off
setenforce 0
getenforce
vi /etc/selinux/config 确保以下内容
SELINUX=disabled
linux6上 iptables关闭后 ip6tables会起来,所以最好一并关掉。
/etc/init.d/iptables stop
chkconfig iptables off
14、内核参数:
kernel.panic_on_oops = 1
fs.aio-max-nr = 104852
fs.file-max = 6815744
kernel.shmall = 134217728
kernel.shmmax = 558345748480
kernel.shmmni = 4096
kernel.sem = 5010 641280 5010 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_default = 8388608
net.core.wmem_max = 16777216
vm.swappiness = 0
vm.nr_hugepages = 163845
--修改以下两个
kernel.shmall = 134217728
kernel.shmmax = 558345748480
--保存生效
/sbin/sysctl -p
15、限制文件:/etc/security/limits.conf
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 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
- soft memlock 524288000
- hard memlock 524288000
16、/etc/pam.d/login文件
session required pam_limits.so
/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
17、配置互信
在两个节点上执行:
su - oracle
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
2)在第二个节点上执行
cd .ssh
scp id_rsa.pub rac1:/home/oracle/.ssh/id_rsa.pub2
scp id_dsa.pub rac1:/home/oracle/.ssh/id_dsa.pub2
3)在第一个节点上执行
cat id_dsa.pub id_dsa.pub2 id_rsa.pub id_rsa.pub2>authorized_keys
chmod 644 authorized_keys
scp authorized_keys rac2:/home/oracle/.ssh
配置完成后进行测试:
ssh dwdb1
ssh dwdb1-priv
ssh dwdb2
ssh dwdb2-priv
ssh dwdb2
ssh dwdb2-priv
ssh dwdb1
ssh dwdb1-priv
ssh dwdb2-priv
ssh dwdb1-priv
ssh dwdb1
ssh dwdb2
ssh dwdb2
ssh dwdb2-priv
ssh dwdb2
ssh dwdb1-priv
ssh dwdb1
ssh dwdb1-priv
ssh dwdb1
ssh dwdb2-priv
ssh dwdb2-priv
ssh dwdb1-priv
ssh dwdb1
ssh dwdb1
./runcluvfy.sh stage -pre crsinst -n dwdb1,dwdb2
18、安装cvudisk RPM包
cvuqdisk存于oracle GI安装介质的cv/rpm目录下
export CVUQDISK_GRP=asmadmin
rpm -ivh cvuqdisk-1.0.10-1.rpm
19、配置ASM盘:
OCR:8G NORMAL冗余
GIMR:至少40G 外部冗余
DATA:外部冗余
ARCH:外部冗余
root配置脚本如下:
vi asm_udev.sh
#!/bin/bash
for i in $(cat /proc/partitions | awk {‘print $4‘} |grep emcpower|sort);
do
echo "ACTION==\"add|change\", KERNEL==\"emcpower*\", ENV{DEVTYPE}==\"disk\",SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id -g -u -d --whitelisted --replace-whitespace --device=\$devnode\", RESULT==\"/usr/lib/udev/scsi_id -g -u -d --whitelisted --replace-whitespace --device=/dev/$i
\",RUN+=\"/bin/sh -c ‘mknod /dev/asm-$i b \$major \$minor; chown grid:asmadmin /dev/asm-$i; chmod 0660 /dev/asm-$i‘\"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done
chmod +x asm_udev.sh
重新加载udev
/sbin/udevadm trigger
以上是关于Linux7.2安装ORACLE12C_RAC的主要内容,如果未能解决你的问题,请参考以下文章