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

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

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

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

RHEL 7.6 安装oracle database 19c on ASM Part5: 网络服务配置

 

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 部署规划

系统安装调整
 

[root@node2 oracle]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/root-root00   20G  4.7G   16G  24% /
devtmpfs                 9.8G     0  9.8G   0% /dev
tmpfs                    9.8G     0  9.8G   0% /dev/shm
tmpfs                    9.8G  9.5M  9.8G   1% /run
tmpfs                    9.8G     0  9.8G   0% /sys/fs/cgroup
/dev/sda1                197M  155M   42M  79% /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       45G  5.6G   40G  13% /app
/dev/sr0                 4.2G  4.2G     0 100% /mnt

app:软件安装目录

安装目录规划

#GI path
ORACLE_BASE=/app/grid
ORACLE_HOME=/app/grid/product/19.2.0/crs
 
mkdir -p /app/grid/product/19.2.0/crs

#ORACLE path
ORACLE_BASE=/app/oracle
ORACLE_HOME=/app/oracle/product/19.2.0/dbhome_1
 
mkdir -p /app/oracle/product/19.2.0/dbhome_1

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

4 安装前准备

4.1 安装19c最低硬件要求

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第1张图片

建议不小于2GB的RAM

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

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第2张图片

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

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第3张图片

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

4.2 验证硬件信息

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第4张图片

RAM:20GB

SWAP:20GB

kernel:3.10.0-957.el7.x86_64

shm:10GB

4.3 系统安装包检查

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第5张图片

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

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

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第6张图片

安装软件包

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@node ~]$ more ~/.bash_profile
# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi
 
# User specific environment and startup programs
 
PATH=$PATH:$HOME/.local/bin:$HOME/bin
 
export PATH
 
 
ORACLE_SID=+ASM;export ORACLE_SID  
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/app/grid; export ORACLE_BASE
ORACLE_HOME=/app/grid/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'
 
--- oracle 环境变量配置
 
[oracle@node ~]$ more .bash_profile
# .bash_profile
 
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi
 
# User specific environment and startup programs
 
PATH=$PATH:$HOME/.local/bin:$HOME/bin
 
export PATH
 
 
ORACLE_SID=nineteenc;export ORACLE_SID  
ORACLE_UNQNAME=nineteenc;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'

4.5 系统参数配置

配置linux内核参数

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

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第7张图片

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

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第8张图片

设置 grid、oracle 用户的 Shell 限制

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 3145728
 
oracle 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

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第9张图片

设置PAM

session required pam_limits.so

RHEL 7.6 安装oracle database 19c on ASM Part1: 基础环境配置_第10张图片

5 共享存储规划

配置ASM磁盘

#查看磁盘UUID
/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

#udev绑定
vi /etc/udev/rules.d/99-my-asmdevices.rules
 
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c291a55c35c1ca97421e85172b6c", RUN +="/bin/sh -c 'mknod /dev/asmdisk01 b  $major $minor; chown grid:oinstall /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=="36000c29599c5c59b687188d3b082c319", RUN +="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:oinstall /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=="36000c291a6a94fa3d0ec3e7646b31aa3", RUN +="/bin/sh -c 'mknod /dev/asmdisk03 b  $major $minor; chown grid:oinstall /dev/asmdisk03; chmod 0660 /dev/asmdisk03'"

 
/sbin/udevadm trigger --type=devices --action=change

查看磁盘状态

ls -rtl /dev/asm*

至此基础环境配置完成

你可能感兴趣的:(Oracle,19c)