Oracle Container Registryに登録されているDatabaseのfree(Oracle Database 23c Free)のイメージとords(Oracle REST Data Services (ORDS) with Application Express)から、Oracle APEXの環境を作成します。
Intel MacのmacOS Sonama 14.3.1のpodmanを使います。
macOSでのpodmanの準備については、以前の記事「Autonomous Database Free Container ImageをmacOS上で実行する」を参照してください。以降の手順は、podmanの仮想マシンが起動済みであることが前提です。
あらかじめコンテナのイメージをダウンロードしておきます。
podman pull container-registry.oracle.com/database/free:latest% podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
container-registry.oracle.com/database/ords latest 509be9113a6b 2 months ago 1.96 GB
container-registry.oracle.com/database/free latest 39cabc8e6db0 5 months ago 9.19 GB
%
Oracle Database FreeのコンテナとOracle REST Data Servicesのコンテナを実行するpodを作成します。名前はapexとします。
podman pod create -p 8181:8181 -p 1521:1521 --name apex
% podman pod create -p 8181:8181 -p 1521:1521 --name apex
56d3d3d10face061bcb9e283521c1de05da2f92a96572f2731b654b33ae2de71
%
podの作成を確認します。
podman pod ls
% podman pod ls
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
56d3d3d10fac apex Created 11 seconds ago ca3e07240992 1
%
% podman run -d --pod apex --name apexdb -e ORACLE_PWD=****** container-registry.oracle.com/database/free:latest
429816bd790f32bf6331afd1390fecaccc9d8a54e7900c8d9d1eafd23b2a68ef
%
podman ps
% podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ca3e07240992 localhost/podman-pause:4.7.2-1698762721 5 minutes ago Up 3 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8181->8181/tcp 56d3d3d10fac-infra
429816bd790f container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 3 minutes ago Up 3 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8181->8181/tcp apexdb
%
chmod 777 ords_secrets
% mkdir ords_secrets
% chmod 777 ords_secrets
% echo 'CONN_STRING=sys/パスワード@localhost:1521/freepdb1' > ords_secrets/conn_string.txt
%
% podman run --pod apex --name ords -v `pwd`/ords_secrets/:/opt/oracle/variables container-registry.oracle.com/database/ords:latest
INFO : This container will start a service running ORDS 23.4.0 and APEX 23.2.0.
INFO : CONN_STRING has been found in the container variables file.
INFO : Database connection established.
INFO : Apex is not installed on your database.
INFO : Installing APEX on your DB please be patient.
INFO : You can check the logs by running the command below in a new terminal window:
docker exec -it apex tail -f /tmp/install_container.log
WARN : APEX can be installed remotely on PDBs, If you want to install it on a CDB,
install it directly on the Database and not remotely.
% podman exec -it ords tail -f /tmp/install_container.log
--application/pages/page_00067
--application/pages/page_00069
--application/pages/page_00070
--application/pages/page_00071
--application/pages/page_00073
--application/pages/page_00075
--application/pages/page_00076
--application/pages/page_00077
Session altered.
PL/SQL procedure successfully completed.
Disconnected from Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.3.0.23.09
java.class.version=55.0
2024-03-16T00:21:35.135Z INFO
Mapped local pools from /etc/ords/config/databases:
/ords/ => default => VALID
2024-03-16T00:21:35.249Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 23.4.0.r3461619
Oracle REST Data Services server info: jetty/10.0.18
Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM 11.0.15+8-LTS-149
% podman exec -it ords sh
sh-4.4$
export PATH=/opt/oracle/sqlcl/bin:$PATH
sql sys/パスワード@localhost/freepdb1 as sysdba
sh-4.4$ cd /opt/oracle/apex/23.2.0
sh-4.4$ export PATH=/opt/oracle/sqlcl/bin:$PATH
sh-4.4$ sql sys/******@localhost/freepdb1 as sysdba
SQLcl: Release 23.3 Production on Sat Mar 16 00:31:45 2024
Copyright (c) 1982, 2024, Oracle. All rights reserved.
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Connected to:
Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.3.0.23.09
SQL>
SQL> @load_trans JAPANESE
PL/SQL procedure successfully completed.
Installing Oracle APEX translation - JAPANESE
. ORACLE
.
. Application Express Hosted Development Service Installation.
..............................................................
PL/SQL procedure successfully completed.
...done
Adjust instance settings
PL/SQL procedure successfully completed.
SQL>
SQL>