そういうのがいいブログ

SIerで働く30代サラリーマンSEがインフラエンジニアに憧れてLinux・クラウド・AWSの勉強をするブログ

Oracle Linux9.6にOracle Database 23ai Freeをインストールする手順

※[PR]当ブログの記事の中にはプロモーションが含まれています。

Oracle Linux9.6にOracle Database 23ai Freeをインストールする方法を知りたい。
・具体的な手順を教えてほしい。

こういった疑問に答えます。

本記事の内容

  1. Oracle Linux9.6にOracle Database 23ai Freeをインストールする手順

サトナカ (@souiunogaii)

この記事を書いている私は、某SIerに勤務しながら、
WEB系エンジニア・インフラエンジニアに憧れて、プログラミングおよびインフラ技術の勉強をしています。

こういった私が、解説していきます。

私が実機で試したコマンドや画像を載せて書いています。
記事の信頼性担保に繋がると思います。

Oracle Linux9.6にOracle Database 23ai Freeをインストールする手順

参考ページ

www.oracle.com

rpmファイルのダウンロード

サーバー上に配置

[root@a-oracl01 ~]# ll /tmp/oracle*
-rw-r--r-- 1 root root 1412957372  92 21:22 /tmp/oracle-database-free-23ai-23.9-1.el9.x86_64.rpm

Oracle Database 23ai Freeのインストール

dnf install -y /tmp/oracle-database-free-23ai-23.9-1.el9.x86_64.rpm
[root@a-oracl01 ~]# dnf install -y /tmp/oracle-database-free-23ai-23.9-1.el9.x86_64.rpm
メタデータの期限切れの最終確認: 1:00:33 前の 20250902212633秒 に実施しました。
依存関係が解決しました。
====================================================================================================
 パッケージ                        Arch     バージョン                    リポジトリー        サイズ
====================================================================================================
インストール:
 oracle-database-free-23ai         x86_64   23.9-1                        @commandline        1.3 G
依存関係のインストール:
 compat-openssl11                  x86_64   1:1.1.1k-5.el9_6.1            ol9_appstream       1.5 M
 glibc-devel                       x86_64   2.34-168.0.1.el9_6.23         ol9_appstream        56 k
 glibc-headers                     x86_64   2.34-168.0.1.el9_6.23         ol9_appstream       915 k
 gssproxy                          x86_64   0.8.4-7.el9                   ol9_baseos_latest   120 k
 initscripts                       x86_64   10.11.8-4.0.1.el9             ol9_baseos_latest   285 k
 kernel-headers                    x86_64   5.14.0-570.37.1.0.1.el9_6     ol9_appstream       4.3 M
 ksh                               x86_64   3:1.0.6-7.0.1.el9_6.1         ol9_appstream       889 k
 libICE                            x86_64   1.0.10-8.el9                  ol9_appstream        71 k
 libSM                             x86_64   1.2.3-10.el9                  ol9_appstream        42 k
 libXmu                            x86_64   1.1.3-8.el9                   ol9_appstream        79 k
 libXt                             x86_64   1.2.0-6.el9                   ol9_appstream       180 k
 libXxf86dga                       x86_64   1.1.5-8.el9                   ol9_appstream        21 k
 libdmx                            x86_64   1.1.4-12.el9                  ol9_appstream        17 k
 libev                             x86_64   4.33-6.el9                    ol9_baseos_latest    56 k
 libnfsidmap                       x86_64   1:2.5.4-34.0.1.el9            ol9_baseos_latest    70 k
 libverto-libev                    x86_64   0.3.2-3.el9                   ol9_baseos_latest    14 k
 libxcrypt-devel                   x86_64   4.4.18-3.el9                  ol9_appstream        42 k
 make                              x86_64   1:4.3-8.el9                   ol9_baseos_latest   570 k
 nfs-utils                         x86_64   1:2.5.4-34.0.1.el9            ol9_baseos_latest   516 k
 oracle-database-preinstall-23ai   x86_64   1.0-3.el9                     ol9_appstream        35 k
 pcp-conf                          x86_64   6.3.7-1.0.2.el9_6             ol9_appstream        41 k
 pcp-libs                          x86_64   6.3.7-1.0.2.el9_6             ol9_appstream       654 k
 rpcbind                           x86_64   1.2.6-7.el9                   ol9_baseos_latest    69 k
 sssd-nfs-idmap                    x86_64   2.9.6-4.0.1.el9_6.2           ol9_baseos_latest    44 k
 sysstat                           x86_64   12.5.4-9.0.2.el9              ol9_appstream       541 k
 xorg-x11-utils                    x86_64   7.5-40.el9                    ol9_appstream       123 k
 xorg-x11-xauth                    x86_64   1:1.1-10.el9                  ol9_appstream        36 k

