CentOS 8 系统安装 Oracle 19c 数据库
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><img width="600" height="500" class="aligncenter wp-image-4049 size-full" style="border: 0 currentColor; border-image: none; height: auto; clear: both; margin-right: auto; margin-bottom: 30px; margin-left: auto; display: block; max-width: 100%; box-sizing: inherit" alt="" src="https://www.rultr.com/wp-content/uploads/2020/05/oracle-19c-and-rultr-logo.jpg" data-pagespeed-url-hash="434119772" sizes="(max-width: 600px) 100vw, 600px" srcset="https://www.rultr.com/wp-content/uploads/2020/05/oracle-19c-and-rultr-logo.jpg 600w, https://www.rultr.com/wp-content/uploads/2020/05/oracle-19c-and-rultr-logo-300x250.jpg 300w" loading="lazy"></p><hr style="border: 0 currentColor; border-image: none; height: 1px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; margin-top: 8px; margin-bottom: 24px; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: content-box; orphans: 2; widows: 2; background-color: rgba(204, 204, 204, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial">
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><span style="box-sizing: inherit"><font style="font-size: 19.5pt">Oracle Database
19c</font></span><span><font style="font-size: 12pt"> </font></span><font style="font-size: 12pt">是 Oracle 公司发布的最新版多模式数据库管理系统,可以用于 OLTP(联机事务处理)和
DW(数据仓库)以及混合模式(OLTP+DW)数据工作流。虽然 Oracle Database 19c 是非自由软件,但是它可以从 Oracle
的官方网站免费下载并使用。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">Oracle Database 19c
还可以从一些云服务商提供的云产品中免费获得预安装版本。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">本文将详细讲解如何在 CentOS 8 系统静默安装 Oracle Database 19c
并创建一个多租户数据库服务器。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">1]
系统环境说明</font></strong></p>
<ul style="margin: 0 0 8px; padding: 0 0 0 20px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial">
<li style="box-sizing: inherit"><font style="font-size: 12pt">操作系统:CentOS
8.1</font></li>
<li style="box-sizing: inherit"><font style="font-size: 12pt">主机名:oracle-db-19c</font></li>
<li style="box-sizing: inherit"><font style="font-size: 12pt">IP
地址:172.16.200.1</font></li></ul>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">2]
更新操作系统</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">在安装和配置服务器前,将 Linux
操作系统的软件包更新到最新是一个良好的习惯,这不仅可以降低软件兼容性风险,还可以有效提升系统稳定性。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">对于 CentOS 8 系统,可以使用如下命令进行系统更新:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># dnf update -y</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">3]
配置本地主机解析</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">在安装 Oracle Database 19c 之前,需要为主机名配置好主机解析。主机解析可以通过 DNS
服务器完成,当然,如果没有 DNS 服务器,修改本地”/etc/hosts”文件也可以达到同样效果:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># echo "172.16.200.1 oracle-db-19c" >> /etc/hosts</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">4] 禁用 CentOS 8 系统
Transparent HugePages</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">Oracle 官方推荐禁用系统 Transparent
HugePages(透明大页)功能,因为该功能可能会导致 Oracle RAC 群集访问内存时节点重启以及单实例节点主机性能存在问题。于是,Oracle
官方推荐 Linux 系统采用 Standard HugePages(标准大页)。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">而在 Red Hat 的 Linux 发行版中,透明大页自 EL 6.0 后会默认启用。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">使用如下命令来判断 CentOS 8 系统是否启用了透明大页:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># cat /sys/kernel/mm/transparent_hugepage/enabled</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><img width="700" height="100" class="aligncenter wp-image-4052 size-full" style="border: 0 currentColor; border-image: none; height: auto; clear: both; margin-right: auto; margin-bottom: 30px; margin-left: auto; display: block; max-width: 100%; box-sizing: inherit" alt="" src="https://www.rultr.com/wp-content/uploads/2020/05/hugepages-status-in-centos.jpg" data-pagespeed-url-hash="459323159" sizes="(max-width: 700px) 100vw, 700px" srcset="https://www.rultr.com/wp-content/uploads/2020/05/hugepages-status-in-centos.jpg 700w, https://www.rultr.com/wp-content/uploads/2020/05/hugepages-status-in-centos-300x43.jpg 300w" loading="lazy"></p>
<h5 align="center" style="margin: 0 0 10px; padding: 0; width: auto; text-transform: none; line-height: 1.3; text-indent: 0; letter-spacing: normal; clear: both; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><span style="box-sizing: inherit"><font style="font-size: 13.5pt">图.1 查看 CentOS 系统
Transparent HugePages 状态</font></span></h5>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">如图.1 所示,透明大页启用状态为””,表示系统启用了该功能。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">禁用此功能的话,需要修改 GRUB 配置项,添加禁用透明大页的启动项参数。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">修改”/etc/default/grub”文件,修改内容如下:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">GRUB_CMDLINE_LINUX="resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet transparent_hugepage=never"</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">配置文件修改完成后,使用如下命令重新生成 GRUB 配置并重启主机让配置生效:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># grub2-mkconfig -o /boot/grub2/grub.cfg
# systemctl reboot</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">主机重新启动成功后,再次使用之前的命令查看透明大页状态,如果显示为””,则表示透明大页功能已经关闭。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><img width="700" height="100" class="aligncenter wp-image-4053 size-full" style="border: 0 currentColor; border-image: none; height: auto; clear: both; margin-right: auto; margin-bottom: 30px; margin-left: auto; display: block; max-width: 100%; box-sizing: inherit" alt="" src="https://www.rultr.com/wp-content/uploads/2020/05/disable-hugepages-in-centos8.jpg" data-pagespeed-url-hash="2907167951" sizes="(max-width: 700px) 100vw, 700px" srcset="https://www.rultr.com/wp-content/uploads/2020/05/disable-hugepages-in-centos8.jpg 700w, https://www.rultr.com/wp-content/uploads/2020/05/disable-hugepages-in-centos8-300x43.jpg 300w" loading="lazy"></p>
<h5 align="center" style="margin: 0 0 10px; padding: 0; width: auto; text-transform: none; line-height: 1.3; text-indent: 0; letter-spacing: normal; clear: both; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><span style="box-sizing: inherit"><font style="font-size: 13.5pt">图.2 CentOS
系统成功禁用透明大页</font></span></h5>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">5] 安装 Oracle
Database 19c CentOS 8 系统依赖包</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">由于数据库服务器采用静默方式安装,为避免出错,在安装数据库之前,需要把 Oracle
程序依赖包安装至系统。依赖包同样采用 dnf 方式安装:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">dnf install -y bc \
binutils \
elfutils-libelf \
elfutils-libelf-devel \
fontconfig-devel \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libXrender \
libXrender-devel \
libX11 \
libXau \
libXi \
libXtst \
libgcc \
librdmacm-devel \
libstdc++ \
libstdc++-devel \
libxcb \
make \
net-tools \
smartmontools \
sysstat \
unzip \
libnsl \
libnsl2</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">6] 创建 Oracle 19c
使用的用户和属组</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">用以下命令创建 Oracle 19c 需要使用的用户及属组:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># groupadd -g 6001 oinstall
# groupadd -g 6002 dba
# groupadd -g 6003 oper
# groupadd -g 6004 backupdba
# groupadd -g 6005 dgdba
# groupadd -g 6006 kmdba
# groupadd -g 6007 racdba
# useradd -u 6001 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle
# echo "oracle" | passwd oracle --stdin</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">此时,就创建了一个用户 oracle,并设置其密码为”oracle”。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">7] 设置 Oracle
用户的安全权限</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">在”/etc/security/limits.d”目录中创建一个 oracle
用户的权限文件”30-oracle.conf”,文件内容如下:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">8] 调整 CentOS
8系统参数</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">根据 Oracle 19c 的要求,创建 Oracle
参数文件”/etc/sysctl.d/98-oracle.conf”,内容如下:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">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</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">文件创建成功后,使用如下命令让配置立即生效:</font></p>
<div class="quads-location quads-ad2" id="quads-ad2" style="margin: 0; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; float: none; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"></amp-auto-ads></div>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># sysctl -p</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">9] 配置 SELinux
以及放行防火墙端口</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">使用如下命令将 SELinux 设置为”permissive”模式,并放行 Oracle 侦听的 1521
端口:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/sysconfig/selinux
# setenforce permissive
# firewall-cmd --permanent --add-port=1521/tcp
# firewall-cmd --reload</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">10] 创建 Oracle 19c
的工作目录以及数据库目录</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">为了成功安装 Oracle 数据库,需要创建如下目录并更改目录属主权限:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
# mkdir -p /u02/oradata
# chown -R oracle:oinstall /u01 /u02
# chmod -R 775 /u01 /u02</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">我们这里创建了两个目录,其中”/u01″用于存放数据库管理系统软件,而”/u02″用于存放数据库文件。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">11] 配置 Oracle
用户环境变量</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">切换到 oracle 用户,变修改该用户的环境变量文件”.bash_profile”:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># su - oracle
# vi .bash_profile</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">环境变量内容如下:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt"># Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=oracle-db-19c
export ORACLE_UNQNAME=oradb
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=oradb
export PDB_NAME=pdb
export DATA_DIR=/u02/oradata
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">注意环境变量的设置已经包含了 Oracle
数据库的各种基本参数设置,包括”ORACLE_BASE”和”ORACLE_HOME”等,这些设置与之前创建的目录相对应,并且设置了”ORACLE_SID”为”oradb”。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">环境变量设置完成后,使用如下命令让配置生效:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">$ source ~/.bash_profile</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">12] 静默安装 Oracle
Database 19c 数据库管理系统</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">首先从 Oracle 官方网站下载 Oracle Database 19c 的 Linux
版压缩包,下载虽然是免费的,但是需要一个 Oracle 用户帐号,反正注册起来也不麻烦,不妨注册一个,一直有用。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">现在, 我们已经将压缩包下载,并放置在 oracle 用户的家目录,然后解压缩安装包:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">$ unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">Oracle Database 19c 的安装工具对于识别 CentOS 8
系统存在一些问题,但是我们可以通过设置环境变量加以解决:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">$ export CV_ASSUME_DISTID=RHEL8.0</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">最后,进入”ORACLE_HOME”目录进入静默安装:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">$ cd $ORACLE_HOME
$ ./runInstaller -ignorePrereq -waitforcompletion -silent \
oracle.install.option=INSTALL_DB_SWONLY \
ORACLE_HOSTNAME=${ORACLE_HOSTNAME} \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=${ORA_INVENTORY} \
ORACLE_HOME=${ORACLE_HOME} \
ORACLE_BASE=${ORACLE_BASE} \
oracle.install.db.InstallEdition=EE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSBACKUPDBA_GROUP=backupdba \
oracle.install.db.OSDGDBA_GROUP=dgdba \
oracle.install.db.OSKMDBA_GROUP=kmdba \
oracle.install.db.OSRACDBA_GROUP=racdba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">命令执行完之后,就进入漫长的等待,直到出现如下提示:</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><img width="700" height="335" class="aligncenter wp-image-4057 size-full" style="border: 0 currentColor; border-image: none; height: auto; clear: both; margin-right: auto; margin-bottom: 30px; margin-left: auto; display: block; max-width: 100%; box-sizing: inherit" alt="" src="https://www.rultr.com/wp-content/uploads/2020/05/install-oracle-19c-in-silent-mode.jpg" data-pagespeed-url-hash="2985464038" sizes="(max-width: 700px) 100vw, 700px" srcset="https://www.rultr.com/wp-content/uploads/2020/05/install-oracle-19c-in-silent-mode.jpg 700w, https://www.rultr.com/wp-content/uploads/2020/05/install-oracle-19c-in-silent-mode-300x144.jpg 300w" loading="lazy"></p>
<h5 align="center" style="margin: 0 0 10px; padding: 0; width: auto; text-transform: none; line-height: 1.3; text-indent: 0; letter-spacing: normal; clear: both; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><span style="box-sizing: inherit"><font style="font-size: 13.5pt">图.3 静默安装 Oracle
19c 数据库</font></span></h5>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">事实上静默安装同可视化安装达到的效果一致,熟悉响应文件或是安装器的同学可以尝试。看到安装成功的信息后,就根据提示内容切换到
root 用户执行两个初始化脚本,生成数据字典:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">$ su -
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/19.3.0/dbhome_1/root.sh</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><strong style="box-sizing: inherit"><font style="font-size: 12pt">13] 使用 dbca
工具静默创建数据库</font></strong></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">创建数据库前首先启动侦听,以便数据库自动注册:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">$ lsnrctl start</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">之后,就使用如下命令通过 dbca 工具静默创建数据库:</font></p>
<pre style="background: rgba(238, 238, 238, 1); padding: 23px; border-radius: 5px; border: 1px solid rgba(255, 0, 0, 1); border-image: none; text-transform: none; line-height: 1.6; text-indent: 0; letter-spacing: normal; overflow: auto; margin-top: 14px; margin-bottom: 23px; word-spacing: 0; -ms-word-break: normal; max-width: 100%; box-sizing: inherit; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 11.2pt">dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname ${ORACLE_SID} -sid${ORACLE_SID} \
-responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword 1qazXSW@ \
-systemPassword 1qazXSW@ \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName ${PDB_NAME} \
-pdbAdminPassword 1qazXSW@ \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-totalMemory 800 \
-storageType FS \
-datafileDestination "${DATA_DIR}" \
-redoLogFileSize 50 \
-emConfiguration NONE \
-ignorePreReqs</font></pre>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">之后同样是漫长的等待,命令的意思就是指定创建数据库的各种选项,可以与可视化安装时的各个步骤相对应。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">数据库创建成功后,会看到如下信息:</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><img width="700" height="400" class="aligncenter wp-image-4059 size-full" style="border: 0 currentColor; border-image: none; height: auto; clear: both; margin-right: auto; margin-bottom: 30px; margin-left: auto; display: block; max-width: 100%; box-sizing: inherit" alt="" src="https://www.rultr.com/wp-content/uploads/2020/05/create-datebase-in-19c-in-silent-mode.jpg" data-pagespeed-url-hash="1022968440" sizes="(max-width: 700px) 100vw, 700px" srcset="https://www.rultr.com/wp-content/uploads/2020/05/create-datebase-in-19c-in-silent-mode.jpg 700w, https://www.rultr.com/wp-content/uploads/2020/05/create-datebase-in-19c-in-silent-mode-300x171.jpg 300w" loading="lazy"></p>
<h5 align="center" style="margin: 0 0 10px; padding: 0; width: auto; text-transform: none; line-height: 1.3; text-indent: 0; letter-spacing: normal; clear: both; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><span style="box-sizing: inherit"><font style="font-size: 13.5pt">图.4
静默方式创建数据库</font></span></h5>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">至此,一个名为”oradb”的数据库就创建完成了。</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">登录到数据库,查看数据库实例状态,并查看一下侦听状态,确保数据库服务器可用:</font></p>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><img width="700" height="800" class="aligncenter wp-image-4060 size-full" style="border: 0 currentColor; border-image: none; height: auto; clear: both; margin-right: auto; margin-bottom: 30px; margin-left: auto; display: block; max-width: 100%; box-sizing: inherit" alt="" src="https://www.rultr.com/wp-content/uploads/2020/05/verify-oracel-19c-server-status.jpg" data-pagespeed-url-hash="915560349" sizes="(max-width: 700px) 100vw, 700px" srcset="https://www.rultr.com/wp-content/uploads/2020/05/verify-oracel-19c-server-status.jpg 700w, https://www.rultr.com/wp-content/uploads/2020/05/verify-oracel-19c-server-status-263x300.jpg 263w" loading="lazy"></p>
<h5 align="center" style="margin: 0 0 10px; padding: 0; width: auto; text-transform: none; line-height: 1.3; text-indent: 0; letter-spacing: normal; clear: both; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><span style="box-sizing: inherit"><font style="font-size: 13.5pt">图.5
查看数据库服务器及侦听状态</font></span></h5>
<p style="margin: 0 0 15px; text-transform: none; line-height: normal; text-indent: 0; letter-spacing: normal; word-spacing: 0; white-space: normal; -ms-word-break: normal; box-sizing: inherit; orphans: 2; widows: 2; background-color: rgba(255, 255, 255, 1); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><font style="font-size: 12pt">以上就是关于CentOS 8 系统安装 Oracle 19c 数据库的全部内容。</font></p>
</div>
<div id="MySignature" role="contentinfo">
为人:谦逊、激情、博学、审问、慎思、明辨、 笃行 <br>
学问:纸上得来终觉浅,绝知此事要躬行 <br>
为事:工欲善其事,必先利其器。 <br>
态度:道阻且长,行则将至;行而不辍,未来可期<br>
..................................................................... <br>
------- 桃之夭夭,灼灼其华。之子于归,宜其室家。 --------------- <br>
------- 桃之夭夭,有蕡其实。之子于归,宜其家室。 --------------- <br>
------- 桃之夭夭,其叶蓁蓁。之子于归,宜其家人。 --------------- <br>
=====================================================================<br>
* 博客文章部分截图及内容来自于学习的书本及相应培训课程以及网络其他博客,仅做学习讨论之用,不做商业用途。<br>
* 如有侵权,马上联系我,我立马删除对应链接。 * @author Alan -liu * @Email no008@foxmail.com<br>
转载请标注出处! ✧*꧁一品堂.技术学习笔记꧂*✧. --->https://www.cnblogs.com/ios9/ <br><br><br>
来源:https://www.cnblogs.com/ios9/p/15441211.html
頁:
[1]