Oracle AI Database 26ai Free is the free edition of Oracle's database for developers and learners. It has the features a developer uses, including SQL, PL/SQL, JSON, graphs, AI Vector Search, JavaScript, and Oracle Text, with limits on resources: 2 CPU threads, 2 GB of memory, and 12 GB of user data. Code you write on it runs unchanged on the Enterprise and Standard Editions and on Oracle's cloud databases.
This guide installs it natively on Oracle Linux 8 or 9 from Oracle's RPM packages, so it runs as a systemd service that starts at boot. Red Hat Enterprise Linux 8 and 9 work the same way, with one extra step noted below. You will also see how the container database is organized, how clients connect through the listener, and how to start, stop, and troubleshoot the database.
Code for This Guide
The SQL examples are files 02 and 03 in the examples/install folder of the Oracle Database 26ai code repository on GitHub, each with its output.
They come from Oracle Database 26ai SQL and PL/SQL Book.
Requirements
The database ships as RPM packages for Linux x86-64 and Linux on Arm (aarch64).
| Requirement | Value |
|---|---|
| Operating system, x86-64 | Oracle Linux 8 or 9, or Red Hat Enterprise Linux 8 or 9 (release 10 of both is also supported) |
| Operating system, aarch64 | Oracle Linux 8 (8.6 or later) or 9 (9.4 or later), with the Unbreakable Enterprise Kernel 7 |
| Privileges | root, or an account that can use sudo |
| Memory | 1 GB minimum, 2 GB recommended |
| Swap | 2 GB, or twice the memory, whichever is less |
| Disk | About 9 GB under /opt for the software and database, plus room for your data |
Three rules catch people out:
- One Free database per host. A second Free database on the same server, virtual machine, or container refuses to start with ORA-00442. Remove any older XE or Free installation first.
- /opt/oracle must be a real directory, not a symbolic link. If /opt is small, mount a separate file system at /opt/oracle.
- The host name must resolve to an address other than the loopback address, or the configuration script fails.
Step 1: Prepare the Server
As your administrator account, update the system and check that the host name resolves.
Example:
sudo dnf -y update hostname -f getent hosts "$(hostname -f)"
If the last command prints nothing, or only 127.0.0.1, add a line with the server's real address and name to /etc/hosts, for example 192.168.1.50 dbsrv.example.com dbsrv, and check again.
Step 2: Install the Preinstallation RPM
The preinstallation package installs the libraries the database needs, creates the oracle user and the oinstall and dba groups, and sets kernel parameters and resource limits. On Oracle Linux it is in the standard repositories.
Example:
sudo dnf -y install oracle-ai-database-preinstall-26ai
On Red Hat Enterprise Linux, download the latest oracle-ai-database-preinstall-26ai file from Oracle's yum server (for release 9, https://yum.oracle.com/repo/OracleLinux/OL9/appstream/x86_64/; for release 8, the OL8 folder and the el8 file) and install the file with dnf -y install ./file-name.rpm.
The kernel settings it changed are logged in /var/log/oracle-ai-database-preinstall-26ai/results/orakernel.log and kept in /etc/sysctl.d/97-oracle-database-sysctl.conf. The oracle user has no password, which is how it should stay; reach it with sudo -iu oracle.
Step 3: Install the Database RPM
Download the RPM for your release and processor from Oracle's Oracle AI Database Free download page. At the time of writing, the release is 23.26.3, and the files are named like this:
| Platform | File |
|---|---|
| Oracle Linux 8 / RHEL 8, x86-64 | oracle-ai-database-free-26ai-23.26.3-1.el8.x86_64.rpm |
| Oracle Linux 9 / RHEL 9, x86-64 | oracle-ai-database-free-26ai-23.26.3-1.el9.x86_64.rpm |
| Oracle Linux 8, aarch64 | oracle-ai-database-free-26ai-23.26.3-1.el8.aarch64.rpm |
| Oracle Linux 9, aarch64 | oracle-ai-database-free-26ai-23.26.3-1.el9.aarch64.rpm |
Each is about 1.5 GB. You can download it on the server itself; for Oracle Linux 9 on x86-64:
Example:
cd /tmp BASE=https://download.oracle.com/otn-pub/otn_software/db-free RPM=oracle-ai-database-free-26ai-23.26.3-1.el9.x86_64.rpm curl -LO "$BASE/$RPM" sudo dnf -y install "./$RPM"
If a newer release is out, copy its file name from the download page. The package installs the software into the Oracle home, /opt/oracle/product/26ai/dbhomeFree, but does not create a database yet.
Step 4: Create the Database
The configuration script creates the database and the listener. Its defaults are listener port 1521, character set AL32UTF8, and database files under /opt/oracle/oradata. To change them, copy and edit /etc/sysconfig/oracle-free-26ai.conf first.
| Setting | Meaning |
|---|---|
| LISTENER_PORT | The listener port; leave it at 1521 unless the port is taken |
| CHARSET | The database character set; keep AL32UTF8 |
| DBFILE_DEST | The folder for the database files; it must belong to oracle |
| SKIP_VALIDATIONS | true skips the memory and disk checks; leave it false |
| CONFIGURE_TDE, ENCRYPT_TABLESPACES | Transparent Data Encryption, off by default |
Example:
sudo /etc/init.d/oracle-free-26ai configure
The script asks twice for one password, which becomes the password of SYS, SYSTEM, and PDBADMIN. Use at least eight characters with uppercase and lowercase letters and a digit. Creating the database takes several minutes. If it fails, read FREE.log in /opt/oracle/cfgtoollogs/dbca/FREE.
Step 5: Start the Database at Boot
The database is running now, but it will not start after a reboot until you enable its service.
Example:
sudo systemctl daemon-reload sudo systemctl enable oracle-free-26ai sudo /etc/init.d/oracle-free-26ai status
The status command reports the listener and the FREE database; both should be RUNNING. From now on, systemd starts them at boot and shuts the database down cleanly when the server stops.
Step 6: Set Up the oracle User's Environment
SQL*Plus, lsnrctl, and the other tools need ORACLE_HOME, ORACLE_SID, and PATH. Oracle's oraenv script sets them; add it to the oracle user's profile so every shell has them.
Example:
sudo -iu oracle cat >> ~/.bash_profile <<'EOF' # Oracle AI Database 26ai Free export ORACLE_SID=FREE export ORAENV_ASK=NO export ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree . /opt/oracle/product/26ai/dbhomeFree/bin/oraenv > /dev/null EOF . ~/.bash_profile which sqlplus
ORAENV_ASK=NO stops oraenv from prompting, and the last command prints /opt/oracle/product/26ai/dbhomeFree/bin/sqlplus.
Step 7: Connect and Look Around
The oracle user can connect as SYS without a password. This operating-system authentication works even when the listener is down, which makes it the tool for maintenance.
Example:
sqlplus / as sysdba
The Container Database and Its PDBs
An Oracle database is a container database (CDB). Its root, CDB$ROOT, holds Oracle's own metadata and is administered by SYS. PDB$SEED is a read-only template for new databases. The pluggable databases (PDBs) hold the users, schemas, and data of applications; each looks like a database of its own to the applications that connect to it, and can be unplugged, moved, and cloned. Oracle AI Database Free comes with one PDB, FREEPDB1, which is where your own schemas belong.
SHOW PDBS lists the PDBs, and v$containers lists every container, root included.
Example:
alter session set container = cdb$root; -- the root of the container database show pdbs select con_id, name, open_mode from v$containers order by con_id;
Output:
Session altered.
CON_ID CON_NAME OPEN MODE RESTRICTED
_________ ___________ _____________ _____________
2 PDB$SEED READ ONLY NO
3 FREEPDB1 READ WRITE NO
CON_ID NAME OPEN_MODE
_________ ___________ _____________
1 CDB$ROOT READ WRITE
2 PDB$SEED READ ONLY
3 FREEPDB1 READ WRITETo work inside the PDB as SYS, move the session there with alter session set container = FREEPDB1;.
Services and the Listener
Clients do not connect to database files but to a service, through the listener, a process that accepts connections on port 1521 and hands them to the database. Each container has a service of its own name: free for the root and freepdb1 for the PDB. Applications and developers connect to the PDB's service; only administrators connect to the root.
Example:
alter session set container = cdb$root; select name, con_name from v$active_services where name not like 'SYS$%' order by 1;
Output:
Session altered. NAME CON_NAME ___________ ___________ free CDB$ROOT freeXDB CDB$ROOT freepdb1 FREEPDB1
If the server has a domain, the service names include it, for example freepdb1.example.com. lsnrctl status shows the listener and the services it knows; the list at the end should include FREE and freepdb1.
Example:
lsnrctl status
Through the listener, connect to the PDB with SQLcl or SQL*Plus using host, port, and service.
Example:
sql system@localhost:1521/FREEPDB1
Connect from Another Computer
Port 1521 is closed by firewalld. The safest way to reach the database from your desktop is an SSH tunnel, which forwards port 1521 on your computer to the server through the SSH connection you already have.
Example:
ssh -L 1521:localhost:1521 you@dbsrv.example.com
While the tunnel is open, localhost:1521/FREEPDB1 on your desktop reaches the server's database. Open the port only on a network you trust.
Example (open the port instead):
sudo firewall-cmd --permanent --add-port=1521/tcp sudo firewall-cmd --reload
Start and Stop the Database
The service is the normal way to start and stop it, and systemd does it for you at boot and shutdown.
Example:
sudo systemctl stop oracle-free-26ai sudo systemctl start oracle-free-26ai sudo /etc/init.d/oracle-free-26ai status
An administrator can also do it in SQL*Plus, connected as SYSDBA to the root.
Example:
shutdown immediate -- close the database: sessions are disconnected startup -- start the instance and open the database alter pluggable database freepdb1 close; -- close one PDB alter pluggable database freepdb1 open; alter pluggable database freepdb1 save state; -- reopen it automatically after a restart
SHUTDOWN IMMEDIATE rolls back open transactions and closes the database cleanly. SHUTDOWN ABORT stops it at once, and the next startup recovers it.
Where Things Live
| What | Location |
|---|---|
| Oracle home | /opt/oracle/product/26ai/dbhomeFree |
| Database files | /opt/oracle/oradata/FREE |
| Alert log | /opt/oracle/diag/rdbms/free/FREE/trace/alert_FREE.log |
| Configuration parameters | /etc/sysconfig/oracle-free-26ai.conf |
| Configuration and service script | /etc/init.d/oracle-free-26ai |
| Database creation logs | /opt/oracle/cfgtoollogs/dbca/FREE |
| Service events | journalctl -u oracle-free-26ai |
Troubleshooting
| Problem | Fix |
|---|---|
| ORA-00442: Oracle Database Free single instance violation | Another Free or XE installation runs on this host. Remove it. |
| Configuration fails with "No valid IP Address returned for the host" | Fix /etc/hosts as in Step 1, run sudo /etc/init.d/oracle-free-26ai delete, and configure again. |
| ORA-12541: No listener at host localhost port 1521. | Start everything with sudo systemctl start oracle-free-26ai, and check lsnrctl status. |
| ORA-12514: Service FREEPDB1 is not registered with the listener. | Wait a minute for the database to open. If it persists, run alter pluggable database all open; and then alter pluggable database freepdb1 save state; as SYS. |
| ORA-01017: invalid credential or not authorized | As oracle, connect with sqlplus / as sysdba and run alter user system identified by "New_Password_1" container = all;, and the same for SYS. |
| sqlplus: command not found, or ORA-12162 | The oracle user's environment is not set. Check ~/.bash_profile from Step 6 and open a new shell with sudo -iu oracle. |
Remove the Database
sudo /etc/init.d/oracle-free-26ai delete deletes the database, its files, and the listener configuration, and sudo dnf remove oracle-ai-database-free-26ai removes the software. This deletes all data, so export what you need first.
Related Guides
- How to Install Oracle APEX 26.1 on Oracle Linux, which adds Java, ORDS, and APEX on top of this database
- Install Oracle Database on macOS Apple Silicon (ARM64) Using Docker
Conclusion
To install Oracle AI Database 26ai Free on Oracle Linux, install oracle-ai-database-preinstall-26ai and the database RPM, run /etc/init.d/oracle-free-26ai configure to create the FREE container database with FREEPDB1, and enable the oracle-free-26ai service. Set the oracle user's environment with oraenv, connect with sqlplus / as sysdba for maintenance, and connect applications through the listener to localhost:1521/FREEPDB1.