トランザクションの概要
====================================================================================================
インストール  28 パッケージ

合計サイズ: 1.3 G
ダウンロードサイズの合計: 11 M
インストール後のサイズ: 3.6 G
パッケージのダウンロード:
(1/27): gssproxy-0.8.4-7.el9.x86_64.rpm                             123 kB/s | 120 kB     00:00
(2/27): libev-4.33-6.el9.x86_64.rpm                                  57 kB/s |  56 kB     00:00
(3/27): libnfsidmap-2.5.4-34.0.1.el9.x86_64.rpm                     3.4 MB/s |  70 kB     00:00
(4/27): libverto-libev-0.3.2-3.el9.x86_64.rpm                       745 kB/s |  14 kB     00:00
(5/27): initscripts-10.11.8-4.0.1.el9.x86_64.rpm                    255 kB/s | 285 kB     00:01
(6/27): make-4.3-8.el9.x86_64.rpm                                   4.5 MB/s | 570 kB     00:00
(7/27): rpcbind-1.2.6-7.el9.x86_64.rpm                              3.2 MB/s |  69 kB     00:00
(8/27): sssd-nfs-idmap-2.9.6-4.0.1.el9_6.2.x86_64.rpm               2.2 MB/s |  44 kB     00:00
(9/27): nfs-utils-2.5.4-34.0.1.el9.x86_64.rpm                       3.3 MB/s | 516 kB     00:00
(10/27): glibc-devel-2.34-168.0.1.el9_6.23.x86_64.rpm               2.0 MB/s |  56 kB     00:00
(11/27): compat-openssl11-1.1.1k-5.el9_6.1.x86_64.rpm               4.7 MB/s | 1.5 MB     00:00
(12/27): glibc-headers-2.34-168.0.1.el9_6.23.x86_64.rpm             2.7 MB/s | 915 kB     00:00
(13/27): ksh-1.0.6-7.0.1.el9_6.1.x86_64.rpm                         5.1 MB/s | 889 kB     00:00
(14/27): libSM-1.2.3-10.el9.x86_64.rpm                              2.1 MB/s |  42 kB     00:00
(15/27): libXmu-1.1.3-8.el9.x86_64.rpm                              3.2 MB/s |  79 kB     00:00
(16/27): libXt-1.2.0-6.el9.x86_64.rpm                               4.2 MB/s | 180 kB     00:00
(17/27): libXxf86dga-1.1.5-8.el9.x86_64.rpm                         1.3 MB/s |  21 kB     00:00
(18/27): libdmx-1.1.4-12.el9.x86_64.rpm                             1.2 MB/s |  17 kB     00:00
(19/27): libxcrypt-devel-4.4.18-3.el9.x86_64.rpm                    2.1 MB/s |  42 kB     00:00
(20/27): libICE-1.0.10-8.el9.x86_64.rpm                             244 kB/s |  71 kB     00:00
(21/27): oracle-database-preinstall-23ai-1.0-3.el9.x86_64.rpm       1.4 MB/s |  35 kB     00:00
(22/27): pcp-conf-6.3.7-1.0.2.el9_6.x86_64.rpm                      1.5 MB/s |  41 kB     00:00
(23/27): pcp-libs-6.3.7-1.0.2.el9_6.x86_64.rpm                      2.8 MB/s | 654 kB     00:00
(24/27): sysstat-12.5.4-9.0.2.el9.x86_64.rpm                        2.4 MB/s | 541 kB     00:00
(25/27): xorg-x11-utils-7.5-40.el9.x86_64.rpm                       2.4 MB/s | 123 kB     00:00
(26/27): xorg-x11-xauth-1.1-10.el9.x86_64.rpm                       974 kB/s |  36 kB     00:00
(27/27): kernel-headers-5.14.0-570.37.1.0.1.el9_6.x86_64.rpm        4.4 MB/s | 4.3 MB     00:00
----------------------------------------------------------------------------------------------------
合計                                                                5.1 MB/s |  11 MB     00:02
トランザクションを確認しています
トランザクションの確認に成功しました。
トランザクションをテストしています
トランザクションのテストに成功しました。
トランザクションを実行しています
  準備中           :                                                                            1/1
  インストール中   : libICE-1.0.10-8.el9.x86_64                                                1/28
  インストール中   : libnfsidmap-1:2.5.4-34.0.1.el9.x86_64                                     2/28
  インストール中   : libSM-1.2.3-10.el9.x86_64                                                 3/28
  インストール中   : libXt-1.2.0-6.el9.x86_64                                                  4/28
  インストール中   : libXmu-1.1.3-8.el9.x86_64                                                 5/28
  インストール中   : xorg-x11-xauth-1:1.1-10.el9.x86_64                                        6/28
  インストール中   : pcp-conf-6.3.7-1.0.2.el9_6.x86_64                                         7/28
  インストール中   : pcp-libs-6.3.7-1.0.2.el9_6.x86_64                                         8/28
  インストール中   : sysstat-12.5.4-9.0.2.el9.x86_64                                           9/28
  scriptletの実行中: sysstat-12.5.4-9.0.2.el9.x86_64                                           9/28
