2025年4月25日金曜日

Rocky Linux 9にOracle APEXの環境を構築する

以前に、Oracle Cloudのコンピュート・インスタンス上にOracle APEXの環境を構築する手順を紹介しました。こちらの記事「Oracle Cloudのコンピュート・インスタンス上でOracle APEXの環境を構築する」です。

この記事ではコンピュート・インスタンスのOSとしてOracle Linux 9を選択していますが、Oracle Cloud以外ではあまりOracle Linuxのインスタンスを作成できるクラウドはありません。

そのため、OSにRocky Linux 9を選択してコンピュート・インスタンスを作成し、Oracle APEXの環境を構築してみます。ほとんどの手順は同じですが、コンピュート・インスタンスの作成後にRocky Linux 9上で実行したコマンドについては、すべて記述します。

Oracle Cloudのコンソール上の操作については差分のみを紹介します。

コンピュート・インスタンスを作成する際のイメージの選択で、Rocky Linuxを選択します。イメージ・ビルドRocky Linux 9.5 (x86_64) 20250124です。


イメージの選択にはパートナー・イメージに関する合意をチェックする必要があります。


シェイプVM.Standard.E5.FlexOCPU数2メモリ12GBとしました。

以下より作成したコンピュート・インスタンスにsshで接続し、Oracle APEXの環境を作成します。

コンピュート・インスタンスのイメージにRocky Linuxを選択して場合、接続ユーザーはopcの代わりにrockyが作成されます。

ssh -i ssh-key-YYYY-MM-DD.key rocky@[パブリックIPアドレス]

% ssh -i ssh-key-2025-04-24.key rocky@***.***.***.***

The authenticity of host '***.***.***.*** (***.***.***.***)' can't be established.

ED25519 key fingerprint is SHA256:0JQCkQ61o57tWWx/NtDmnXDIBZ9vXqkYhwvn0A8e/Gk.

This key is not known by any other names.

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Warning: Permanently added '***.***.***.***' (ED25519) to the list of known hosts.

[rocky@rockyapex ~]$ 


インスタンスにサインインしたら、最初にOSを最新までアップデートします。

sudo dnf -y update

[rocky@rockyapex ~]$ sudo dnf -y update

epel                                               16 MB/s |  23 MB     00:01    

Rocky Linux 9 - SIG Cloud Common                  128 kB/s | 295 kB     00:02    

