ラベル データベース の投稿を表示しています。 すべての投稿を表示
ラベル データベース の投稿を表示しています。 すべての投稿を表示

2023年4月7日金曜日

Oracle AI Database 26ai Free VirtualBox ApplianceでOracle APEXを使う

更新: 2026年1月30日

Oracle AI Database 26ai Freeは、VirutalBoxの仮想マシンとしても提供されています。

ダウンロード

以下が概要になります。
  • Oracle Linux 8.10
  • Oracle AI Database 23.26
  • Oracle REST Data Services 25.3
  • Oracle SQLcl 25.3
  • Oracle APEX 24.2
  • JDK 21.0.5
上記の仮想マシンをダウンロードした後、VirtualBox(今回使用したバージョンは7.2.4)にインポートして起動し、Oracle APEXの使い勝手を確認してみました。x86_64しかないため、ARMに移行しているMacユーザーは利用できません。また、残念なことにAPEXは日本語化されていませんでした。

以下より、日本語リソースをロードする方法を紹介します。手順自体は、一般的なOracle APEXの言語リソースのロード作業です。

ダウンロードしたOracle_AI_Database_26ai_Free.ovaをVirtualBoxにインポートした直後の状態から作業を始めます。

インポートした仮想マシンを起動すると、データベースとORDSも同時に起動します。ディスプレイの表示倍率を上げると、コンソールが広くなります。


ターミナルも開きますが、私の環境ではキーマップが異なり、この画面のターミナルからの作業は今ひとつでした。コンソールの外からコピぺもできません。


ネットワークのポートフォワーディングの設定を確認すると、sshのポートがホストの2223に割り当てられています。


なので、ローカルのマシンのターミナルからSSHで接続し、作業をすることにします。

ssh -p 2223 oracle@localhost

~ % ssh -p 2223 oracle@localhost         

The authenticity of host '[localhost]:2223 ([127.0.0.1]:2223)' can't be established.

ED25519 key fingerprint is SHA256:KAd6f3AsAB7inP+X63xYLJWQckmqPyORYKDipVgSPCk.

This key is not known by any other names.

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

Warning: Permanently added '[localhost]:2223' (ED25519) to the list of known hosts.

oracle@localhost's password: ********

Activate the web console with: systemctl enable --now cockpit.socket


Last login: Fri Jan 30 01:44:23 2026

[oracle@localhost ~]$ 


仮想マシンにはOracle APEXの言語リソースが含まれていません(/home/oracle/apex以下にbuilderが含まれていない)。インストールされているOracle APEXのバージョンは24.2であるため、以下のリンクより日本語リソースを含んだアーカイブをダウンロードします。

mkdir temp
cd temp
curl -OL https://download.oracle.com/otn_software/apex/apex_24.2.zip

[oracle@localhost ~]$ mkdir temp

[oracle@localhost ~]$ cd temp

[oracle@localhost temp]$ curl -OL https://download.oracle.com/otn_software/apex/apex_24.2.zip

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

                                 Dload  Upload   Total   Spent    Left  Speed

100  289M  100  289M    0     0  6443k      0  0:00:45  0:00:45 --:--:-- 5718k

[oracle@localhost temp]$ 


ダウンロードしたapex_24.2.zipを解凍します。

unzip -q apex_24.2.zip
ls apex

[oracle@localhost temp]$ unzip -q apex_24.2.zip 

[oracle@localhost temp]$ ls apex

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

[oracle@localhost temp]$ 


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

cd apex
. oraenv   (ORACLE_SIDとしてFREEを指定)
export NLS_LANG=American_America.AL32UTF8
sqlplus sys/******@localhost/freepdb1 as sysdba
@load_trans JAPANESE

[oracle@localhost temp]$ cd apex

[oracle@localhost apex]$ . oraenv

ORACLE_SID = [oracle] ? FREE

The Oracle base has been set to /opt/oracle

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

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


SQL*Plus: Release 23.26.0.0.0 - Production on Fri Jan 30 01:59:08 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> @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 4420 - Oracle APEX Builder, Wizard Messages and Native Plug-Ins

--application/delete_application

--application/create_application

--application/user_interfaces


[中略]


--application/deployment/definition

--application/deployment/checks

--application/deployment/buildoptions

--application/end_environment

... elapsed: 5.87 sec

...done

Adjust instance settings


PL/SQL procedure successfully completed.


SQL> 


プロンプトが返ってきた時点で日本語リソースの導入は完了しています。

APEXの管理サービスには、以下のURLからアクセスできます。


日本語リソースを導入しているため、言語として日本語を選択できます。管理者のユーザー名はADMINです。パスワードは仮想マシンのコンソールで開いているWebページまたはターミナルに記載されています。


管理にサインインできます。


APEXのワークスペースとして、HR_DEVが作成済みです。ユーザーHR_ADMINでサインインできます。パスワードは仮想マシンのコンソールで開いているWebページまたはターミナルに記載されています。



APEXのアプリケーション・ビルダーが開きます。


データベース・アクション(SQL Developer Web)への接続も確認します。

http://localhost:8080/ords/sql-developer

詳細をクリックし、パス指定を開きます。

SQL Developer Webでは、ユーザーHRがあらかじめ作成されています。パスはhr、ユーザー名もhrにてサインインできます。


SQL Developer Webが開きます。


以上で、Oracle APEXのアプリケーションを開発する準備ができました。

完

2022年11月22日火曜日

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

更新: 2026年1月28日

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 2223 root@localhost

~ % ssh -p 2223 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-bitはOracle Linux 8 for Arm(aarch64)のセクションを参照します。


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


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

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

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-bitはOracle Linux 8 for Arm(aarch64)のセクションを参照します。


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


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

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

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.1-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月28日の時点で実行したコマンドです。

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.1-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を実行して、SYS、SYSTEMおよびPDBADMINのパスワードとなる文字列を2回入力します。

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

マルチテナント構成のデータベース・インスタンスが作成されます。SIDはFREE、作成されるPDBはFREEPDB1です。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.1-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のインストールは完了です。

続く