Created symlink /etc/systemd/system/multi-user.target.wants/sysstat.service → /usr/lib/systemd/system/sysstat.service.
Created symlink /etc/systemd/system/sysstat.service.wants/sysstat-collect.timer → /usr/lib/systemd/system/sysstat-collect.timer.
Created symlink /etc/systemd/system/sysstat.service.wants/sysstat-summary.timer → /usr/lib/systemd/system/sysstat-summary.timer.

  インストール中   : libdmx-1.1.4-12.el9.x86_64                                               10/28
  インストール中   : libXxf86dga-1.1.5-8.el9.x86_64                                           11/28
  インストール中   : xorg-x11-utils-7.5-40.el9.x86_64                                         12/28
  インストール中   : ksh-3:1.0.6-7.0.1.el9_6.1.x86_64                                         13/28
  scriptletの実行中: ksh-3:1.0.6-7.0.1.el9_6.1.x86_64                                         13/28
  インストール中   : kernel-headers-5.14.0-570.37.1.0.1.el9_6.x86_64                          14/28
  インストール中   : glibc-headers-2.34-168.0.1.el9_6.23.x86_64                               15/28
  インストール中   : libxcrypt-devel-4.4.18-3.el9.x86_64                                      16/28
  インストール中   : glibc-devel-2.34-168.0.1.el9_6.23.x86_64                                 17/28
  インストール中   : compat-openssl11-1:1.1.1k-5.el9_6.1.x86_64                               18/28
  scriptletの実行中: rpcbind-1.2.6-7.el9.x86_64                                               19/28
  インストール中   : rpcbind-1.2.6-7.el9.x86_64                                               19/28
  scriptletの実行中: rpcbind-1.2.6-7.el9.x86_64                                               19/28
Created symlink /etc/systemd/system/multi-user.target.wants/rpcbind.service → /usr/lib/systemd/system/rpcbind.service.
Created symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket → /usr/lib/systemd/system/rpcbind.socket.

  インストール中   : make-1:4.3-8.el9.x86_64                                                  20/28
  インストール中   : libev-4.33-6.el9.x86_64                                                  21/28
  インストール中   : libverto-libev-0.3.2-3.el9.x86_64                                        22/28
  インストール中   : gssproxy-0.8.4-7.el9.x86_64                                              23/28
  scriptletの実行中: gssproxy-0.8.4-7.el9.x86_64                                              23/28
  scriptletの実行中: nfs-utils-1:2.5.4-34.0.1.el9.x86_64                                      24/28
  インストール中   : nfs-utils-1:2.5.4-34.0.1.el9.x86_64                                      24/28
  scriptletの実行中: nfs-utils-1:2.5.4-34.0.1.el9.x86_64                                      24/28
  インストール中   : initscripts-10.11.8-4.0.1.el9.x86_64                                     25/28
  scriptletの実行中: initscripts-10.11.8-4.0.1.el9.x86_64                                     25/28
