Oracle 19c RAC ON OEL7.6安装精简文档
提示
本文为站长原创文章,版权所有,未经允许,禁止转载!
信息
硬件环境: x86-84虚拟机 VMware vSphere环境
操作系统: Oracle Enterprise Linux 7.6 64bit
数据库: Oracle Databse 19C RAC
系统相关配置
用户相关
groupadd -g 5000 asmadmin
groupadd -g 5001 asmdba
groupadd -g 5002 asmoper
groupadd -g 6000 oinstall
groupadd -g 6001 dba
groupadd -g 6002 oper
useradd -u 700 -g oinstall -G asmadmin,asmdba,asmoper,dba,oper grid
useradd -u 701 -g oinstall -G dba,asmdba,asmadmin,asmoper,oper oracle
passwd oracle
Passwd grid
mkdir /u01
chown grid:oinstall /u01
mkdir /u02
chown oracle:oinstall /u02
用户profile
# grid用户
# .bash_profile文件
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
export ORACLE_BASE=/u01/gridbase
export ORACLE_HOME=/u01/19c/grid
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/bin/OPatch
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
#export NLS_DATE_FORMAT="yyyy-mm-dd:hh24:mi:ss"
if [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
# oracle用户
# .bash_profile文件
export ORACLE_BASE=/u02/dbbase
export ORACLE_HOME=/u02/19c/db
export ORACLE_SID=o19c1
export ORACLE_TERM=xterm
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/bin/OPatch
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
#export NLS_LANG=AMERICAN_AMERICA.UTF8
export SQLPATH=~/
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
login.sql
define_editor=vi
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 256
set pagesize 9999
column plan_plus_exp format a80
column global_name new_value gname
set termout off
define gname=idle
column global_name new_value gname
select lower(user) || '@' || substr(global_name,1,decode(dot,0,length(global_name),dot-1)) global_name from (select global_name,instr(global_name,'.') dot from global_name);
set sqlprompt '&gname> '
set termout on
set timing on
用户limit
# memlock = 物理内存 * 90% * 1024 * 1024
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft stack 10240
grid hard stack 32768
grid soft memlock 483183820
grid hard memlock 483183820
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 483183820
oracle hard memlock 483183820
# 生效limit
ulimit -a
# hugepage 计算
# hugepage = SGA值(G) * 1024 (M) * 1024 (K)/ Hugepagesize + 2
vi /etc/sysctl.conf
vm.nr_hugepages=204546
相关系统软件包安装
# 配置本地YUM
# 先把iso光盘挂在在 /media目录下
vi /etc/yum.repos.d/public-yum-ol7.repo
[local]
name=Local Repository
baseurl=file:///media
gpgcheck=0
enabled=1
# 安装软件包
yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat oracle-database-preinstall-19c-1.0-1.el7.x86_64
rpm -ivh <数据库介质所在位置>/cv/rpm/cvuqdisk-1.0.10-1.rpm
网络相关配置
- 网络配置中心跳网卡不要配置网关
# 添加网卡命令
nmcli connection add con-name en1 ifname p6p2 autoconnect yes ipv4.addresses 192.168.100.104/8 ipv4.gateway 192.168.10.254 ipv4.method manual type ethernet
nmcli connection add con-name en1 ifname p6p2 autoconnect yes ipv4.addresses 99.0.0.1/8 ipv4.method manual type ethernet
- SSH免密连接性配置
分别以 grid,oracle 用户身份登录后执行如下命令:
mkdir ~/.ssh
chmod 755 ~/.ssh
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa
# 所有RAC节点上执行
cat id_rsa.pub >> authorized_keys
cat id_dsa.pub >> authorized_keys
ssh grid@db19c2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh grid@db19c2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
chmod 600 authorized_keys
scp authorized_keys db19c2:~/.ssh
- 其他网络配置
vi /etc/sysconfig/network
NOZEROCONF=yes
内核相关配置
- 禁用transparent hugepages (THP)
cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never 【表示启用】
Append or change the "transparent_hugepage=never" kernel parameter on the GRUB_CMDLINE_LINUX option in /etc/default/grub file
cat /etc/default/grub
transparent_hugepage=never
[On BIOS-based machines: ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
[On UEFI-based machines: ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
系统相关服务禁用
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl disable avahi-daemon
systemctl stop avahi-daemon
mv /etc/chrony.conf /etc/chrony.conf.bak
chmod +x /etc/rc.d/rc.local # oel7 默认没有执行权限
VNC Server配置
yum -y install tigervnc tigervnc-server tigervnc-server-module
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
vi /etc/systemd/system/vncserver@\:1.service
43 ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
44 PIDFile=/root/.vnc/%H%i.pid
将第43、44行中的<USER>修改为root或者你想通过vnc登录的账号
[Service]
Type=simple
WorkingDirectory=/root
User=root
Group=root
systemctl daemon-reload
vncpasswd # 注意选择正确的用户
systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service
systemctl status vncserver@:1.service
默认端口号:5900
xhost + # 务必执行
ntp时间同步服务配置
- 如果没有/etc/ntp.conf文件,那么RAC将使用自带的ntp服务进行时间同步。
yum install ntp ntpdate -y
systemctl status ntpd
systemctl start ntpd
vi /etc/ntp.conf
# 注释 server 0,1,2,3
# 加入
server <NTP SERVER IP>
fuge <NTP SERVER IP> stratum 10
systemctl enable ntpd
systemctl start ntpd
# 查看是否同步
ntpq -p
# 客户端每小时同步一次ntp。
0 */1 * * * /usr/sbin/ntpdate db19c1
VMware 虚拟机相关配置
# 共享磁盘设置
## 在虚拟机目录中的xxx.vmx文件里添加
disk.EnableUUID = "TRUE"
disk.locking=false
# 配置了上面的参数后才能在宿主机中扫描到磁盘scsi id
/lib/udev/scsi_id -g -d /dev/sdb
RAC安装
注意scan名称要和主机hosts文件(如果使用dns来解析,要要跟dns记录一致)中一致。
注意,接口对应的网卡一定不能选错。
如上图,有一些警告可以忽略掉后即开始安装,安装完成时会有一些失败项,根据实际情况处理即可。