简单介绍一下安装步骤
vi /etc/hosts
192.168.20.20 19c
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/useradd -u 54321 -g oinstall -G dba,oper oracle
修改用户密码:
[root@19c ~]# passwd oracle
防火墙:
[root@rac1 ~]# systemctl stop firewalld.service
[root@rac1 ~]# ]# systemctl disable firewalld.service
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
rm '/etc/systemd/system/dbus-org.Fedoraproject.FirewallD1.service'
SELINUX:
[root@rac1 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
也可以临时关闭setenforce 0
mkdir -p /u01/app/oracle/product/19.2.0/db_1
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/
[root@19c ~]# cat /home/oracle/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_SID=sanshi;export ORACLE_SID
ORACLE_UNQNAME=sanshi;export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.2.0/dbhome_1; export ORACLE_HOME
NLS_DATE_FORMAT="YYYY:MM:DDHH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
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=/tmp
export TMPDIR=/tmp
umask 022
[root@19c ~]# vim /etc/sysctl.d/97-oracle-database-sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
生效
[root@19c ~]#sysctl --system
查看某个参数的值
sysctl -a|grep shmmax
关于上面的参数介绍,下面是官方文档的详细介绍:
参数 | 值 | 文件 |
---|---|---|
semmsl semmns semopm semmni |
250 32000 100 128 |
/proc/sys/kernel/sem |
shmall | 大于或等于shmmax的值,以页为单位。 | /proc/sys/kernel/shmall |
shmmax | 等于一般的物理内存大小,单位:字节 详细信息请查看MOS文档:567506.1 |
/proc/sys/kernel/shmmax |
shmmni | 4096 | /proc/sys/kernel/shmmni |
panic_on_oops | 1 | /proc/sys/kernel/panic_on_oops |
file-max | 6815744 | /proc/sys/fs/file-max |
aio-max-nr | 1048576 注意:此值限制并发未完成的请求,应设置为避免I / O子系统故障。 |
/proc/sys/fs/aio-max-nr |
ip_local_port_range | 最小:9000 最大:65500 |
/proc/sys/net/ipv4/ip_local_port_range |
rmem_default | 262144 | /proc/sys/net/core/rmem_default |
rmem_max | 4194304 | /proc/sys/net/core/rmem_max |
wmem_default | 262144 | /proc/sys/net/core/wmem_default |
wmem_max | 1048576 | /proc/sys/net/core/wmem_max |
注:/etc/sysctl.conf已经废弃了,虽然还支持,但是不推荐。
下面是官方文档列出的需要的包,当然不是所有都需要。如果没有使用到相关技术,不需要相应的包。
bc
binutils
compat-libcap1
compat-libstdc++
dtrace-modules
dtrace-modules-headers
dtrace-modules-provider-headers
dtrace-utils
elfutils-libelf
elfutils-libelf-devel
fontconfig-devel
glibc
glibc-devel
ksh
libaio
libaio-devel
libdtrace-ctf-devel
libX11
libXau
libXi
libXtst
libXrender
libXrender-devel
libgcc
librdmacm-devel
libstdc++
libstdc++-devel
libxcb
make
net-tools (for Oracle RAC and Oracle Clusterware)
nfs-utils (for Oracle ACFS)
python (for Oracle ACFS Remote)
python-configshell (for Oracle ACFS Remote)
python-rtslib (for Oracle ACFS Remote)
python-six (for Oracle ACFS Remote)
targetcli (for Oracle ACFS Remote)
smartmontools
sysstat
安装
yum install bc \
gcc \
gcc-c++ \
binutils \
compat-libcap1 \
compat-libstdc++ \
dtrace-modules \
dtrace-modules-headers \
dtrace-modules-provider-headers \
dtrace-utils \
elfutils-libelf \
elfutils-libelf-devel \
fontconfig-devel \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libdtrace-ctf-devel \
libX11 \
libXau \
libXi \
libXtst \
libXrender \
libXrender-devel \
libgcc \
librdmacm-devel \
libstdc++ \
libstdc++-devel \
libxcb \
make \
smartmontools \
sysstat
注:由于从7开始,系统镜像中不再包含compat-libstdc++包,需要自行下载安装。
当然如果你不使用Oracle Text功能,则不需要安装该包。但是推荐安装,因为你无法保证以后不使用。
解压安装包:
[oracle@19c software]$ unzip V981623-01.zip -d /u01/app/oracle/product/19.2.0/db_1/
注:由于从12.2开始,安装包变化了,实际上整个安装包就是整个ORACLE_HOME。所以直接解压到ORACLE_HOME下即可。
安装
[oracle@19c db_1]$ ./runInstaller