Extra Packages for Enterprise Linux 9 openh264 (F 3.0 kB/s | 2.5 kB     00:00    

oraclelinux-addons                                8.0 MB/s | 673 kB     00:00    

Rocky Linux 9 - BaseOS                            1.2 MB/s | 2.3 MB     00:01    

Rocky Linux 9 - AppStream                         2.3 MB/s | 8.4 MB     00:03    

Rocky Linux 9 - Extras                             18 kB/s |  16 kB     00:00    

Dependencies resolved.

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

 Package                 Arch    Version                         Repository  Size

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

Installing:

 kernel                  x86_64  5.14.0-503.38.1.el9_5           baseos     2.0 M

 kernel-core             x86_64  5.14.0-503.38.1.el9_5           baseos      18 M

 kernel-modules          x86_64  5.14.0-503.38.1.el9_5           baseos      36 M

 kernel-modules-core     x86_64  5.14.0-503.38.1.el9_5           baseos      30 M

Upgrading:

 NetworkManager          x86_64  1:1.48.10-8.el9_5               baseos     2.3 M

 NetworkManager-libnm    x86_64  1:1.48.10-8.el9_5               baseos     1.8 M

 NetworkManager-team     x86_64  1:1.48.10-8.el9_5               baseos      38 k

 NetworkManager-tui      x86_64  1:1.48.10-8.el9_5               baseos     246 k

 bzip2-libs              x86_64  1.0.8-10.el9_5                  baseos      39 k


[中略]


Installed:

  freetype-2.10.4-10.el9_5.x86_64                                                 

  graphite2-1.3.14-9.el9.x86_64                                                   

  grub2-tools-efi-1:2.06-94.el9_5.x86_64                                          

  grub2-tools-extra-1:2.06-94.el9_5.x86_64                                        

  harfbuzz-2.7.4-10.el9.x86_64                                                    

  kernel-5.14.0-503.38.1.el9_5.x86_64                                             

  kernel-core-5.14.0-503.38.1.el9_5.x86_64                                        

  kernel-modules-5.14.0-503.38.1.el9_5.x86_64                                     

  kernel-modules-core-5.14.0-503.38.1.el9_5.x86_64                                


Complete!

[rocky@rockyapex ~]$ 


podmanを含むコンテナを実行するツールcontainer-toolsをインストールします。また、unzipもインストールします。

sudo dnf -y install container-tools unzip

[rocky@rockyapex ~]$ sudo dnf -y install container-tools unzip

Last metadata expiration check: 0:02:44 ago on Fri Apr 25 02:35:37 2025.

Dependencies resolved.

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

 Package                     Arch   Version                     Repo       Size

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

Installing:

 container-tools             noarch 1-14.el9                    appstream 7.6 k

 unzip                       x86_64 6.0-58.el9_5                baseos    180 k

Installing dependencies:

 aardvark-dns                x86_64 2:1.12.2-1.el9_5            appstream 1.0 M

 buildah                     x86_64 2:1.37.6-1.el9_5            appstream  11 M

 cockpit-podman              noarch 93.1-1.el9_5                appstream 552 k

 conmon                      x86_64 3:2.1.12-1.el9              appstream  51 k

 container-selinux           noarch 3:2.232.1-1.el9             appstream  55 k

 containernetworking-plugins x86_64 1:1.5.1-3.el9_5             appstream 9.8 M


[中略]


  subscription-manager-rhsm-certificates-20220623-1.el9.noarch                  

  toolbox-0.0.99.5-5.el9.rocky.0.2.x86_64                                       

  udica-0.2.8-2.el9.noarch                                                      

  unzip-6.0-58.el9_5.x86_64                                                     

  usermode-1.114-5.el9.x86_64                                                   

  virt-what-1.25-10.el9.x86_64                                                  

  yajl-2.1.0-22.el9.x86_64                                                      


Complete!

[rocky@rockyapex ~]$ 


firewalldをインストールし、開始します。

sudo dnf -y install firewalld
sudo systemctl enable firewalld
sudo systemctl start firewalld


[rocky@rockyapex ~]$ sudo dnf -y install firewalld

sudo systemctl enable firewalld

sudo systemctl start firewalld

Last metadata expiration check: 0:10:02 ago on Thu Apr 24 09:12:44 2025.

Dependencies resolved.

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

 Package                   Arch        Version               Repository      Size

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

Installing:

 firewalld                 noarch      1.3.4-9.el9_5         baseos         452 k

Installing dependencies:

 firewalld-filesystem      noarch      1.3.4-9.el9_5         baseos         8.6 k

 ipset                     x86_64      7.11-11.el9_5         baseos          41 k

 ipset-libs                x86_64      7.11-11.el9_5         baseos          68 k

 iptables-nft              x86_64      1.8.10-11.el9_5       baseos         187 k

 python3-firewall          noarch      1.3.4-9.el9_5         baseos         355 k

 python3-nftables          x86_64      1:1.0.9-3.el9         baseos          21 k

Installing weak dependencies:

 libcap-ng-python3         x86_64      0.8.2-7.el9           appstream       29 k


Transaction Summary

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

Install  8 Packages


[中略]



7/8 

  Verifying        : libcap-ng-python3-0.8.2-7.el9.x86_64                     8/8 

Installed products updated.


Installed:

  firewalld-1.3.4-9.el9_5.noarch        firewalld-filesystem-1.3.4-9.el9_5.noarch

  ipset-7.11-11.el9_5.x86_64            ipset-libs-7.11-11.el9_5.x86_64          

  iptables-nft-1.8.10-11.el9_5.x86_64   libcap-ng-python3-0.8.2-7.el9.x86_64     

  python3-firewall-1.3.4-9.el9_5.noarch python3-nftables-1:1.0.9-3.el9.x86_64    


Complete!

[rocky@rockyapex ~]$ 


firewalldに以下の設定を追加します。

ポート8080(HTTP)、8443(HTTPS)、1521(SQL*Net)に接続許可を与えます。また、ポート80(HTTPの標準ポート)への接続を8080へ、ポート443(HTTPSの標準ポート)をポート8443へ転送する設定を行います。

sudo firewall-cmd --add-port=8080/tcp
sudo firewall-cmd --add-port=8443/tcp
sudo firewall-cmd --add-port=27017/tcp
sudo firewall-cmd --add-port=1521/tcp
sudo firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080
sudo firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
sudo firewall-cmd --runtime-to-permanent
sudo firewall-cmd --list-all

[rocky@rockyapex ~]$ sudo firewall-cmd --add-port=8080/tcp

sudo firewall-cmd --add-port=8443/tcp

sudo firewall-cmd --add-port=27017/tcp

sudo firewall-cmd --add-port=1521/tcp

sudo firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080

sudo firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443

sudo firewall-cmd --runtime-to-permanent

sudo firewall-cmd --list-all

success

success

success

success

success

success

success

public (active)

  target: default

  icmp-block-inversion: no

  interfaces: eth0

  sources: 

  services: cockpit dhcpv6-client ssh

  ports: 8080/tcp 8443/tcp 27017/tcp 1521/tcp

  protocols: 

  forward: yes

  masquerade: no

  forward-ports: 

port=80:proto=tcp:toport=8080:toaddr=

port=443:proto=tcp:toport=8443:toaddr=

  source-ports: 

  icmp-blocks: 

  rich rules: 

[rocky@rockyapex ~]$ 


ユーザーoracle、グループoinstallを作成します。

Oracle Databaseなどはコンテナ内でユーザーoracleとして実行されます。コンテナ内からホストのファイル・システムを参照するにあたって、参照するホスト側にあるディレクトリの所有者のUIDやGIDが、コンテナ内のユーザーoracleと一致するようにします。

sudo groupadd -g 54321 oinstall
sudo useradd -u 54321 -g 54321 oracle


[rocky@rockyapex ~]$ sudo groupadd -g 54321 oinstall

sudo useradd -u 54321 -g 54321 oracle

[rocky@rockyapex ~]$ 


ユーザーoracleがログインしていなくてもサービスが実行できるように、以下のコマンドを実行します。

sudo loginctl enable-linger 54321

[rocky@rockyapex ~]$ sudo loginctl enable-linger 54321

[rocky@rockyapex ~]$ 


/etc/sysctl.confに以下の設定を追加します。いくつかのカーネル・パラメータをOracle Linux 9のデフォルトに寄せています。

sudo vi /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
kernel.unknown_nmi_panic=1
kernel.io_uring_disabled=0
kernel.split_lock_mitigate=1
vm.hugetlb_optimize_vmemmap=1

追加後、設定を更新します。

sudo sysctl -p /etc/sysctl.conf

[rocky@rockyapex ~]$ sudo sysctl -p /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

kernel.unknown_nmi_panic = 1

kernel.io_uring_disabled = 0

kernel.split_lock_mitigate = 1

vm.hugetlb_optimize_vmemmap = 1

[rocky@rockyapex ~]$ 


以上でOSレベルの構成は完了です。一旦、インスタンスを再起動します。

sudo shutdown -r now

[rocky@rockyapex ~]$ sudo shutdown -r now

[rocky@rockyapex ~]$ Connection to 144.24.37.245 closed by remote host.

Connection to ***.***.***.*** closed.


再度、インスタンスにユーザーrockyで接続し、Oracle APEXの構成作業を始めます。

これ以降の作業はOracle Linux 9がホストのときと全く同じです。

ユーザーoracleに切り替えて作業します。

sudo su - oracle

[rocky@rockyapex ~]$ sudo su - oracle

[oracle@rockyapex ~]$ 


あらかじめ、Oracle Database 23ai Freeのコンテナ・イメージをダウンロードします。

podman pull container-registry.oracle.com/database/free:latest

[oracle@rockyapex ~]$ podman pull container-registry.oracle.com/database/free:latest

Trying to pull container-registry.oracle.com/database/free:latest...

Getting image source signatures

Copying blob 98c750596418 done   | 

Copying blob 45946172daf4 done   | 

Copying blob e75c46a944c1 done   | 

Copying blob bc2da41e3d7a done   | 

Copying blob 267aca2af8b5 done   | 

Copying blob 8fa9d70719ed done   | 

Copying blob 8768e23f2b25 done   | 

Copying blob 9e5951d51d8d done   | 

Copying blob f22aa7216fae done   | 

Copying blob e63d4fa6a272 done   | 

Copying blob 62a01ec99fe6 done   | 

Copying blob 594d5b772601 done   | 

Copying blob e37163167ac7 done   | 

Copying blob a929d2ad7ddf done   | 

Copying blob 050ccaa83ceb done   | 

Copying blob aaeae0478ed7 done   | 

Copying blob 614b5a826d89 done   | 

Copying blob dcabeeccf7cf done   | 

Copying blob 68a2849e54ba done   | 

Copying blob b775cdac78fd done   | 

Copying blob c7a80918041e done   | 

Copying config ac5f0e5fb4 done   | 

Writing manifest to image destination

ac5f0e5fb44326e93580e551d167a5c4d5ce66ffcd0f17ae98ef106c891f21fc

[oracle@rockyapex ~]$ 


Oracle REST Data Servicesのコンテナ・イメージをダウンロードします。

podman pull container-registry.oracle.com/database/ords:latest

[oracle@rockyapex ~]$ podman pull container-registry.oracle.com/database/ords:latest

Trying to pull container-registry.oracle.com/database/ords:latest...

Getting image source signatures

Copying blob b694ec42ef2c done   | 

Copying blob ada6a46d3df6 done   | 

Copying blob 1ebd134257ee done   | 

Copying blob ac06ceafe5b9 done   | 

Copying blob da6e8ccba81d done   | 

Copying config 70778af2ee done   | 

Writing manifest to image destination

70778af2ee1c0ef9d54888f01453b88e1d9e1a78a48400ebcfdf03c645ee31dd

[oracle@rockyapex ~]$ 


Oracle APEXの最新のアーカイブをダウンロードします。

curl -OL https://download.oracle.com/otn_software/apex/apex-latest.zip

[oracle@rockyapex ~]$ curl -OL https://download.oracle.com/otn_software/apex/apex-latest.zip

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

                                 Dload  Upload   Total   Spent    Left  Speed

100  289M  100  289M          128M      0  0:00:02  0:00:02 --:--:--  128M

[oracle@rockyapex ~]$ 


ダウンロードしたzipファイルを解凍します。

unzip apex-latest.zip

[oracle@rockyapex ~]$ unzip apex-latest.zip

Archive:  apex-latest.zip

  inflating: META-INF/MANIFEST.MF    

  inflating: META-INF/ORACLE_C.SF    

  inflating: META-INF/ORACLE_C.RSA   

   creating: apex/

  inflating: apex/apex_rest_config.sql  

  inflating: apex/apex_rest_config_cdb.sql  

  inflating: apex/apex_rest_config_core.sql  

  inflating: apex/apex_rest_config_nocdb.sql  


[中略]


  inflating: apex/utilities/debug/d0.sql  

  inflating: apex/utilities/debug/d1.sql  

  inflating: apex/utilities/debug/d2.sql  

  inflating: apex/utilities/debug/ds.sql  

   creating: apex/utilities/support/

  inflating: apex/utilities/support/apex_verify.sql  

[oracle@rockyapex ~]$   


データベースとORDSを含むポッドとしてapexを作成します。

podman pod create --userns=keep-id:uid=54321,gid=54321 -p 1521:1521 -p 8080:8080 -p 8443:8443 -p 27017:27017 --name apex

[oracle@rockyapex ~]$ podman pod create --userns=keep-id:uid=54321,gid=54321 -p 1521:1521 -p 8080:8080 -p 8443:8443 -p 27017:27017 --name apex

dcf15ee702a9f6fe1758ac5ab202c408fa491f31b93fc8a4cdec8e8f67546b72

[oracle@rockyapex ~]$ 


データファイルを配置するディレクトリoradataを、/home/oracle以下に作成します。

mkdir oradata

[oracle@rockyapex ~]$ mkdir oradata

[oracle@rockyapex ~]$ 


ポッドapex内にOracle Database 23ai Freeのコンテナを作成します。名前はapex-dbとします。

podman run -d --pod apex --name apex-db --privileged -v /home/oracle/oradata:/opt/oracle/oradata -v /home/oracle/apex:/home/oracle/apex container-registry.oracle.com/database/free:latest

[oracle@rockyapex ~]$ podman run -d --pod apex --name apex-db --privileged -v /home/oracle/oradata:/opt/oracle/oradata -v /home/oracle/apex:/home/oracle/apex container-registry.oracle.com/database/free:latest

b456173f532f8b714ef421f9576d5d14d849d19cd3030272135294c094fe60ed

[oracle@rockyapex ~]$ 


コンテナapex-dbの作成過程のログを確認します。

podman logs -f apex-db

DATABASE IS READY TO USE!と表示されたら、コンテナの準備は完了です。Ctrl+Cを入力して、ログの確認を終了します。

[oracle@rockyapex ~]$ podman logs -f apex-db

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


[中略]


Executing user defined scripts

/opt/oracle/runUserScripts.sh: running /opt/oracle/scripts/extensions/setup/registerService.sh


DONE: Executing user defined scripts


The Oracle base remains unchanged with value /opt/oracle

#########################

DATABASE IS READY TO USE!

#########################

The following output is now a tail of the alert.log:

2025-04-24T09:49:11.159247+00:00

PDB$SEED(2):Opening pdb with Resource Manager plan: DEFAULT_PLAN

(3):--ATTENTION--

(3):PARALLEL_MAX_SERVERS (with value 1) is insufficient. This may affect transaction recovery performance.

Modify PARALLEL_MAX_SERVERS parameter to a value > 4 (= parallel servers count computed from parameter FAST_START_PARALLEL_ROLLBACK) in PDB ID 3

FREEPDB1(3):Autotune of undo retention is turned on. 

2025-04-24T09:49:11.807884+00:00

FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN

Completed: Pluggable database FREEPDB1 opened read write 

Completed: ALTER DATABASE OPEN

2025-04-24T09:49:12.526952+00:00

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

Dumping current patch information

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

No patches have been applied

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

^C[oracle@rockyapex ~]$ 


作成したデータベースのSYSのパスワードを設定します。この後に設定したパスワードを参照することがあるので、環境変数ORACLE_PWDにパスワードを設定しておきます。

export ORACLE_PWD=[パスワード]
podman exec -it apex-db sh setPassword.sh $ORACLE_PWD

[oracle@rockyapex ~]$ export ORACLE_PWD=*******

[oracle@rockyapex ~]$ podman exec -it apex-db sh setPassword.sh $ORACLE_PWD

The Oracle base remains unchanged with value /opt/oracle


SQL*Plus: Release 23.0.0.0.0 - Production on Fri Apr 25 04:44:05 2025

Version 23.7.0.25.01


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



Connected to:

Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free

Version 23.7.0.25.01


SQL> 

User altered.


SQL> 

User altered.


SQL> 

Session altered.


SQL> 

User altered.


SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free

Version 23.7.0.25.01

[oracle@rockyapex ~]$ 


これからOracle APEXをデータベースにインストールします。

コンテナapex-dbに接続します。

podman exec -it apex-db bash

[oracle@rockyapex ~]$ podman exec -it apex-db bash

bash-4.4$ 


Oracle APEXのメディアが展開されているディレクトリ/home/oracle/apexに移動します。このディレクトリはホストの/home/oracle/apexをマウントしています。

cd apex
ls

bash-4.4$ cd apex

bash-4.4$ ls

LICENSE.txt     apxdevrm_cdb.sql apxrtins_cdb.sql

apex_rest_config.sql     apxdevrm_nocdb.sql apxrtins_nocdb.sql

apex_rest_config_cdb.sql    apxdvins.sql apxsilentins.sql

apex_rest_config_core.sql   apxdvins_cdb.sql builder

apex_rest_config_nocdb.sql  apxdvins_nocdb.sql core

apexins.sql     apxdwngrd.sql coreins.sql

apexins1.sql     apxpatch.sql coreins2.sql

apexins2.sql     apxpatch_cdb.sql coreins3.sql

apexins3.sql     apxpatch_nocdb.sql coreins4.sql

apexins_adb.sql     apxremov.sql coreins5.sql

apexins_adb_ext.sql     apxremov1.sql dbcsconf.sql

apexins_cdb.sql     apxremov2.sql dbcsins.sql

apexins_nocdb.sql     apxremov_cdb.sql devins.sql

appins.sql     apxremov_nocdb.sql images

apxappcon.sql     apxrtins.sql load_trans.sql

apxappcon_ext.sql     apxrtins1.sql utilities

apxchpwd.sql     apxrtins2.sql

apxdevrm.sql     apxrtins3.sql

bash-4.4$ 


sqlplusを起動し、Oracle APEXをデータベースにインストールします。

export NLS_LANG=American_America.AL32UTF8
sqlplus / as sysdba
alter session set container = freepdb1;
@apexins SYSAUX SYSAUX TEMP /i/

bash-4.4$ export NLS_LANG=American_America.AL32UTF8

bash-4.4$ sqlplus / as sysdba


SQL*Plus: Release 23.0.0.0.0 - Production on Fri Apr 25 03:04:31 2025

Version 23.7.0.25.01


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



Connected to:

Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free

Version 23.7.0.25.01


SQL> alter session set container = freepdb1;


Session altered.


SQL> @apexins SYSAUX SYSAUX TEMP /i/

...set_appun.sql


PL/SQL procedure successfully completed.














...set_ufrom_and_upgrade.sql


PL/SQL procedure successfully completed.







Session altered.



FOO3

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

install2025-04-25_03-05-55.log


. ORACLE

.

. Oracle APEX Installation.

..........................................

.

...set_appun.sql

... Checking prerequisites (MANUAL)


[中略]


Thank you for installing Oracle APEX 24.2.0


Oracle APEX is installed in the APEX_240200 schema.


The structure of the link to the Oracle APEX Administration Services is as follows:

http://host:port/ords/apex_admin


The structure of the link to the Oracle APEX development environment is as follows:

http://host:port/ords/apex



timing for: Phase 3 (Switch)

Elapsed:    0.15



timing for: Complete Installation

Elapsed:    4.65


SYS>


日本語リソースをロードします。

@load_trans JAPANESE

SYS> @load_trans JAPANESE


PL/SQL procedure successfully completed.


Installing Oracle APEX translation - JAPANESE



. ORACLE

.

. Oracle APEX Hosted Development Service Installation.

..............................................................


PL/SQL procedure successfully completed.



PL/SQL procedure successfully completed.


--application/set_environment

API Last Extended:20241130

Your Current Version:20241130

This import is compatible with version: 20241130


[中略]


--application/deployment/buildoptions

--application/end_environment

... elapsed: 3.49 sec

...done

Adjust instance settings


PL/SQL procedure successfully completed.


SYS> 


APEX_PUBLIC_USERをアンロックします。

alter user apex_public_user account unlock no authentication;

SYS> alter user apex_public_user account unlock no authentication;


User altered.


SYS> 


管理者ユーザーとパスワードを設定します。

@apxchpwd

SYS> @apxchpwd

...set_appun.sql

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

This script can be used to change the password of an Oracle APEX

instance administrator. If the user does not yet exist, a user record will be

created.

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

Enter the administrator's username [ADMIN] 

User "ADMIN" does not yet exist and will be created.


Enter ADMIN's email [ADMIN] 

Enter ADMIN's password [] *********

Created instance administrator ADMIN.



SYS> exit


以上でデータベースへのOracle APEXのインストールは完了です。

コンテナapex-dbから抜け、ホストに戻ります。

exit

SYS> exit

Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free

Version 23.7.0.25.01

bash-4.4$ exit 

exit

[oracle@rockyapex ~]$ 


ORDSをインストールします。

構成情報を保存するフォルダords_config/home/oracle以下に作成します。

mkdir ords_config

[oracle@rockyapex ~]$ mkdir ords_config

[oracle@rockyapex ~]$ 


/home/oracle/apexを/opt/oracle/apexにマウントすることにより、ORDSは/home/oracle/apex/images以下の静的ファイルを参照します。また、データベースにORDSのメタデータがインストールされていないと、初回接続時にメタデータのインストールを実施します。

podman run -d --pod apex --name apex-ords --privileged -e DBHOST=localhost -e DBPORT=1521 -e DBSERVICENAME=freepdb1 -e ORACLE_PWD=$ORACLE_PWD -v /home/oracle/ords_config:/etc/ords/config -v /home/oracle/apex:/opt/oracle/apex container-registry.oracle.com/database/ords:latest

[oracle@rockyapex ~]$ podman run -d --pod apex --name apex-ords --privileged -e DBHOST=localhost -e DBPORT=1521 -e DBSERVICENAME=freepdb1 -e ORACLE_PWD=$ORACLE_PWD -v /home/oracle/ords_config:/etc/ords/config -v /home/oracle/apex:/opt/oracle/apex container-registry.oracle.com/database/ords:latest

1c9ce9561c0e795979d6c9e161bee9e2fe62fbc9f0268a12323d235476dcd3d6

[oracle@rockyapex ~]$ 


ログを表示し、ORDSの起動状況を確認します。

podman logs -f apex-ords

[oracle@rockyapex ~]$ podman logs -f apex-ords

INFO : Testing your connection variables.

INFO : Database connection established.

INFO : The Oracle REST Data Services are not installed on your database.

INFO : Installing The Oracle REST Data Services 25.1.0.

INFO : The Oracle REST Data Services 25.1.0 has been installed correctly on your database.

INFO : The container found Oracle APEX version 24.2.0 in the mounted volume.

INFO : The Oracle APEX 24.2.0 is already installed in your database.

INFO : Set plsql.gateway.mode proxied after Oracle APEX was installed.

INFO : Setup standalone.static.path /opt/oracle/apex/images.

INFO : Starting the Oracle REST Data Services instance.


ORDS: Release 25.1 Production on Fri Apr 25 03:19:17 2025


Copyright (c) 2010, 2025, Oracle.


Configuration:

  /etc/ords/config


2025-04-25T03:19:17.914Z INFO        HTTP and HTTP/2 cleartext listening on host: 0.0.0.0 port: 8080

2025-04-25T03:19:17.945Z INFO        Disabling document root because the specified folder does not exist: /etc/ords/config/global/doc_root

2025-04-25T03:19:17.945Z INFO        Default forwarding from / to contextRoot configured.

2025-04-25T03:19:18.027Z SEVERE      ORAMLVERSION null

2025-04-25T03:19:18.034Z INFO        Oracle API for MongoDB listening on port: 27017


[中略]


2025-04-25T03:19:21.641Z INFO        


Mapped local pools from /etc/ords/config/databases:

  /ords/                              => default                        => VALID     



2025-04-25T03:19:21.721Z INFO        Oracle REST Data Services initialized

Oracle REST Data Services version : 25.1.0.r1001652

Oracle REST Data Services server info: jetty/12.0.13

Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build: 21.0.2+13-LTS-jvmci-23.1-b30 mixed mode, sharing)


