TL;DR
git clone https://github.com/ujnak/apex-podman-setup
cd apex-podman-setup
sh config_apex.sh [SYSのパスワード] [APEX管理者パスワード]
sql sys/[SYSのパスワード]@localhost/freepdb1 as sysdba @create_workspace [ワークスペース名] [管理者アカウント名] [管理者パスワード] [メール・アドレス]
構築手順の紹介
podman image ls
~ % 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 sha256:b797dddc88dcbc8a430bf59617acf1961601af67c8c0e918ebd4f666af49538b
Copying blob sha256:8972f4d06457113fdc3a453bba134352b9dff45ecdda10a8412007ff44ca9e73
Copying blob sha256:6a9349137477d08627da9fc8c7ea8a421f182d634dfe858fe9c2b0d3b35282e5
Copying blob sha256:ceca1aa3cfee4dd29d05ac01a2922506a6bb06194e5259860e2898d6c33c46c9
Copying blob sha256:335d210dc58f821c09816ab374c18b515ec159f71e64cf94f4d36baa866bba92
Copying blob sha256:f2875f41253eefdd4ff6de5801e0139c823c865386623e65fa826ec288c4a010
Copying blob sha256:ed20c368143183d71a888b8e1fe686a6d96bfb4d62e6ecafbe4dc1a4e07ab86f
Copying blob sha256:6a71dedb225273837db5c95b74787fbbbe9c6b8dd6ef32f287c4308a7e4963c5
Copying blob sha256:1794616db9e5910a7fe63cf0306d225a4a117e92da6c30e20315d37e3b3fa576
Copying blob sha256:186e95b32d60299b13d81c81f6bd62edf6801da8a8786d1ee0f29691bcce1025
Copying blob sha256:6abd26f619581a1b2b57557f97e8ecf6690e451ce93b4fd0f699ba38892a535c
Copying blob sha256:79c50cc993f3e0688dc35a756fd3f3787e8f5493a788db526fe27085e73aa737
Copying blob sha256:4bdc0b3e1a73cf27c92427016d939a477992d8c00253227e91ce3f6bd03274a7
Copying blob sha256:fbb8b5f03b65dffdf4caddc0eea984f8a1af6391cb85a767eefc262e0a6aaa03
Copying blob sha256:310b14631e652350b0931abe4c971fd0092065e377cd0eae059a2a138d904455
Copying blob sha256:9bf7a78ae69f215153203acb64f82932e6f23242576327cce8c967954b26ccf7
Copying blob sha256:06f03eeb6131dc00b6a04877ff003df00d69247babdf09ba30c695dd7ddd5dc0
Copying blob sha256:d9fadc2df82753a2196b54c2b7a4f7c26ebd1b7bd35832b8f32633913760f737
Copying blob sha256:9931f5880d82d0217b06c628694b6bf085f15ba1cfa57edfbcbf7d4401539fd4
Copying blob sha256:f67b822f4157c04631df69bdb42354142da8030cd4f5ce0adf243e3c3be1f079
Copying blob sha256:ddc1d209435d15b78a8bebc956b673d37c664ccb5e269df56a77d0096fd40c7e
Copying config sha256:8e32bb9123258bd5e1e7e8cf9ce0d071ebbaa72feefb8a89a2b34bdfe222cb57
Writing manifest to image destination
8e32bb9123258bd5e1e7e8cf9ce0d071ebbaa72feefb8a89a2b34bdfe222cb57
~ % 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 sha256:09d20ca4c0a449bb17c65679b6643a62d7bb50a19f4d93d47c2f1b4c19815e8a
Copying blob sha256:fb83e5d7d9cd0490890f2ce554d37323505101d56bdd0a91ff41cbe8c59dfe2a
Copying blob sha256:d5b6f4fa03b182ecb8e4646360bdc18132785210644991a61808e6aaa39448ce
Copying blob sha256:cf660f7d71ff55d10ef774601d5995c9191271f4fc48c2d3abef5c70988622f3
Copying blob sha256:9f2d4da311b73e31d942dcce5c26b0e990e1dca1804941e81ede69612411af4f
Copying blob sha256:57dbb8b1a927027e6ebad36ccf90992ce98620a540a58dbe69b84de5fada48b5
Copying blob sha256:d6b6963b075d6b42386b16ecb88eba486f17ee26d1f0c88ca3751f6a5dbdfe57
Copying blob sha256:6602a53622577f9ee5a823b1333d7fbff21b6f355ff027601cf243db4c3c4657
Copying blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
Copying config sha256:863edf63718223d8fc19bbb60305d198c551b6aaa7d39be4181f736ce407b6dc
Writing manifest to image destination
863edf63718223d8fc19bbb60305d198c551b6aaa7d39be4181f736ce407b6dc
~ % podman image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/podman-pause 5.2.4-1728259200 0c417904ab6b 2 hours ago 756 kB
container-registry.oracle.com/database/ords latest 863edf637182 2 weeks ago 2.02 GB
container-registry.oracle.com/database/free latest 8e32bb912325 3 weeks ago 9.03 GB
~ %
Oracle REST Data Servicesのコンテナ・イメージは、実行に必要なプログラムだけを含むものに置き換えられています。以前と同様にAPEXのイメージを含むイメージは、リポジトリords-developerからダウンロードできます。
podman pod ls
~ % podman pod create -p 8080:8080 -p 8443:8443 -p 1521:1521 --name apex
383302e17f965e78e4bdd92d283d811bf68f4dceb556de925a7ac209fa13e940
~ % podman pod ls
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
383302e17f96 apex Created 4 minutes ago f9ca4221e1fb 1
~ %
~ % podman volume create oradata
oradata
apex % podman volume ls
DRIVER VOLUME NAME
local oradata
~ %
podman run -d --pod apex --name db -e ORACLE_PWD=oracle -v oradata:/opt/oracle/oradata container-registry.oracle.com/database/free:latest
~ % podman run -d --pod apex --name db -e ORACLE_PWD=oracle -v oradata:/opt/oracle/oradata container-registry.oracle.com/database/free:latest
37ae9bd9849d3949d79b7bdf8f6899ebbab37a5f79f7c746bc2911dd4dbf3c34
~ % podman logs db
Starting Oracle Net Listener.
Oracle Net Listener started.
Starting Oracle Database instance FREE.
Oracle Database instance FREE started.
The Oracle base remains unchanged with value /opt/oracle
SQL*Plus: Release 23.0.0.0.0 - Production on Thu Oct 17 04:33:56 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
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.5.0.24.07
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:
Completed: Pluggable database FREEPDB1 opened read write
2024-10-17T04:33:56.949263+00:00
===========================================================
Dumping current patch information
===========================================================
No patches have been applied
===========================================================
Completed: ALTER DATABASE OPEN
2024-10-17T04:33:57.438055+00:00
FREEPDB1(3):TABLE AUDSYS.AUD$UNIFIED: ADDED INTERVAL PARTITION SYS_P344 (3762) VALUES LESS THAN (TIMESTAMP' 2024-10-18 00:00:00')
2024-10-17T04:33:57.963198+00:00
TABLE SYS.WRP$_REPORTS: ADDED AUTOLIST FRAGMENT SYS_P362 (2) VALUES (( 1452480138, TO_DATE(' 2024-10-14 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED AUTOLIST FRAGMENT SYS_P363 (2) VALUES (( 1452480138, TO_DATE(' 2024-10-14 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED AUTOLIST FRAGMENT SYS_P366 (2) VALUES (( 1452480138, TO_DATE(' 2024-10-14 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
~ % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9ca4221e1fb localhost/podman-pause:5.2.4-1728259200 8 minutes ago Up 4 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 383302e17f96-infra
37ae9bd9849d container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 4 minutes ago Up 4 minutes (starting) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp db
~ % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9ca4221e1fb localhost/podman-pause:5.2.4-1728259200 9 minutes ago Up 5 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 383302e17f96-infra
37ae9bd9849d container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 5 minutes ago Up 5 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp db
~ %
~ % 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 276M 100 276M 0 0 7421k 0 0:00:38 0:00:38 --:--:-- 5548k
apex % 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/LICENSE.txt
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/apexins.sql
inflating: apex/apexins1.sql
[中略]
extracting: apex/images/yellow_flag.gif
extracting: apex/images/yes.gif
extracting: apex/images/apex_version.txt
extracting: apex/images/apex_version.js
~ %
ダウンロードしたapex-latest.zipのバージョンを確認します。
cat apex/images/apex_version.txt
~ % cat apex/images/apex_version.txt
Oracle APEX Version: 24.1
~ %
~ % cd apex
SQLclを実行し、コンテナapex-dbで実行されているデータベースにユーザーSYSで接続します。接続先となるデータベースのSIDはFREE、PDB名はFREEPDB1です。
apex % sql sys/oracle@localhost/freepdb1 as sysdba
SQLcl: 木 10月 17 11:51:37 2024のリリース23.4 Production
Copyright (c) 1982, 2024, Oracle. All rights reserved.
接続先:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL>
Oracle APEXをインストールします。
SQL> @apexins SYSAUX SYSAUX TEMP /i/
...set_appun.sql
PL/SQLプロシージャが正常に完了しました。
:CDB
_______
YES
:CDB_ROOT
____________
NO
:META_LINK
_____________
LOCAL
...set_ufrom_and_upgrade.sql
PL/SQLプロシージャが正常に完了しました。
[中略]
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 interface is as follows:
http://host:port/ords
timing for: Phase 3 (Switch)
Elapsed: 0.13
timing for: Complete Installation
Elapsed: 5.32
SYS>
SYS> @load_trans JAPANESE
PL/SQLプロシージャが正常に完了しました。
Installing Oracle APEX translation - JAPANESE
. ORACLE
.
. Oracle APEX Hosted Development Service Installation.
..............................................................
PL/SQLプロシージャが正常に完了しました。
PL/SQLプロシージャが正常に完了しました。
--application/set_environment
API Last Extended:20240531
Your Current Version:20240531
This import is compatible with version: 20240531
COMPATIBLE (You should be able to run this import without issues.)
ID offset during import: 0
New ID offset for application: 0
[中略]
--application/pages/page_00206
--application/deployment/definition
--application/deployment/checks
--application/deployment/buildoptions
--application/end_environment
... elapsed: 3.96 sec
...done
Adjust instance settings
PL/SQLプロシージャが正常に完了しました。
SYS>
alter user apex_public_user account unlock no authentication;
SYS> alter user apex_public_user account unlock no authentication;
User APEX_PUBLIC_USERが変更されました。
SYS>
Oracle APEXの管理者アカウントを設定します。アカウント名はADMINとし、パスワードを設定します。
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>
APEXがインストールされたスキーマに、あらかじめネットワーク接続ができるようにネットワークACLを設定しておきます。
set feedback on
begin
dbms_network_acl_admin.append_host_ace(
host => '*',
ace => xs$ace_type(
privilege_list => xs$name_list('connect'),
principal_name => 'APEX_240100',
principal_type => xs_acl.ptype_db
)
);
commit;
end;
/
SYS> set feedback on
SYS> begin
dbms_network_acl_admin.append_host_ace(
host => '*',
ace => xs$ace_type(
privilege_list => xs$name_list('connect'),
principal_name => 'APEX_240100',
principal_type => xs_acl.ptype_db
)
);
commit;
end;
/
PL/SQLプロシージャが正常に完了しました。
SYS>
Oracle APEXの静的イメージを、CDNから参照するようにイメージ・プリフィックスを設定します。
begin
apex_instance_admin.set_parameter(
p_parameter => 'IMAGE_PREFIX',
p_value => 'https://static.oracle.com/cdn/apex/24.1.0/'
);
commit;
end;
/
SYS> begin
apex_instance_admin.set_parameter(
p_parameter => 'IMAGE_PREFIX',
p_value => 'https://static.oracle.com/cdn/apex/24.1.0/'
);
commit;
end;
/
PL/SQLプロシージャが正常に完了しました。
SYS>
set serveroutput on
exec dbms_output.put_line(apex_instance_admin.get_parameter('IMAGE_PREFIX'));
SYS> set serveroutput on
SYS> exec dbms_output.put_line(apex_instance_admin.get_parameter('IMAGE_PREFIX'));
https://static.oracle.com/cdn/apex/24.1.0/
PL/SQLプロシージャが正常に完了しました。
SYS>
SYS> exit
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07から切断されました
apex % cd ..
~ $
続いて、Oracle REST Data Servicesのコンテナを作成します。
podman volume create ords_config
podman volume ls
~ % podman volume create ords_config
ords_config
~ % podman volume ls
DRIVER VOLUME NAME
local oradata
local ords_config
~ %
Oracle REST Data Servicesのコンテナを作成し、ORDSを構成します。ORDSのコンテナ・イメージの説明ではNon-Interacitveな手順が紹介されていますが、1度だけの作業なので対話型のインストーラーを起動し、構成を行うことにします。
~ % podman run --pod apex --rm -it -v ords_config:/etc/ords/config container-registry.oracle.com/database/ords:latest install
2024-10-17T03:30:51Z INFO ORDS has not detected the option '--config' and this will be set up to the default directory.
ORDS: Release 24.3 Production on Thu Oct 17 03:30:51 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config
The configuration folder /etc/ords/config does not contain any configuration files.
Oracle REST Data Services - Interactive Install
Enter a number to select the database connection type to use
[1] Basic (host name, port, service name)
[2] TNS (TNS alias, TNS directory)
[3] Custom database URL
Choose [1]:
Enter the database host name [localhost]:
Enter the database listen port [1521]:
Enter the database service name [orcl]: freepdb1
Provide database user name with administrator privileges.
Enter the administrator username: sys
Enter the database password for SYS AS SYSDBA: ********
Retrieving information.
ORDS is not installed in the database. ORDS installation is required.
Enter a number to update the value or select option A to Accept and Continue
[1] Connection Type: Basic
[2] Basic Connection: HOST=localhost PORT=1521 SERVICE_NAME=freepdb1
Administrator User: SYS AS SYSDBA
[3] Database password for ORDS runtime user (ORDS_PUBLIC_USER): <generate>
[4] ORDS runtime user and schema tablespaces: Default: SYSAUX Temporary TEMP
[5] Additional Feature: Database Actions
[6] Configure and start ORDS in Standalone Mode: Yes
[7] Protocol: HTTP
[8] HTTP Port: 8080
[9] APEX static resources location:
[A] Accept and Continue - Create configuration and Install ORDS in the database
[Q] Quit - Do not proceed. No changes
Choose [A]:
The setting named: db.connectionType was set to: basic in configuration: default
The setting named: db.hostname was set to: localhost in configuration: default
The setting named: db.port was set to: 1521 in configuration: default
The setting named: db.servicename was set to: freepdb1 in configuration: default
The setting named: plsql.gateway.mode was set to: proxied in configuration: default
The setting named: db.username was set to: ORDS_PUBLIC_USER in configuration: default
The setting named: db.password was set to: ****** in configuration: default
The setting named: feature.sdw was set to: true in configuration: default
The global setting named: database.api.enabled was set to: true
The setting named: restEnabledSql.active was set to: true in configuration: default
The global setting named: standalone.http.port was set to: 8080
The global setting named: standalone.doc.root was set to: /etc/ords/config/global/doc_root
The setting named: security.requestValidationFunction was set to: ords_util.authorize_plsql_gateway in configuration: default
2024-10-17T03:31:08.137Z INFO Created folder /opt/oracle/ords/logs
2024-10-17T03:31:08.138Z INFO The log file is defaulted to the current working directory located at /opt/oracle/ords/logs
2024-10-17T03:31:08.194Z INFO Installing Oracle REST Data Services version 24.3.0.r2620924 in FREEPDB1
2024-10-17T03:31:09.461Z INFO ... Verified database prerequisites
2024-10-17T03:31:09.681Z INFO ... Created Oracle REST Data Services proxy user
2024-10-17T03:31:09.953Z INFO ... Created Oracle REST Data Services schema
2024-10-17T03:31:10.256Z INFO ... Granted privileges to Oracle REST Data Services
2024-10-17T03:31:11.604Z INFO ... Created Oracle REST Data Services database objects
2024-10-17T03:31:18.495Z INFO Completed installation for Oracle REST Data Services version 24.3.0.r2620924. Elapsed time: 00:00:10.280
2024-10-17T03:31:18.529Z INFO Completed configuring PL/SQL gateway user for Oracle REST Data Services version 24.3.0.r2620924. Elapsed time: 00:00:00.33
2024-10-17T03:31:18.531Z INFO Log file written to /opt/oracle/ords/logs/ords_install_2024-10-17_033108_13897.log
2024-10-17T03:31:18.641Z INFO HTTP and HTTP/2 cleartext listening on host: 0.0.0.0 port: 8080
2024-10-17T03:31:18.657Z INFO Disabling document root because the specified folder does not exist: /etc/ords/config/global/doc_root
2024-10-17T03:31:18.657Z INFO Default forwarding from / to contextRoot configured.
2024-10-17T03:31:20.005Z INFO Configuration properties for: |default|lo|
db.servicename=freepdb1
db.hostname=localhost
db.password=******
conf.use.wallet=true
security.requestValidationFunction=ords_util.authorize_plsql_gateway
database.api.enabled=true
db.username=ORDS_PUBLIC_USER
standalone.http.port=8080
restEnabledSql.active=true
resource.templates.enabled=false
plsql.gateway.mode=proxied
db.port=1521
feature.sdw=true
config.required=true
db.connectionType=basic
standalone.doc.root=/etc/ords/config/global/doc_root
2024-10-17T03:31:20.006Z WARNING *** jdbc.MaxLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2024-10-17T03:31:20.007Z WARNING *** jdbc.InitialLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2024-10-17T03:31:22.110Z INFO
Mapped local pools from /etc/ords/config/databases:
/ords/ => default => VALID
2024-10-17T03:31:22.138Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 24.3.0.r2620924
Oracle REST Data Services server info: jetty/10.0.21
Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM 17.0.12+8-LTS-jvmci-21.3-b66
^CException in thread "shutdown hook" java.lang.OutOfMemoryError: Java heap space
~ % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9ca4221e1fb localhost/podman-pause:5.2.4-1728259200 30 minutes ago Up 26 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 383302e17f96-infra
37ae9bd9849d container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 26 minutes ago Up 26 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp db
~ % podman container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9ca4221e1fb localhost/podman-pause:5.2.4-1728259200 30 minutes ago Up 26 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 383302e17f96-infra
37ae9bd9849d container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 26 minutes ago Up 26 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp db
~ %
~ % podman run -d --pod apex --name ords -v ords_config:/etc/ords/config container-registry.oracle.com/database/ords:latest serve
06388cb9860e01e5dfdf3087faa4415759cfdb8002f30d08fab0089cdfa66caf
~ % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f9ca4221e1fb localhost/podman-pause:5.2.4-1728259200 32 minutes ago Up 28 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 383302e17f96-infra
37ae9bd9849d container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 28 minutes ago Up 28 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp db
06388cb9860e container-registry.oracle.com/database/ords:latest serve 3 seconds ago Up 4 seconds 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp ords
~ %
podman generate kube apex > apex.yaml
~ % podman generate kube apex > apex.yaml
~ %
~ % podman pod stop apex
apex
~ % podman pod rm apex
383302e17f965e78e4bdd92d283d811bf68f4dceb556de925a7ac209fa13e940
~ % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
~ % podman container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
~ %
YAML構成ファイルからポッドを作成します。
podman kube play apex.yaml
~ % podman kube play apex.yaml
Pod:
cdb684cbdd03835c7945dc22335797a87e5b9b3c9653957310e08d31d39b4500
Containers:
90fdc8a32335849a7475e5d0589862feac9d53b207588cc7b3a2c4dad2d35479
e6f563aa2fe646f8543f2831ab8e509aa330fe9cd2208c6b976d36f7c3572141
~ %
ポッドapexやコンテナapex-db(dbとして作成したコンテナ)およびapex-ords(ordsとして作成したコンテナ)が実行されていることを確認します。
~ % podman pod ps
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
cdb684cbdd03 apex Running 6 minutes ago 5d36ed1705f0 3
~ % podman container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5d36ed1705f0 localhost/podman-pause:5.2.4-1728259200 6 minutes ago Up 6 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp cdb684cbdd03-infra
90fdc8a32335 container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 6 minutes ago Up 6 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp apex-db
e6f563aa2fe6 container-registry.oracle.com/database/ords:latest serve 6 minutes ago Up 6 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp apex-ords
~ %
最後に、Oracle APEXの管理サービスに接続します。
http://localhost:8080/ords/apex_admin
以上で、Oracle Database FreeとOracle REST Data Servicesのコンテナ・イメージを使って、Oracle APEXの環境を作成できました。
~ % podman run --rm -v oradata:/volume:ro -v `pwd`:/backup alpine:latest tar czf /backup/oradata.tar.gz -C /volume .
~ % ls -l oradata.tar.gz
-rw-r--r-- 1 ********* staff 1005372795 10 17 14:59 oradata.tar.gz
~ %
podman run --rm -v oradata2:/volume -v `pwd`:/backup alpine:latest tar xzf /backup/oradata.tar.gz -C /volume
~ % podman volume create oradata2
oradata2
~ % podman run --rm -v oradata2:/volume -v `pwd`:/backup alpine:latest tar xzf /backup/oradata.tar.gz -C /volume
~ %
パッチのファイルを解凍し、作成されたディレクトリ36695709へ移動します。
cd 36695709
~ % unzip p36695709_2410_Generic.zip
Archive: p36695709_2410_Generic.zip
creating: 36695709/
inflating: 36695709/README.txt
inflating: 36695709/catpatch.sql
inflating: 36695709/catpatch_appcon.sql
inflating: 36695709/catpatch_con.sql
inflating: 36695709/corepatch.sql
inflating: 36695709/devpatch.sql
creating: 36695709/images/
creating: 36695709/images/libraries/
creating: 36695709/images/libraries/apex/
creating: 36695709/images/libraries/apex/minified/
inflating: 36695709/images/libraries/apex/minified/chartBundle.min.js
inflating: 36695709/images/libraries/apex/minified/jetCommonBundle.min.js
inflating: 36695709/images/libraries/apex/minified/theme.min.js
inflating: 36695709/images/libraries/apex/minified/desktop.min.js
inflating: 36695709/images/libraries/apex/minified/desktop_all.min.js
inflating: 36695709/images/libraries/apex/minified/widget.interactiveReport.min.js
inflating: 36695709/images/libraries/apex/minified/region.workflowDiagram.min.js
[中略]
inflating: 36695709/wwv_flow_data_export_xml.plb
inflating: 36695709/wwv_dbms_cloud.plb
inflating: 36695709/wwv_flow_exec_web_src_utils.plb
inflating: 36695709/wwv_flow_authentication_social.plb
inflating: 36695709/wwv_flow_report_query_dev.plb
inflating: 36695709/validate_apex.sql
inflating: 36695709/flows_release.sql
~ % cd 36695709
36695709 %
ORDSを一旦停止します。
36695709 % podman stop apex-ords
apex-ords
36695709 % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
97e04fcbdab4 localhost/podman-pause:5.2.4-1728259200 6 minutes ago Up 6 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 9cef33b930ac-infra
5f95370f270e container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 6 minutes ago Up 6 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp apex-db
36695709 %
SQLclを起動し、ユーザーSYSでFREEPDB1に接続します。
36695709 % sql sys/********@localhost/freepdb1 as sysdba
SQLcl: 木 10月 17 15:28:57 2024のリリース23.4 Production
Copyright (c) 1982, 2024, Oracle. All rights reserved.
接続先:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL> @catpatch
Timing command is obsolete.
. ORACLE
.
. Oracle APEX 24.1.%
. Patch Set Exception 36695709
........................................
APEX_VERSION APEX_SCHEMA
_______________ ______________
24.1.0 APEX_240100
PL/SQLプロシージャが正常に完了しました。
Sessionが変更されました。
APEX_SCHEMA
______________
APEX_240100
PL/SQLプロシージャが正常に完了しました。
[中略]
...enabled_schema
...define_module
...define_template
...define_handler
...(06:29:31) Setting DBMS Registry for APEX to valid
...(06:29:31) Exiting validate_apex
PL/SQLプロシージャが正常に完了しました。
...Recompiling invalid public synonyms
PL/SQLプロシージャが正常に完了しました。
PL/SQLプロシージャが正常に完了しました。
Timing command is obsolete.
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07から切断されました
36695709 %
begin
apex_instance_admin.set_parameter(
p_parameter => 'IMAGE_PREFIX',
p_value => 'https://static.oracle.com/cdn/apex/24.1.5/'
);
commit;
end;
/
36695709 % sql sys/******@localhost/freepdb1 as sysdba
SQLcl: 木 10月 17 15:33:02 2024のリリース23.4 Production
Copyright (c) 1982, 2024, Oracle. All rights reserved.
接続先:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL> begin
apex_instance_admin.set_parameter(
p_parameter => 'IMAGE_PREFIX',
p_value => 'https://static.oracle.com/cdn/apex/24.1.5/'
);
commit;
end;
/
PL/SQLプロシージャが正常に完了しました。
SQL> exit
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07から切断されました
ynakakoshi@Ns-MacBook 36695709 %
36695709 % podman start apex-ords
apex-ords
36695709 % podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
97e04fcbdab4 localhost/podman-pause:5.2.4-1728259200 13 minutes ago Up 12 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp 9cef33b930ac-infra
5f95370f270e container-registry.oracle.com/database/free:latest /bin/bash -c $ORA... 13 minutes ago Up 12 minutes (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp apex-db
e566ed9343e6 container-registry.oracle.com/database/ords:latest serve 12 minutes ago Up 10 seconds 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp apex-ords
36695709 %
追記
podman volume create ords_config
podman exec -it apex-db /home/oracle/setPassword.sh [SYSのパスワード]
curl -OL https://download.oracle.com/otn_software/apex/apex-latest.zip
unzip apex-latest.zip
@install_apex_pod
ORDSのコンテナを停止する。
ORDSを構成したら、ポッドapexを再起動する。