Yesterday Oracle released their latest Autonomous database offering in a container image to try (most of) the Automous database technology without requiring access to the Oracle Cloud (OCI). This helps developers to get used to the Autonomous database and have a quick method of getting started with APEX development. This image is also something you can include in your on-premise/on-device development (CI/CD) pipeline. Having used Autonomous databases on OCI, I was curious to see what this container could offer and how it works.
Getting started requires a Podman installation. I’ve tried to use Docker at first, but this resulted in a database not being started, due to missing/unable to write to files. (It seems to use some overlay filesystem that at least in my quick experiment with Docker did not succeed.) Make sure the Podman machine has enough memory and CPU, Oracle recommends to use 4 cpu’s and 8GiB of memory.
Fetching the image and getting it to start is fairly easy, can be copied even from the documentation page.
$ podman pull container-registry.oracle.com/database/adb-free:latest $ podman run -d \ -p 1521:1521 \ -p 1522:1522 \ -p 8443:8443 \ -p 27017:27017 \ --hostname localhost \ --cap-add SYS_ADMIN \ --device /dev/fuse \ --name adb_container \ container-registry.oracle.com/database/adb-free:latest
This will result in a running container with the name adb_container. Within this container a Container database is running with 2 Autonomous databases named MY_ATP and MY_ADW. Additionally, ORDS is started so SQLDeveloperWeb, APEX and Mongodb access is possible to both Autonomous databases. Just like a real Autonomous database, all traffic is TLS enabled, port 1521 has only a TLS listener, port 1522 is a mTLS listener. Port 8443 is https to the ORDS installation and finally the. mongodb connection can be made using port 27017.
Connect to the SQLDeveloperWeb environment using the url https://localhost:8443/ords/my_atp/sql-developer/. Doing this with the user ADMIN and the provided default password did not result in a working session, the password is by default expired (which SQLDeveloperWeb does not seem to be able to handle at this time). There are instructions to reset the passwords using a script, however my plan was to look inside a bit.
podman exec -it adb_container /bin/bash results in a nice shell in the running container. The environment is completely set and user oracle is also the current user, so sqlplus is easily found and used to connect:
Having set the password (and note, Autonomous is really strict by default, ORA_STIG password policy is enabled) the SQLDeveloperWeb can now be accessed:
Connecting from a “real” SQLDeveloper requires wallet zipfile (to provide SQLDeveloper with the self-signed certificates and connection urls) which can be copied from the container:
$ podman cp adp_container:/u01/app/oracle/wallets/tls_wallet mywallet $ cd mywallet $ zip -r ../mywallet.zip *
Use this wallet file to feed into SQLDeveloper:
I did not need to edit the tnsnames.ora file as the database is reachable here using localhost. make sure to edit if the port numbers are different on the outside of the container.
Loading data into the database(s) can be done using impdp, a directory object needs to be created for this to work. A new package DBMS_CLOUD_CONTAINER_ADMIN was created to make this possible. The procedure create_export_directory manages the directory object ORA_EXP_DIR which can then be used by a remote impdp command or a PL/SQL block can be used like the example(s) on the Oracle documentation page.
In conclusion this container image is a really fast way to get the two types of Autonomous databases running with the nice addition of a fully configured ORDS environment without the need for a OCI cloud account.