当前位置: 代码迷 >> 综合 >> RHEL 7.6 安装oracle database 19c dataguard on ASM Part1: 基础环境配置
  详细解决方案

RHEL 7.6 安装oracle database 19c dataguard on ASM Part1: 基础环境配置

热度:69   发布时间:2024-01-12 23:32:57.0

RHEL 7.6 安装oracle database 19c dataguard on ASM Part2: Grid Infrastructure配置

RHEL 7.6 安装oracle database 19c dataguard on ASM Part3: ASM磁盘组配置

RHEL 7.6 安装oracle database 19c dataguard on ASM Part4: Database配置

RHEL 7.6 安装oracle database 19c dataguard on ASM Part5: Dataguard配置

 

1 硬件信息

cpu:4core

memory:20G

storage:200G

2 软件环境

2.1 操作系统

rhel-server-7.6-x86_64-dvd

Red Hat Enterprise Linux Server release 7.6 (Maipo)

2.2 软件版本

2.2.1 oracle软件

 V981623-01.zip

2.2.2 GI软件

V981627-01.zip

3 部署规划

系统安装调整

---节点node2(primary)[root@node2 ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/root-root00   20G  4.8G   16G  24% /
devtmpfs                 9.8G     0  9.8G   0% /dev
tmpfs                    9.8G  637M  9.2G   7% /dev/shm
tmpfs                    9.8G   18M  9.8G   1% /run
tmpfs                    9.8G     0  9.8G   0% /sys/fs/cgroup
/dev/sda1                197M  155M   42M  79% /boot
/dev/mapper/ora-app       45G   20G   26G  43% /app
tmpfs                    2.0G   12K  2.0G   1% /run/user/42
tmpfs                    2.0G     0  2.0G   0% /run/user/0---节点node2dg(physical standby)[root@node2dg ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/root-root   20G  4.7G   16G  24% /
devtmpfs               9.8G     0  9.8G   0% /dev
tmpfs                  9.9G     0  9.9G   0% /dev/shm
tmpfs                  9.9G  9.5M  9.8G   1% /run
tmpfs                  9.9G     0  9.9G   0% /sys/fs/cgroup
/dev/sda1              197M  142M   55M  73% /boot
tmpfs                  2.0G   12K  2.0G   1% /run/user/42
tmpfs                  2.0G     0  2.0G   0% /run/user/0
/dev/mapper/ora-app     40G   33M   40G   1% /app

app:软件安装目录

安装目录规划

---GI pathORACLE_BASE=/app/grid
ORACLE_HOME=/app/product/19.2.0/crsmkdir -p /app/grid
mkdir -p /app/product/19.2.0/crs
mkdir -p /app/oraInventory---ORACLE pathORACLE_BASE=/app/oracle
ORACLE_HOME=/app/oracle/product/19.2.0/dbhome_1mkdir -p /app/oracle/product/19.2.0/dbhome_1

注:需提前创建好全路径,否则安装软件时检测不到路径。软件会安装在gridSetup所在路径。

配置网络环境

10.6.0.139      node2
10.6.0.137      node2dg

chmod 644 /etc/sysconfig/network

echo "NOZEROCONF = yes" >> /etc/sysconfig/network

4 安装前准备

4.1 安装19c最低硬件要求

建议不小于2GB的RAM

建议至少1024x768的显示分辨率,从而确保OUI显示正确

建议SWAP:RAM在2.5GB~16GB之间SWAP设置为相同的大小的RAM,RAM大于16GB时SWAP设置为16GB

建议至少留给OracleBase7.5GB空间

4.2 验证硬件信息

RAM:20GB

SWAP:20GB

kernel:3.10.0-957.el7.x86_64

shm:10GB

4.3 系统安装包检查

使用下面命令检查软件包是否安装

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libX11 \
libXau \
libXi \
libXtst \
libXrender-devel \
libXrender \
libgcc \
libstdc++ \
libstdc++-devel \
libxcb \
make \
nfs-utils \
net-tools \
python \
python-configshell \
python-rtslib \
python-six \
smartmontools \
sysstat \
targetcli

安装软件包

yum install bc binutils compat-libcap1 compat-libstdc++-33 glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender-devel libXrender libgcc libstdc++  libstdc++-devel libxcb make nfs-utils net-tools python python-configshell8 python-rtslib python-six  smartmontools sysstat targetcli libgcc_s.so.1 libc.so.6

RedHat7.*的镜像文件中没有compat-libstdc包,需要手动安装

compat-libstdc++-33-3.2.3-72.el7.i686.rpm

compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

4.4 确认用户及相应权限设置

/usr/sbin/groupadd -g 54321 asmadmin
/usr/sbin/groupadd -g 54322 asmdba
/usr/sbin/groupadd -g 54323 asmoper
/usr/sbin/groupadd -g 54324 dba
/usr/sbin/groupadd -g 54325 oper
/usr/sbin/groupadd -g 54326 oinstall
/usr/sbin/groupadd -g 54327 backupdba
/usr/sbin/groupadd -g 54328 dgdba
/usr/sbin/groupadd -g 54329 kmdba
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
/usr/sbin/useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,dba grid

配置环境变量

--- grid 环境变量配置[grid@rac1 ~]$ more ~/.bash_profile
# .bash_profile# Get the aliases and functions
if [ -f ~/.bashrc ]; then. ~/.bashrc
fi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATHORACLE_SID=+ASM;export ORACLE_SID  
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/app/grid; export ORACLE_BASE
ORACLE_HOME=/app/product/19.2.0/crs; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT
#NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
export NLS_LANG=AMERICAN_AMERICA.UTF8
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/app/tmp
export TMPDIR=/app/tmp
umask 022
export DISPLAY=10.6.0.243:0.0
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'--- oracle 环境变量配置[oracle@rac1 ~]$ more .bash_profile
# .bash_profile# Get the aliases and functions
if [ -f ~/.bashrc ]; then. ~/.bashrc
fi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATHORACLE_SID=nodetwodg;export ORACLE_SID  
ORACLE_UNQNAME=nodetwodg;export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=/app/oracle/product/19.2.0/dbhome_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT
#NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
export NLS_LANG=AMERICAN_AMERICA.UTF8
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/app/tmp
export TMPDIR=/app/tmp
umask 022
export DISPLAY=10.6.0.243:0.0
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'

注:两个节点都需要配置ORACLE_SID。nineteenc、node2dg

4.5 系统参数配置

配置linux内核参数

vi /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
#kernel.shmmax = 4294967295
kernel.shmall = 4294967296
kernel.shmmax = 12640516096
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 = 1048576

shmall大于或等于shmmax的值,以页为单位。shmmax物理内存大小的一半(以字节为单位) 
用root用户执行sysctl -p 使修改生效。

设置 grid、oracle 用户的 Shell 限制

vi /etc/security/limits.conf 

grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft memlock 3145728
grid hard memlock 3145728oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 3145728
oracle hard memlock 3145728

设置PAM

vi /etc/pam.d/login

session required pam_limits.so

4.6 系统时间校对

--检验时间和时区确认正确
date --关闭chrony服务,移除chrony配置文件(后续使用ctss)
systemctl list-unit-files|grep chronyd
systemctl status chronydsystemctl disable chronyd
systemctl stop chronyd--备份chrony配置文件
mv /etc/chrony.conf /etc/chrony.conf_bak

这里实验环境,选择不使用NTP和chrony,这样Oracle会自动使用自己的ctss服务。确保两节点时间一致

4.7 禁用avahi-daemon服务

--查看服务状态
systemctl status avahi-daemon--停止服务
systemctl stop avahi-daemon--禁止服务自启动
systemctl disable avahi-daemon

5 共享存储规划

配置ASM磁盘

/usr/lib/udev/scsi_id -g -u /dev/sdc
/usr/lib/udev/scsi_id -g -u /dev/sdd
/usr/lib/udev/scsi_id -g -u /dev/sde
/usr/lib/udev/scsi_id -g -u /dev/sdf

#udev绑定
vi /etc/udev/rules.d/99-my-asmdevices.rulesKERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c291ca220c52c813c595ffdf14f4", RUN +="/bin/sh -c 'mknod /dev/asmdisk01 b  $major $minor; chown grid:asmadmin /dev/asmdisk01; chmod 0660 /dev/asmdisk01'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c29d82b62077ca6ced88065bfc1f", RUN +="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c29a2d05c23b4ca757912c0bc9ca", RUN +="/bin/sh -c 'mknod /dev/asmdisk03 b  $major $minor; chown grid:asmadmin /dev/asmdisk03; chmod 0660 /dev/asmdisk03'"KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c296d86677032ffcc5b372c28a98", RUN +="/bin/sh -c 'mknod /dev/asmdisk04 b  $major $minor; chown grid:asmadmin /dev/asmdisk04; chmod 0660 /dev/asmdisk04'"/sbin/udevadm trigger --type=devices --action=change

查看磁盘状态

至此基础环境配置完成

  相关解决方案