暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

Oracle Database 23c 在 Oracle Linux 8 (OL8) 上的免费 RPM 安装

原创 小小亮 2023-04-14
1342

可以使用 RPM 在 Oracle Linux 8 上安装 Oracle 23c 免费开发人员版本。本文介绍了 Oracle Database 23c free 64-bit 在 Oracle Linux 8 (OL8) 64 位上的 RPM 安装。本文基于具有最少 2G 交换空间且安全 Linux 设置为宽松的服务器安装。可以在此处(https://oracle-base.com/articles/linux/oracle-linux-8-installation) 查看此类 Linux 安装的示例

  • 主机文件
  • Oracle 23c安装
  • 创建数据库
  • 使用它
  • 思考
  • Vagrant Example

主机文件

“/etc/hosts”文件必须包含服务器的完全限定名称。

<IP-address>  <fully-qualified-machine-name>  <machine-name>

例如。

127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.56.107  ol8-23.localdomain  ol8-23

在“/etc/hostname”文件中设置正确的主机名。

ol8-23.localdomain

Oracle 23c安装

从此处(https://www.oracle.com/database/technologies/free-downloads.html)的下载页面下载相关的 RPM 

  • oracle-database-free-23c-1.0-1.el8.x86_64.rpm

下载 RPM 文件后,我们可以以“root”用户身份使用以下命令安装 Oracle 先决条件。

dnf install -y oraclelinux-developer-release-el8
dnf install -y oracle-database-preinstall-23c

我们现在以 root 用户身份使用以下命令安装 23c 软件。这假定 RPM 文件位于“/tmp”目录中。

dnf -y localinstall /tmp/oracle-database-free-23c-1.0-1.el8.x86_64.rpm

ORACLE_HOME软件安装是“/opt/oracle/product/23c/dbhomeFree” 

创建数据库


除了软件安装之外,RPM 还创建了一个脚本,允许我们创建一个名为“FREE”的演示数据库,以及一个名为“FREEPDB1”的可插拔数据库 (PDB)。在以下示例中,我们设置了DB_PASSWORD环境变量,以便我们可以使用脚本进行静默数据库创建。

# export DB_PASSWORD=SysPassword1

# (echo "${DB_PASSWORD}"; echo "${DB_PASSWORD}";) | /etc/init.d/oracle-free-23c configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password:
*************
Enter SYSTEM user password:
**************
Enter PDBADMIN User Password:
************
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
33% complete
36% complete
39% complete
43% complete
Completing Database Creation
47% complete
49% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/FREE.
Database Information:
Global Database Name:FREE
System Identifier(SID):FREE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: localhost.localdomain/FREEPDB1
     Multitenant container database: localhost.localdomain
[root@localhost yum.repos.d]#

我们当然可以使用数据库配置助手 (DBCA) 以正常方式创建数据库。我们不必使用此脚本。

使用它

我们可以从“oracle”用户进行如下连接。

export ORACLE_HOME=/opt/oracle/product/23c/dbhomeFree
export PATH=$ORACLE_HOME/bin:$PATH

-- Root container
sqlplus sys/SysPassword1@//localhost:1521/free as sysdba

-- Pluggable database
sqlplus sys/SysPassword1@//localhost:1521/freepdb1 as sysdba

我们可以使用以下命令从 root 用户停止和启动服务。

/etc/init.d/oracle-free-23c stop
/etc/init.d/oracle-free-23c start

思考

下面是关于这种安装方法的一些想法。

  • 该机制专为 Oracle 数据库软件的纯软件安装而设计。它不是使 Oracle 运行的单个命令。因此,感觉它并不比定期静默安装数据库软件特别简单,但经验较少的人可能不同意。
  • RPM 只能用于安装软件,不能更新软件。这是一个“一次性”解决方案。
  • 我们无法控制软件安装本身。如果您有用于安装的公司标准,那么这不是适合您的解决方案。请记住,ORACLE_HOME软件安装目录是“/opt/oracle/product/23c/dbhomeFree”。
  • 即使订阅了 ULN,您也不太可能希望在每次安装时都下载该软件。您需要创建一个本地 Yum 存储库来托管它。
  • 这是一个有趣的练习,但目前我不会考虑将这种方法用于除演示之外的任何其他用途。

Vagrant Example

如果你想看到它的实际效果,你可能想尝试其中一个 Vagrant 构建。

  • ol8_23_free(https://github.com/oraclebase/vagrant/tree/master/database/ol8_23_free


有关详细信息,请参阅:

  • 免费安装 Oracle 数据库:https://docs.oracle.com/en/database/oracle/oracle-database/23/xeinl/installing-oracle-database-free.html#GUID-728E4F0A-DBD1-43B1-9837-C6A460432733
  • 在 Linux 上自动启动和关闭数据库:https://oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux
  • Oracle 通用安装 (OUI) 静默安装:https://oracle-base.com/articles/misc/oui-silent-installations
  • 数据库配置助手 (DBCA):在静默模式下创建数据库:https://oracle-base.com/articles/misc/database-configuration-assistant-dbca-silent-mode


原文标题:ORACLE-BASE - Oracle Database 23c Free RPM Installation On Oracle Linux 8 (OL8)

原文链接:https://oracle-base.com/articles/23c/oracle-db-23c-free-rpm-installation-on-oracle-linux-8

最后修改时间:2023-04-14 11:53:23
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论