2022年11月22日火曜日

Oracle APEXの環境作成(4) - データベースのインストール

更新: 2026年1月27日

Oracle Linuxで構成された仮想マシンに、Oracle AI Database 26ai Freeをインストールします。

FAQを確認すると、使用できるリソースの制限は以下のようです。

What are the resource limits for Oracle Database Free

Oracle Database Free supports up to:

  • 2 CPUs for foreground processes
  • 2GB of RAM (SGA and PGA combined)
  • 12GB of user data on disk (irrespective of compression factor)

用途の制限も特に無いようです。

Can I use Oracle Database Free in production?

Oracle Database Free does not restrict the environment in which it can be deployed. However, Oracle Database Free is not supported and does not receive any patches, including security patches. Oracle recommends running production deployments on fully supported Oracle Database editions or cloud services.

今までOracle Database 21c Express Edition (XE)やOracle Database 23ai Freeを使っていた用途であれば、Oracle AI Database 26ai Freeを代わりに使用できます。

インストール手順はGet Startedのセクションに記載されています。


事前構成パッケージのインストール



仮想マシンにユーザーrootでログインします。

ssh -p 10022 root@localhost

~ % ssh -p 10022 root@localhost


root@localhost's password: 

Last login: Tue Jan 27 12:19:21 2026 from 10.0.2.2

[root@localhost ~]# 


Get Startedのx86_64の手順ではOracle Linuxであれば事前インストール・パッケージが不要に見えますが、実際は必要でした。直接RPMファイルを指定してインストールします。

Oracle Database FreeのGet Startedのページを開き、事前インストール・パッケージのRPMへのリンクのアドレスをコピーします。

ARM 64-bitOracle Linux 8 for Arm(aarch64)のセクションを参照します。


x86_64Red Hat Enterprise Linux(EL9)のセクションを参照します。


リンクを直接指定して、事前インストール・パッケージをインストールします。

2026年1月27日の時点で実行したコマンドです。

ARM 64-bit: dnf -y install https://yum.oracle.com/repo/OracleLinux/OL8/appstream/aarch64/getPackage/oracle-ai-database-preinstall-26ai-1.0-1.el8.aarch64.rpm
x86_64: dnf -y install https://yum.oracle.com/repo/OracleLinux/OL9/appstream/x86_64/getPackage/oracle-ai-database-preinstall-26ai-1.0-1.el9.x86_64.rpm

以下はARM 64-bitでの実行例です。

[root@localhost ~]# dnf -y install https://yum.oracle.com/repo/OracleLinux/OL8/appstream/aarch64/getPackage/oracle-ai-database-preinstall-26ai-1.0-1.el8.aarch64.rpm

Failed to set locale, defaulting to C.UTF-8

Last metadata expiration check: 0:51:57 ago on Tue Jan 27 12:22:25 2026.

oracle-ai-database-preinstall-26ai-1.0-1.el8.aa 5.5 kB/s |  29 kB     00:05    

Dependencies resolved.

================================================================================

 Package              Arch    Version                   Repository         Size

================================================================================

Installing:

 oracle-ai-database-preinstall-26ai

                      aarch64 1.0-1.el8                 @commandline       29 k

Installing dependencies:

 bc                   aarch64 1.07.1-5.el8              ol8_baseos_latest 127 k

 bind-libs            aarch64 32:9.11.36-16.el8_10.6    ol8_appstream     171 k

 bind-libs-lite       aarch64 32:9.11.36-16.el8_10.6    ol8_appstream     1.1 M

 bind-license         noarch  32:9.11.36-16.el8_10.6    ol8_appstream     105 k

 bind-utils           aarch64 32:9.11.36-16.el8_10.6    ol8_appstream     445 k

 binutils             aarch64 2.30-128.0.1.el8_10       ol8_baseos_latest 6.1 M

 checkpolicy          aarch64 2.9-1.el8                 ol8_baseos_latest 331 k

 compat-openssl10     aarch64 1:1.0.2o-4.el8_10.1       ol8_appstream     893 k

 cpp                  aarch64 8.5.0-28.0.1.el8_10       ol8_appstream     9.0 M


[中略]


  quota-nls-1:4.04-14.el8.noarch                                                

  rpcbind-1.2.5-10.el8.aarch64                                                  

  smartmontools-1:7.1-3.el8.aarch64                                             

  sysstat-11.7.3-13.0.2.el8_10.aarch64                                          

  tar-2:1.30-11.el8_10.aarch64                                                  

  unzip-6.0-48.0.1.el8_10.aarch64                                               

  xorg-x11-utils-7.5-28.el8.aarch64                                             

  xorg-x11-xauth-1:1.0.9-12.el8.aarch64                                         


Complete!

[root@localhost ~]# 


以上で、事前インストール・パッケージのインストールは完了です。


データベースのインストールと構成



Oracle Database FreeのGet Startedのページを開き、Oracle AI Database 26ai FreeのRPMへのリンクのアドレスをコピーします。

ARM 64-bitOracle Linux 8 for Arm(aarch64)のセクションを参照します。


x86_64Red Hat Enterprise Linux(EL9)のセクションを参照します。


curlコマンドを実行し、RPMをダウンロードします。