Created symlink /etc/systemd/system/sysinit.target.wants/import-state.service → /usr/lib/systemd/system/import-state.service.
Created symlink /etc/systemd/system/sysinit.target.wants/loadmodules.service → /usr/lib/systemd/system/loadmodules.service.

  インストール中   : oracle-database-preinstall-23ai-1.0-3.el9.x86_64                         26/28
  scriptletの実行中: oracle-database-free-23ai-23.9-1.x86_64                                  27/28
  インストール中   : oracle-database-free-23ai-23.9-1.x86_64                                  27/28
  scriptletの実行中: oracle-database-free-23ai-23.9-1.x86_64                                  27/28
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database Free, optionally modify the parameters in '/etc/sysconfig/oracle-free-23ai.conf' and then run '/etc/init.d/oracle-free-23ai configure' as root.

  インストール中   : sssd-nfs-idmap-2.9.6-4.0.1.el9_6.2.x86_64                                28/28
  scriptletの実行中: oracle-database-preinstall-23ai-1.0-3.el9.x86_64                         28/28
  scriptletの実行中: sssd-nfs-idmap-2.9.6-4.0.1.el9_6.2.x86_64                                28/28
  検証中           : gssproxy-0.8.4-7.el9.x86_64                                               1/28
  検証中           : initscripts-10.11.8-4.0.1.el9.x86_64                                      2/28
  検証中           : libev-4.33-6.el9.x86_64                                                   3/28
  検証中           : libnfsidmap-1:2.5.4-34.0.1.el9.x86_64                                     4/28
  検証中           : libverto-libev-0.3.2-3.el9.x86_64                                         5/28
  検証中           : make-1:4.3-8.el9.x86_64                                                   6/28
  検証中           : nfs-utils-1:2.5.4-34.0.1.el9.x86_64                                       7/28
  検証中           : rpcbind-1.2.6-7.el9.x86_64                                                8/28
  検証中           : sssd-nfs-idmap-2.9.6-4.0.1.el9_6.2.x86_64                                 9/28
  検証中           : compat-openssl11-1:1.1.1k-5.el9_6.1.x86_64                               10/28
  検証中           : glibc-devel-2.34-168.0.1.el9_6.23.x86_64                                 11/28
  検証中           : glibc-headers-2.34-168.0.1.el9_6.23.x86_64                               12/28
  検証中           : kernel-headers-5.14.0-570.37.1.0.1.el9_6.x86_64                          13/28
  検証中           : ksh-3:1.0.6-7.0.1.el9_6.1.x86_64                                         14/28
  検証中           : libICE-1.0.10-8.el9.x86_64                                               15/28
  検証中           : libSM-1.2.3-10.el9.x86_64                                                16/28
  検証中           : libXmu-1.1.3-8.el9.x86_64                                                17/28
  検証中           : libXt-1.2.0-6.el9.x86_64                                                 18/28
  検証中           : libXxf86dga-1.1.5-8.el9.x86_64                                           19/28
  検証中           : libdmx-1.1.4-12.el9.x86_64                                               20/28
  検証中           : libxcrypt-devel-4.4.18-3.el9.x86_64                                      21/28
  検証中           : oracle-database-preinstall-23ai-1.0-3.el9.x86_64                         22/28
  検証中           : pcp-conf-6.3.7-1.0.2.el9_6.x86_64                                        23/28
  検証中           : pcp-libs-6.3.7-1.0.2.el9_6.x86_64                                        24/28
  検証中           : sysstat-12.5.4-9.0.2.el9.x86_64                                          25/28
  検証中           : xorg-x11-utils-7.5-40.el9.x86_64                                         26/28
  検証中           : xorg-x11-xauth-1:1.1-10.el9.x86_64                                       27/28
  検証中           : oracle-database-free-23ai-23.9-1.x86_64                                  28/28

インストール済み:
  compat-openssl11-1:1.1.1k-5.el9_6.1.x86_64        glibc-devel-2.34-168.0.1.el9_6.23.x86_64
  glibc-headers-2.34-168.0.1.el9_6.23.x86_64        gssproxy-0.8.4-7.el9.x86_64
  initscripts-10.11.8-4.0.1.el9.x86_64              kernel-headers-5.14.0-570.37.1.0.1.el9_6.x86_64
  ksh-3:1.0.6-7.0.1.el9_6.1.x86_64                  libICE-1.0.10-8.el9.x86_64
  libSM-1.2.3-10.el9.x86_64                         libXmu-1.1.3-8.el9.x86_64
  libXt-1.2.0-6.el9.x86_64                          libXxf86dga-1.1.5-8.el9.x86_64
  libdmx-1.1.4-12.el9.x86_64                        libev-4.33-6.el9.x86_64
  libnfsidmap-1:2.5.4-34.0.1.el9.x86_64             libverto-libev-0.3.2-3.el9.x86_64
  libxcrypt-devel-4.4.18-3.el9.x86_64               make-1:4.3-8.el9.x86_64
  nfs-utils-1:2.5.4-34.0.1.el9.x86_64               oracle-database-free-23ai-23.9-1.x86_64
  oracle-database-preinstall-23ai-1.0-3.el9.x86_64  pcp-conf-6.3.7-1.0.2.el9_6.x86_64
  pcp-libs-6.3.7-1.0.2.el9_6.x86_64                 rpcbind-1.2.6-7.el9.x86_64
  sssd-nfs-idmap-2.9.6-4.0.1.el9_6.2.x86_64         sysstat-12.5.4-9.0.2.el9.x86_64
  xorg-x11-utils-7.5-40.el9.x86_64                  xorg-x11-xauth-1:1.1-10.el9.x86_64

