18C单实例安装
Oracle 18c 单实例安装手册
1. 安装前准备工作
1.1. 系统要求
Linux下Oracle数据库安装的最低服务器配置要求:
系统要求 说明
内存 DB: 至少少1G,建议大小8G。
Grid:至少8G。
临时空间 /tmp目录中至少有1 GB的空间
Swap空间 1 GB~2 GB:内存的1.5倍
2 GB~16 GB:与内存相同
超过16 GB:16 GB
注意:如果为Linux服务器启用HugePages,则应在计算交换空间之前从可用内存中扣除分配给HugePages的内存。
Oracle软件的最小本地磁盘存储空间 对于Linux x86-64:
对于独立服务器安装,Oracle Grid Infrastructure至少为6.8 GB。
Oracle数据库企业版至少7.5 GB。
Oracle Database Standard Edition 2至少为7.5 GB。
1.2. 检查和配置Oracle数据库的服务器硬件
1)检查物理内存大小:
[[email protected] ~]# grep MemTotal /proc/meminfo
MemTotal: 3882124 kB
2)检查交换空间的大小:
[[email protected] ~]# grep SwapTotal /proc/meminfo
SwapTotal: 4194300 kB
3)检查/tmp目录大小:
[[email protected] ~]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel_host1-root 46G 22G 25G 47% /
如果/ tmp目录中的可用空间小于所需的可用空间,请完成以下步骤之一:
1) 从/tmp目录中删除不需要的文件以满足磁盘空间要求。
2) 设置Oracle用户的环境时,还要将TMP和TMPDIR环境变量设置为要使用的目录而不是/tmp。
4)检查系统上的可用内存和磁盘交换空大小:
[[email protected] ~]# free
total used free shared buff/cache available
Mem: 3882124 1249092 307064 1217640 2325968 1141792
Swap: 4194300 33592 4160708
5)确定系统架构:
[[email protected] ~]# uname -m
x86_64
验证处理器架构是否与要安装的Oracle软件版本匹配。如果没有看到预期的输出,则无法在此系统上安装该软件
6)配置/etc/hosts
[[email protected] dbhome_1]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.233.19.36 weblogic-test weblogic-test
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
8)Centos 7.*的镜像文件中没有compat-libstdc包,需要手动安装
[[email protected] ~]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
warning: compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
9)配置Linux的系统参数
1) 配置Linux的内核参数
[[email protected] ~]#vi /etc/sysctl.conf
kernel.shmmni = 4096
fs.file-max= 6815744
kernel.sem = 250 32000 100 142
kernel.msgmni = 2878
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 12556052480
kernel.shmmni = 4096
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
shmall大于或等于shmmax的值,以页为单位。shmmax物理内存大小的一半(以字节为单位)
用root用户执行sysctl -p 使修改生效
2) 设置 Oracle 用户的 Shell 限制
[[email protected] ~]# vi /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
3) 设置PAM
确保加载了最新版本的 PAM,然后在 /etc/pam.d/login 文件中添加或编辑以下行:
[[email protected] ~]# vi /etc/pam.d/login
添加以下内容
session required pam_limits.so
4) 关闭防火墙/SELINUX
--关闭防火墙
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
--关闭SELINUX
[[email protected] ~]# vi /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
10)创建用户和组
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
11)创建目录
mkdir -p /oracle/app18c/product/18.3/dbhome_1
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle
12)设置环境变量
切换到oracle用户下 编辑.bash_profile文件添加以下内容:
export ORACLE_BASE=/oracle/app18c
export ORACLE_HOME=$ORACLE_BASE/product/18.3/dbhome_1
export ORACLE_SID=bjdbtest
export PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
13)使设置的环境变量生效
[[email protected] ~]$ source .bash_profile
14)安装数据库软件
注意:将安装文件解压到Oracle Home下,Oracle 解压的安装文件必须在Oracle Home下。
因为仅从Oracle home运行runInstaller命令。不要从任何其他位置运行runInstaller。
[[email protected] ~]# chown oracle:oinstall LINUX.X64_180000_db_home.zip
[[email protected] dbhome_1]$cd $ORACLE_HOME
[[email protected] dbhome_1]$ ./runInstaller
正在启动 Oracle 数据库安装向导...
1、仅安装Oracle软件
2 、单实例安装
3、安装企业版
4、数据库基目录(一般环境变量设置好默认即可)
5、选择已授权的操作系统用户组
6、数据库预检查,调整内核参数大小,调整SWAP空间
7、开始安装
8、安装产品
9、弹出窗口,使用root执行脚本(正常应该是两个脚本)
10、跑完脚本后即完成软件安装
15)、打补丁(PSU)
1、补丁工具检查 (符合补丁升级工具最低要求)
[[email protected] OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.14
OPatch succeeded.
2、加压补丁安装包,进入补丁目录,开始升级
[[email protected] ~]$ cd 28822489/
[[email protected] 28822489]$ $ORACLE_HOME/OPatch/opatch apply
Oracle 中间补丁程序安装程序版本 12.2.0.1.14
版权所有 (c) 2019, Oracle Corporation。保留所有权利。
Oracle Home : /oracle/app18c/product/18.3/dbhome_1
Central Inventory : /oracle/oraInventory
from : /oracle/app18c/product/18.3/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.14
OUI version : 12.2.0.4.0
Log file location : /oracle/app18c/product/18.3/dbhome_1/cfgtoollogs/opatch/opatch2019-01-28_13-52-28下午_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 28822489
是否继续? [y|n]
y
User Responded with: Y
All checks passed.
请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/oracle/app18c/product/18.3/dbhome_1')
本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '28822489' to OH '/oracle/app18c/product/18.3/dbhome_1'
ApplySession: Oracle 主目录中不存在可选组件 [ oracle.assistants.asm, 18.0.0.0.0 ] , [ oracle.net.cman, 18.0.0.0.0 ] , [ oracle.ons.daemon, 18.0.0.0.0 ] , [ oracle.tfa, 18.0.0.0.0 ] , [ oracle.crs, 18.0.0.0.0 ] , [ oracle.network.cman, 18.0.0.0.0 ] , [ oracle.assistants.usm, 18.0.0.0.0 ] , [ oracle.assistants.server.oui, 18.0.0.0.0 ] , [ oracle.has.crs, 18.0.0.0.0 ] , 或找到更高版本。
正在为组件 oracle.oracore.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms, 18.0.0.0.0 打补丁...
正在为组件 oracle.dbjava.jdbc, 18.0.0.0.0 打补丁...
正在为组件 oracle.dbjava.ic, 18.0.0.0.0 打补丁...
正在为组件 oracle.network.listener, 18.0.0.0.0 打补丁...
正在为组件 oracle.assistants.acf, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.rsf.ic, 18.0.0.0.0 打补丁...
正在为组件 oracle.server, 18.0.0.0.0 打补丁...
正在为组件 oracle.ctx, 18.0.0.0.0 打补丁...
正在为组件 oracle.ons, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.deconfig, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.util, 18.0.0.0.0 打补丁...
正在为组件 oracle.sdo.locator.jrf, 18.0.0.0.0 打补丁...
正在为组件 oracle.xdk.parser.java, 18.0.0.0.0 打补丁...
正在为组件 oracle.assistants.server, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.crs, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.rman, 18.0.0.0.0 打补丁...
正在为组件 oracle.xdk, 18.0.0.0.0 打补丁...
正在为组件 oracle.ctx.atg, 18.0.0.0.0 打补丁...
正在为组件 oracle.dbjava.ucp, 18.0.0.0.0 打补丁...
正在为组件 oracle.install.deinstalltool, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.dbscripts, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.xdk.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.network.client, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.install.plugins, 18.0.0.0.0 打补丁...
正在为组件 oracle.sdo, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.oci, 18.0.0.0.0 打补丁...
正在为组件 oracle.ctx.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.oraolap.dbscripts, 18.0.0.0.0 打补丁...
正在为组件 oracle.assistants.deconfig, 18.0.0.0.0 打补丁...
正在为组件 oracle.nlsrtl.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.precomp.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.network.rsf, 18.0.0.0.0 打补丁...
正在为组件 oracle.sqlplus.ic, 18.0.0.0.0 打补丁...
正在为组件 oracle.sdo.locator, 18.0.0.0.0 打补丁...
正在为组件 oracle.nlsrtl.rsf.core, 18.0.0.0.0 打补丁...
正在为组件 oracle.sqlplus, 18.0.0.0.0 打补丁...
正在为组件 oracle.javavm.client, 18.0.0.0.0 打补丁...
正在为组件 oracle.ldap.owm, 18.0.0.0.0 打补丁...
正在为组件 oracle.ldap.security.osdt, 18.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.install.common, 18.0.0.0.0 打补丁...
正在为组件 oracle.precomp.lang, 18.0.0.0.0 打补丁...
正在为组件 oracle.precomp.common, 18.0.0.0.0 打补丁...
Patch 28822489 successfully applied.
Sub-set patch [28090523] has become inactive due to the application of a super-set patch [28822489].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /oracle/app18c/product/18.3/dbhome_1/cfgtoollogs/opatch/opatch2019-01-28_13-52-28下午_1.log
OPatch succeeded.
16)配置监听(一直下一步即可)
[[email protected] OPatch]$ netca
Oracle Net Services 配置:
17)dbca建库
1、创建数据库
2、高级配置
3、单实例,一般用途即可
4、输入数据库实例名称,容器数据库看个人是否需要
5、数据库文件存储路径
6、开启闪回去
7、选择监听程序
8、默认下一步,有需要的可以研究一下
9、参数配置
10、配置EM
11、设置管理员密码
12、创建数据库
13、点击完成,就是慢慢等待
至此数据库18.3单实例安装完成。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30327022/viewspace-2564693/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30327022/viewspace-2564693/