2025-04-25T03:19:21.773Z INFO        RequestMonitor 1

2025-04-25T03:19:21.773Z INFO        CursorMonitor 1

2025-04-25T03:19:21.773Z INFO        TransactionMonitor 1

2025-04-25T03:19:21.773Z INFO        AccessLogMonitor 1 0

2025-04-25T03:19:21.773Z INFO        WatchdogMonitor 1


ORDSが正常に起動したら、ORDSやAPEXにアクセスできる状態になっています。

ブラウザより以下のURLにアクセスします。

http://コンピュート・インスタンスのIPアドレス/ords/

以下の画面が表示されます。


今回の記事は以上になります。


追記

最初はAPEXのインストールにSQLclを使っていましたが、apexins.sqlのPDFフォントのインポート時に頻繁にハングするため、sqlplusを使ったインストールに切り替えています。

DBとORDSのコンテナを動かしているコンピュート・インスタンスは、最低限のリソースで作成しています。sqlplusはSQLclと比較するとリソースの消費が少ないため、同様の問題は発生していません。

#

# Loading PDF font data

#

...PDF font data install


...insert standard PDF fonts



...insert extra PDF fonts


-- Western regular

-- Western bold

-- Japanese regular

-- Japanese bold

-- Korean regular

-- Korean bold

-- Simplified Chinese regular

-- Simplified Chinese bold

-- Traditional Chinese regular

-- Traditional Chinese bold

-- Arabic regular

-- Arabic bold

-- Hebrew regular

-- Hebrew bold

...apex_install_pdf_unicode_data.sql

...apex_install_pdf_unicode_mirroring.sql

...apex_install_pdf_unicode_arab_shaping.sql