完了しました!

環境構築(SYS,SYSTEMユーザーのパスワード登録)

/etc/init.d/oracle-free-23ai configure
[root@a-oracl01 ~]# /etc/init.d/oracle-free-23ai 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.
SYSユーザー・パスワードを入力してください:
*************
SYSTEMユーザー・パスワードを入力してください:
***************
PDBADMINユーザー・パスワードを入力してください:
************
DB操作の準備
7%完了
データベース・ファイルのコピー中
29%完了
Oracleインスタンスの作成および起動中
30%完了
33%完了
36%完了
39%完了
43%完了
データベース作成の完了
47%完了
49%完了
50%完了
プラガブル・データベースの作成
54%完了
71%完了
構成後アクションの実行
93%完了
カスタム・スクリプトを実行中
100%完了
データベースの作成が完了しました。詳細は、次の場所にあるログ・ファイルを参照してください:
/opt/oracle/cfgtoollogs/dbca/FREE。
データベース情報:
グローバル・データベース名:FREE
システム識別子(SID):FREE
詳細はログ・ファイル"/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log"を参照してください。

Connect to Oracle Database using one of the connect strings:
     Pluggable database: a-oracl01/FREEPDB1
     Multitenant container database: a-oracl01

OSのoracleユーザーの確認

[root@a-oracl01 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
[root@a-oracl01 ~]# mkdir /home/oracle
[root@a-oracl01 ~]# chown oracle:oinstall /home/oracle

oracleユーザーに環境変数の追加

/home/oracle/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree
export ORACLE_SID=FREE
export NLS_LANG=Japanese_Japan.AL32UTF8
export PATH=$ORACLE_HOME/bin:$PATH

プロファイル反映

[oracle@a-oracl01 ~]$ source ~/.bash_profile

firewalldの設定

サービス定義ファイルの作成

/usr/lib/firewalld/services/oracle.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>Oracle</short>
  <description>Oralce Database TNS Lister</description>
  <port protocol="tcp" port="1521"/>
</service>

サービス追加

firewall-cmd --zone=home --add-service=oracle -permanent
firewall-cmd --reload

サービス起動と自動起動の設定

[root@a-oracl01 ~]# systemctl daemon-reload
[root@a-oracl01 ~]# systemctl start oracle-free-23ai
[root@a-oracl01 ~]# systemctl status oracle-free-23ai
● oracle-free-23ai.service - SYSV: This script is responsible for taking care of configuring the RP>
     Loaded: loaded (/etc/rc.d/init.d/oracle-free-23ai; generated)
     Active: active (exited) since Tue 2025-09-02 23:17:18 JST; 3s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 12412 ExecStart=/etc/rc.d/init.d/oracle-free-23ai start (code=exited, status=0/SUCCESS)
        CPU: 20ms

 902 23:17:17 a-oracl01 systemd[1]: Starting SYSV: This script is responsible for taking care of>
 902 23:17:18 a-oracl01 oracle-free-23ai[12412]: The Oracle Database instance FREE is already st>
 902 23:17:18 a-oracl01 systemd[1]: Started SYSV: This script is responsible for taking care of >
[root@a-oracl01 ~]# systemctl enable oracle-free-23ai
oracle-free-23ai.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable oracle-free-23ai
[root@a-oracl01 ~]# systemctl is-enabled oracle-free-23ai
oracle-free-23ai.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install is-enabled oracle-free-23ai
enabled

SQL*Plusで接続

[oracle@a-oracl01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 23.0.0.0.0 - Production on92 22:55:22 2025
Version 23.9.0.25.07

Copyright (c) 1982, 2025, Oracle.  All rights reserved.



Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.9.0.25.07
に接続されました。

インスタンス名の確認

SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                        string      FREE
SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 FREEPDB1                       READ WRITE NO

切断

SQL> exit
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.9.0.25.07との接続が切断されました。