Oracle AI Database Free
A Conn3x circuit that installs Oracle AI Database Free on Rocky Linux and creates its database, the way Oracle’s own RPM install does it, without anyone typing a password into the configure script. You get the FREE container database, its FREEPDB1 pluggable database and a listener on port 1521, started at boot.
Oracle AI Database Free is free to use, under Oracle’s licence rather than an open-source one, so the circuit asks you to accept it first. Until accept_oracle_license is true, the plan stops before it touches a host.
It’s Database Free only. Oracle limits it to two CPU cores, 2 GB of memory and 12 GB of user data, whatever the host has. Other editions need a licence agreement with Oracle, and this circuit doesn’t install them.
variable "oracle_password" { type = string ephemeral = true sensitive = true}
module "oracle_free" { source = "github.com/conn3xorg/circuit-oracle-free?ref=v0.1.0"
hosts = { db = "192.168.1.50" } ssh_private_key_file = "~/.ssh/id_ed25519"
# Read https://www.oracle.com/downloads/licenses/oracle-free-license.html # first: this accepts it. accept_oracle_license = true admin_password = var.oracle_password}Then run conn3x init and conn3x apply with the password in the environment:
export TF_VAR_oracle_password='...'conn3x applyThe first apply downloads about 1.5 GB from Oracle and takes a few minutes to create the database. A second conn3x plan says No changes. Every plan needs the password too, since Conn3x checks the file on the host against it.
Connect from the host with the connect_strings output, such as sqlplus system@//127.0.0.1:1521/FREEPDB1, with sqlplus from the oracle_home output’s bin.
The circuit reads each host’s release and architecture before it plans, so the hosts must exist already. To try it on a throwaway container first, see examples/local.
What it does
Section titled “What it does”On each host, in order:
- Installs
curlfor the downloads,iprouteto find the host’s address, andhostname, which Oracle’s configure script uses. - Makes sure the host’s name resolves to an address other than loopback. Oracle’s listener setup refuses a name that only resolves to
127.0.0.1, which is what cloud images such as DigitalOcean’s write in/etc/hosts. Where that’s so, the circuit adds a line mapping the name to the source address of the default route, in/etc/hostsand in cloud-init’s/etc/cloud/templates/hosts.redhat.tmpl, which/etc/hostsis written from at boot. - Downloads Oracle’s preinstall package,
oracle-ai-database-preinstall-26ai, from yum.oracle.com, checks its SHA-256 against the one on Oracle’s download page and installs it withdnf, which brings in what the database needs from Rocky Linux’s own repositories. The package creates theoracleuser and its groups, and sets the kernel settings and limits Oracle asks for. - Downloads the database RPM,
oracle-ai-database-free-26ai, from download.oracle.com, checks its SHA-256 againstoracle_free_sha256, installs it and deletes it, so the 1.5 GB file doesn’t stay on disk. The Oracle home lands in/opt/oracle/product/26ai/dbhomeFree. - Writes the password to
/etc/conn3x/oracle-free/password(root only, mode 0600), and setsLISTENER_PORT=1521in/etc/sysconfig/oracle-free-26ai.conf. Left empty, configure would take the next free port when 1521 is busy; set, it stops instead. - Runs
/etc/init.d/oracle-free-26ai configureonce, with the password on its standard input. It creates the database in/opt/oracle/oradataand sets the same password forSYS,SYSTEMandPDBADMIN. - Writes a systemd unit,
oracle-free-26ai.service, that starts and stops the database through Oracle’s script, and keeps it enabled at boot. The RPM ships only the SysV script. - Logs in to
FREEPDB1asSYSTEMover the listener. If that fails, such as after a change toadmin_password, it sets the password for all three accounts through theoracleuser’s own login, which needs none, and logs in again. The password reachessqlpluson standard input, so it never shows inps, and only goes to a listener port held by theoracleuser.
Which builds Oracle makes
Section titled “Which builds Oracle makes”Oracle builds Database Free for these, and the circuit stops at the plan on any other host:
| x86_64 | aarch64 | |
|---|---|---|
| Rocky Linux 9 | Yes | Yes |
| Rocky Linux 10 | Yes | No |
What it doesn’t cover
Section titled “What it doesn’t cover”- Other editions. Database Free only.
- Other distributions. Oracle’s RPM targets Oracle Linux and RHEL. Rocky Linux runs it unchanged, and it’s the only one this circuit installs on.
- Upgrades. Only 23.26.3-1 has been tested. Setting
oracle_free_versionto a newer release makes the circuit install that RPM withdnf, but it doesn’t patch the database with datapatch; Oracle’s guide covers that. - Users, schemas and other settings. The circuit manages the three administrative passwords and nothing else in the database. The character set and data file location stay at the defaults in
/etc/sysconfig/oracle-free-26ai.conf, AL32UTF8 and/opt/oracle/oradata, and the listener is on 1521. - Firewall. The circuit opens no ports. The listener takes connections on every address on 1521, and the firewall circuit can open or close it.
- Removal. Taking the module out leaves Oracle installed and the database in place.
/etc/init.d/oracle-free-26ai deleteremoves the database, anddnf remove oracle-ai-database-free-26aithe software.
Inputs
Section titled “Inputs”| Name | Type | Default | Description |
|---|---|---|---|
hosts |
any | Required | Rocky Linux hosts to configure, by name. Each value is an address, such as "203.0.113.10", or a host object such as { address = "203.0.113.10", host_key = "ssh-ed25519 AAAA..." }. A host object can also set user, port, private_key_file and jump_hosts. The two forms can be mixed. |
ssh_user |
string | "root" |
User to log in as. |
ssh_port |
number | 22 |
SSH port. |
ssh_private_key_file |
string | null |
Path to a private key. When null, Conn3x uses the SSH agent. |
ssh_known_hosts_file |
string | null |
known_hosts file to check host keys against. When null, ~/.ssh/known_hosts. Not used for a host object with host_key. |
ssh_become |
bool | false |
Run commands as root through sudo. Set it when ssh_user isn’t root. |
accept_oracle_license |
bool | Required | true accepts the Oracle Free Use Terms and Conditions. Anything else fails the plan. |
admin_password |
string, ephemeral, sensitive | Required | Password for SYS, SYSTEM and PDBADMIN. 8 to 30 characters: letters, digits, _ and #, starting with a letter, with an uppercase letter, a lowercase letter and a digit. Oracle’s configure script refuses most other punctuation. |
oracle_free_version |
string | "23.26.3-1" |
Release of the oracle-ai-database-free-26ai RPM. Change oracle_free_sha256 with it. |
oracle_free_sha256 |
map(string) | The SHA-256s of 23.26.3-1 | SHA-256 of each build of the RPM, keyed el9.x86_64, el9.aarch64 and el10.x86_64, from Oracle’s download page. |
Outputs
Section titled “Outputs”| Name | Description |
|---|---|
connect_strings |
Easy Connect strings for the container database and FREEPDB1 on each host, from the host itself, such as { db = { cdb = "//127.0.0.1:1521/FREE", pdb = "//127.0.0.1:1521/FREEPDB1" } }. |
oracle_home |
/opt/oracle/product/26ai/dbhomeFree, which holds sqlplus and lsnrctl in bin. |
Requirements
Section titled “Requirements”Requires Conn3x v0.7.0 or later, Rocky Linux 9 or 10 with systemd, outbound HTTPS to download.oracle.com, yum.oracle.com and Rocky Linux’s mirrors, at least 1 GB of free memory when the database is created, and about 10 GB of disk.
Tested on
Section titled “Tested on”Rocky Linux 9 and 10, with Oracle AI Database Free 23.26.3. CI applies examples/local to a Rocky Linux 10 container and a Rocky Linux 9 one on amd64, checks that the second plan has no changes and that the password isn’t in the state, logs in to FREEPDB1 as SYSTEM over the listener, writes a row and reads it back, checks a wrong password is refused, restarts the host, reads the row again and plans again with no changes. CI also checks that a plan with accept_oracle_license = false stops with the licence message. The same checks passed by hand in an arm64 Rocky Linux 9 container, along with a change to admin_password, after which SYS, SYSTEM and PDBADMIN all logged in with the new one.
On a Rocky Linux 9 droplet and a Rocky Linux 10 droplet, each with 2 vCPUs, 4 GB of memory and SELinux enforcing, the apply passed, the second plan had no changes, a row written as SYSTEM read back and a wrong password was refused. Both came back after a reboot with the database open and the row there, the plan had no changes, and the audit log had no denials. The database took about 8 GB of disk.
License
Section titled “License”MPL-2.0. See LICENSE. Oracle AI Database Free itself is under the Oracle Free Use Terms and Conditions, and this circuit doesn’t include any of it: each host downloads it from Oracle.
Source
Section titled “Source”- Repository: conn3xorg/circuit-oracle-free. This page covers v0.1.0; the repository’s tags list every release.
- Examples: examples/local.
- Related circuits: Firewall, PostgreSQL, MariaDB, MySQL, SQL Server, CouchDB, Valkey, OpenSearch, SQLite, Cassandra, InfluxDB 3 Core.