Oracle 18c单实例安装

1. 说明

Oracle 18c已经出来一段时间了,现在官网可以下载Client,但是还没有Database和Grid的下载链接。不过可以通过https://edelivery.oracle.com来下载
Oracle 18c单实例安装

2. 内存要求

Database:最少1G,推荐大小8G。
Grid:最少8G。–要求更高了
Oracle 18c单实例安装

3. 配置操作系统参数

任选其一操作即可

3.1. 通过Oracle的RPM包来配置操作系统

如果你的操作系统是Oracle Linux或者RedHat Linux,那么你可以通过Oracle RPM包来完成绝大部分的操作系统的配置。Oracle Linux5.2及以上版本有该RPM包。

RPM包干的事情:

	Automatically downloads and installs any additional RPM packages needed for installing Oracle Grid Infrastructure and Oracle Database, and resolves any dependencies
	Creates an oracle user, and creates the oraInventory (oinstall) and OSDBA (dba) groups for that user 
	As needed, sets sysctl.conf settings, system startup parameters, and driver parameters to values based on recommendations from the Oracle RDBMS Pre-Install program 
	Sets hard and soft resource limits
	Sets other recommended parameters, depending on your kernel version

–安装RPM包
# yum install oracle-database-server-18c-preinstall
注:官方还没放出18c的RPM包,不过可以使用12cR2的RPM。

3.2. 手动配置

3.2.1. 配置/etc/hosts

[[email protected] software]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain

192.168.1.178 18c

3.2.2. 添加用户和组

/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

3.2.3. 关闭防火墙/SELINUX

–关闭防火墙

[[email protected] software]# systemctl stop firewalld
[[email protected] software]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

–关闭SELINUX(需重启)

[[email protected] software]# vi /etc/selinux/config
[[email protected] software]# 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 three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

临时:

[[email protected] software]# setenforce 0
[[email protected] software]# getenforce 
Permissive

3.2.4. 创建目录

mkdir -p /u01/app/oracle/product/18.1.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

3.2.5. 配置ORACLE用户环境变量

ORACLE_SID=lei;export ORACLE_SID  
ORACLE_UNQNAME=zqlei;export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/18.1.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
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

3.2.6. 配置资源限制

–limit

[[email protected] ~]# vim /etc/security/limits.conf
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

–sysctl

[[email protected] ~]# vim /etc/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
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

3.2.7. 安装必要的包

yum install binutils gcc gcc-c++  compat-libstdc++-33 glibc  glibc.i686  glibc-devel  ksh libgcc.i686   libstdc++-devel  libaio  libaio.i686  libaio-devel  libaio-devel.i686  libXtst  libXtst.i686  libX11  libX11.i686 libXau  libXau.i686  libxcb  libxcb.i686  libXi  libXi.i686  make  sysstat  compat-libcap1 –y

compat-libstdc+±33这个包镜像里可能没有,需要单独下载
http://www.rpmfind.net/linux/centos/7.5.1804/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

4. 安装

和12c一样,直接解压到ORACLE_HOME下,然后运行runinstaller安装即可

4.1. 解压

[[email protected] software]$ unzip -d /u01/app/oracle/product/18.1.0/dbhome_1/ 
OracleDatabase18.0.0.0.0LinuxX86_64.zip

4.2. 运行Runinstaller

[[email protected] dbhome_1]$ ./runInstaller

Oracle 18c单实例安装
略…
Oracle 18c单实例安装

4.3. DBCA建库

和12c没有区别

注意: 由于当前限制只能在Exdata上安装,所以会报错ORA-12754
Oracle 18c单实例安装
解决方法:
解决Oracle 18c无法安装实例的方法–ORA-12754:
https://blog.csdn.net/qianglei6077/article/details/89011140

结束安装…

更多信息,请查看官方文档:
https://docs.oracle.com/en/database/oracle/oracle-database/18/ladbi/changes-in-this-release-for-oracle-database.html#GUID-4028441F-55CE-4B42-BB8A-2294BABC131B