2022年11月22日火曜日

Oracle APEXの環境作成(5) - APEXのインストール

更新: 2026年1月27日

作成したオラクル・データベースにOracle APEXをインストールします。

Oracle APEXのインストール


Oracle APEXのインストール・メディアをダウンロードするページを開きます。ダウンロードできる最新のOracle APEXのバージョンを確認します。
https://www.oracle.com/tools/downloads/apex-downloads.html

2026年1月27日現在、24.2が最新のバージョンです。


オラクル・データベースのRPMをインストールすると、ユーザーoracleとグループoinstallが作成されます。Oracle APEXのインストールはユーザーoracleにて実行します。

su - oracle

[root@localhost ~]# su - oracle

Last login: Tue Jan 27 13:36:18 JST 2026

[oracle@localhost ~]$ 


Oracle APEXのメディアを、仮想マシンにダウンロードします。

Use this link for the latest version updateのリンクは以下です。
https://download.oracle.com/otn_software/apex/apex-latest.zip

作業は、ユーザーoracleのホーム・ディレクトリ/home/oracleで行います。

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

[oracle@localhost ~]$ 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    0     0  7694k      0  0:00:38  0:00:38 --:--:-- 7728k

[oracle@localhost ~]$ 


ダウンロードしたapex-latest.zipを解凍します。apexというディレクトリ以下にzipファイルの内容が展開されます。

unzip -q apex-latest.zip
ls apex

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

[oracle@localhost ~]$ ls apex

apexins1.sql                apxdevrm.sql        apxrtins.sql

apexins2.sql                apxdvins_cdb.sql    apxsilentins.sql

apexins3.sql                apxdvins_nocdb.sql  builder

apexins_adb_ext.sql         apxdvins.sql        core

apexins_adb.sql             apxdwngrd.sql       coreins2.sql

apexins_cdb.sql             apxpatch_cdb.sql    coreins3.sql

apexins_nocdb.sql           apxpatch_nocdb.sql  coreins4.sql

apexins.sql                 apxpatch.sql        coreins5.sql

apex_rest_config_cdb.sql    apxremov1.sql       coreins.sql

apex_rest_config_core.sql   apxremov2.sql       dbcsconf.sql

apex_rest_config_nocdb.sql  apxremov_cdb.sql    dbcsins.sql

apex_rest_config.sql        apxremov_nocdb.sql  devins.sql

appins.sql                  apxremov.sql        images

apxappcon_ext.sql           apxrtins1.sql       LICENSE.txt

apxappcon.sql               apxrtins2.sql       load_trans.sql

apxchpwd.sql                apxrtins3.sql       utilities

apxdevrm_cdb.sql            apxrtins_cdb.sql

apxdevrm_nocdb.sql          apxrtins_nocdb.sql

[oracle@localhost ~]$ 


ダウンロードしたメディアのAPEXのバージョンを確認します。images以下のapex_version.txtの内容を表示します。

cat apex/images/apex_version.txt

[oracle@localhost ~]$ cat apex/images/apex_version.txt

Oracle APEX Version:  24.2

[oracle@localhost ~]$ 


APEXのアプリケーションが必要とする静的ファイルを/i/24.2.0にコピーします。24.2.0の部分はインストールするAPEXのバージョンによって変わります。

mkdir i
cp -r -p apex/images i/24.2.0

[oracle@localhost ~]$ mkdir i

[oracle@localhost ~]$ cp -r -p apex/images i/24.2.0

[oracle@localhost ~]$ 


これらのファイルをCDNから取得するようにOracle APEXを構成する場合は、/i/24.2.0の作成は不要です。

作成されたディレクトリapexへ移動します。

cd apex

[oracle@localhost ~]$ cd apex

[oracle@localhost apex]$ 


