Friday 7 June 2024

Running the Oracle 23ai Autonomous Database Free Container Image

 With the Oracle Database 23ai comes a new deployment option, the free Autonomous Database Free Container Image. It gives developers the option to develop with an Autonomous Database even when not connected to the internet, eg. when travelling. This post shows how to set it up on Oracle Linux 9.4, in my case it is running in a VirtualBox VM on my Windows desktop PC. For details, see the official documentation, this is only meant as a quick runthrough.

Following the documentation, start with

podman machine init 
podman machine set --cpus 4 --memory 8192 
podman machine start 

Maybe it is just my system, but when running podman machine init I get the error qemu-system-x86_64: executable file not found in $PATH. A post on forums.oracle.com described the following solution, which worked on my system:

sudo ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64

The podman command should run now, so follow the steps from the documentation.

podman pull container-registry.oracle.com/database/adb-free:latest-23ai
podman images container-registry.oracle.com/database/adb-free:latest-23ai

That image should show up on your system:
It is important to choose a password which is compliant with the images policy "The ADMIN_PASSWORD must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric".
Choosing a too simple password results in a runtime error, check with podman logs adb-free.
Then start a container with that image, in my case an ATP instance. 

podman run -d \
-p 1521:1522 \
-p 1522:1522 \
-p 8443:8443 \
-p 27017:27017 \
-e WORKLOAD_TYPE='ATP' \
-e WALLET_PASSWORD=*** \
-e ADMIN_PASSWORD=*** \
--cap-add SYS_ADMIN \
--device /dev/fuse \
--name adb-free \
container-registry.oracle.com/database/adb-free:latest-23ai

If nothing went wrong, you should see the container running.
So let's try some stuff. First open Database Actions by browsing https://localhost:8443/ords/sql-developer (and accept the self signed certificate), login with admin and your super secure password from above.
Also APEX works ootb, just login again with your password from above.
To access the ADB from outside with your favorite tooling, copy the wallet from to image to a folder. For SQLDeveloper, we need it as a zip.

podman cp adb-free:/u01/app/oracle/wallets/tls_wallet ~/tls_wallet
zip adb-free-wallet.zip tls_wallet/*

Use that wallet zip file in your tool of choice, in my case VSCodium with the Oracle SQL Developer Extension for VSCode.
Welcome to the Oracle 23ai Autonomous Database Free Container Image.
As long as your podman is ready to run and you respect the password compliancy, this is setup within minutes.