2026年1月27日の時点で実行したコマンドです。

ARM 64-bit: curl -OL https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm
x86_64: curl -OL https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el9.x86_64.rpm

以下はARM 64-bitでの実行例です。

[root@localhost ~]# curl -OL https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0

100   527  100   527    0     0     47      0  0:00:11  0:00:11 --:--:--   114

100 1246M  100 1246M    0     0  6202k      0  0:03:25  0:03:25 --:--:-- 8531k

[root@localhost ~]#


ダウンロードしたRPMをインストールします。

2026年1月27日の時点で実行したコマンドです。

ARM 64-bit: dnf -y install oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm
x86_64: dnf -y install oracle-ai-database-free-26ai-23.26.0-1.el9.x86_64.rpm

以下はARM 64-bitでの実行例です。

[root@localhost ~]# curl -OL https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0

100   527  100   527    0     0     47      0  0:00:11  0:00:11 --:--:--   114

100 1246M  100 1246M    0     0  6202k      0  0:03:25  0:03:25 --:--:-- 8531k

[root@localhost ~]# dnf -y install oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm

Failed to set locale, defaulting to C.UTF-8

Last metadata expiration check: 1:11:19 ago on Tue Jan 27 12:22:25 2026.

Dependencies resolved.

================================================================================

 Package                         Arch       Version       Repository       Size

================================================================================

Installing:

 oracle-ai-database-free-26ai    aarch64    23.26.0-1     @commandline    1.2 G


Transaction Summary

================================================================================

Install  1 Package


Total size: 1.2 G

Installed size: 3.1 G

Downloading Packages:

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                        1/1 

  Running scriptlet: oracle-ai-database-free-26ai-23.26.0-1.aarch64         1/1 

  Installing       : oracle-ai-database-free-26ai-23.26.0-1.aarch64         1/1 

  Running scriptlet: oracle-ai-database-free-26ai-23.26.0-1.aarch64         1/1 

[INFO] Executing post installation scripts...

[INFO] Oracle home installed successfully and ready to be configured.

To configure Oracle AI Database Free, optionally modify the parameters in '/etc/sysconfig/oracle-free-26ai.conf' and then run '/etc/init.d/oracle-free-26ai configure' as root.


  Verifying        : oracle-ai-database-free-26ai-23.26.0-1.aarch64         1/1 


Installed:

  oracle-ai-database-free-26ai-23.26.0-1.aarch64                                


Complete!

[root@localhost ~]# 


データーベース・インスタンスを作成します。

oracle-free-26ai configureを実行して、SYSSYSTEMおよびPDBADMINのパスワードとなる文字列を2回入力します。

/etc/init.d/oracle-free-26ai configure

マルチテナント構成のデータベース・インスタンスが作成されます。SIDFREE、作成されるPDBFREEPDB1です。SIDやPDBの名前を変更する場合は、/etc/init.d/oracle-free-26aiに記述されている定義を、あらかじめ変更しておきます。

[root@localhost ~]# /etc/init.d/oracle-free-26ai 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 AI 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 AI Database using one of the connect strings:

     Pluggable database: localhost.localdomain/FREEPDB1

     Multitenant container database: localhost.localdomain

[root@localhost ~]# 


構成が完了したら、データベースへの接続を確認します。

接続先としてlocalhost/FREEPDB1を指定します。

. oraenv
ORACLE_SID = [root] ? FREE
sqlplus system/パスワード@localhost/freepdb1
select banner_full from v$version;
exit

[root@localhost ~]# . oraenv

ORACLE_SID = [root] ? FREE

The Oracle base has been set to /opt/oracle

[root@localhost ~]# sqlplus system/********@localhost/freepdb1


SQL*Plus: Release 23.26.0.0.0 - Production on Tue Jan 27 13:41:56 2026

Version 23.26.0.0.0


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


Last Successful login time: Tue Jan 27 2026 13:37:38 +09:00


Connected to:

Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free

Version 23.26.0.0.0


SQL> select banner_full from v$version;


BANNER_FULL

--------------------------------------------------------------------------------

Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for F

ree

Version 23.26.0.0.0



SQL> exit

Disconnected from Oracle AI Database 26ai Free Release 23.26.0.0.0 - Develop, Learn, and Run for Free

Version 23.26.0.0.0

[root@localhost ~]# 


接続先のデータベースのバージョンが23.26であることを確認します。

最後にデータベースの自動起動を有効にします。

systemctl enable oracle-free-26ai

[root@localhost ~]# systemctl enable oracle-free-26ai

oracle-free-26ai.service is not a native service, redirecting to systemd-sysv-install.

Executing: /usr/lib/systemd/systemd-sysv-install enable oracle-free-26ai

[root@localhost ~]# 


ダウンロードしたRPMファイルを削除します。

ARM 64-bit: rm oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm
x86_64: rm oracle-ai-database-free-26ai-23.26.0-1.el9.x86_64.rpm

以下はARM 64-bitでの実行例です。

[root@localhost ~]# rm oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm

rm: remove regular file 'oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm'? yes

[root@localhost ~]# 


以上でOracle AI Database 26ai Freeのインストールは完了です。

続く