ユーザーsysでPDB、FREEPDB1に接続し、Oracle APEXのインストール・スクリプトapexins.sqlを実行します。インストール・スクリプトに与える引数はSYSAUX SYSAUX TEMP /i/24.2.0/です。APEXのインストール先となる表領域として標準で作成されているSYSAUXを指定しています。一時表領域としてTEMPを使い、イメージのパスには複数のAPEXのバージョンを同時にホストできるように、バージョン番号を加えて/i/24.2.0/としています。

NLS_LANGとして、必ずAmerican_America.AL32UTF8を設定します。

export NLS_LANG=American_America.AL32UTF8
. oraenv
ORACLE_SID = [oracle] ? FREE
sqlplus sys/*******@localhost/freepdb1 as sysdba
@apexins SYSAUX SYSAUX TEMP /i/24.2.0/

[oracle@localhost apex]$ export NLS_LANG=American_America.AL32UTF8

[oracle@localhost apex]$ . oraenv

ORACLE_SID = [oracle] ? FREE

The Oracle base has been set to /opt/oracle

[oracle@localhost apex]$ sqlplus sys/********@localhost/freepdb1 as sysdba


SQL*Plus: Release 23.26.0.0.0 - Production on Tue Jan 27 14:16:42 2026

Version 23.26.0.0.0


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



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> @apexins SYSAUX SYSAUX TEMP /i/24.2.0/

...set_appun.sql


PL/SQL procedure successfully completed.














...set_ufrom_and_upgrade.sql


PL/SQL procedure successfully completed.







Session altered.



FOO3

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

install2026-01-27_14-16-50.log


. ORACLE

.

. Oracle APEX Installation.

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

.


[中略]


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.07



timing for: Complete Installation

Elapsed:    2.62


SYS> 


apexins.sqlの終了後、続けて日本語リソースを導入します。load_trans.sqlに引数としてJAPANESEを与えて実行します。

@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

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_00203

--application/pages/page_00204

--application/pages/page_00205

--application/pages/page_00206

--application/deployment/definition

--application/deployment/checks

--application/deployment/buildoptions

--application/end_environment

... elapsed: 1.91 sec

...done

Adjust instance settings


PL/SQL procedure successfully completed.


SYS> 


APEXの管理ユーザーの設定を行います。apxchpwd.sqlを実行します。設定するパスワードは以下のルールに従う必要があります。
  • 少なくても1文字の数値を含む。(0123456789)
  • 少なくても1文字の記号を含む。(!"#$%&()``*+,-/:;?_)
  • 少なくても1文字の大文字を含む。
@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> 


データベース・ユーザーAPEX_PUBLIC_USERアンロックします。パスワードの設定は不要です。

set feedback on
alter user apex_public_user no authentication account unlock;

SQL> set feedback on

SQL> alter user apex_public_user no authentication account unlock;


User altered.


SQL> 


プロシージャAPEX_WEB_SERVICE.MAKE_REST_REQUESTを呼び出してHTTPのコールアウトができるように、スキーマAPEX_240200にネットワークACLによる許可を追加します。
begin
    dbms_network_acl_admin.append_host_ace(
        host => '*',
        ace => xs$ace_type(
            privilege_list => xs$name_list('connect'),
            principal_name => 'APEX_240200',
            principal_type => xs_acl.ptype_db
        )
     );
     commit;
end;
/

SYS> begin

    dbms_network_acl_admin.append_host_ace(

        host => '*',

        ace => xs$ace_type(

            privilege_list => xs$name_list('connect'),

            principal_name => 'APEX_240200',

            principal_type => xs_acl.ptype_db

        )

     );

     commit;

end;

/  2    3    4    5    6    7    8    9   10   11   12  


PL/SQL procedure successfully completed.


SYS> 


以上でOracle APEXのデータベースへのインストールは完了です。sqlplusよりexitします。

exit

SYS> exitSYS> 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

[oracle@localhost apex]$ 


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

cd
rm apex-latest.zip

[oracle@localhost apex]$ cd

[oracle@localhost ~]$ rm apex-latest.zip 

[oracle@localhost ~]$ 


この後にOracle REST Data Servicesをインストールすることにより、Oracle APEXを利用できるようになります。

続く