Oracle Database 23ai Free on Oracle Linux 8
Videos
Overview: Oracle Database 23ai Free on Oracle Linux 8 on Azure: overview (watch on YouTube)
Launch and log in: Oracle Database 23ai Free on Oracle Linux 8 on Azure: launch and log in (watch on YouTube)
Deep Dive: Oracle Database 23ai Free on Oracle Linux 8 on Azure: deep dive (watch on YouTube)
Overview
Oracle AI Database 26ai Free, release 23.26, is Oracle's current Free release and the direct successor of Oracle Database 23ai Free. This image runs it on Oracle Linux 8. The FREE container database and its FREEPDB1 pluggable database are created and open when you first log in. The database and listener start by themselves at every boot.
This guide covers deploying SecureAnyCloud's Oracle DB 23ai Free on OL8 image from the Azure Marketplace (offer oracle-db-23ai-free-oel8).
Every virtual machine gets its own database password on its first boot. Nothing is shared between virtual machines. On two virtual machines deployed from the same image, each one's password was rejected by the other with ORA-01017.
What you get
- Oracle AI Database 26ai Free, release 23.26.3 (64-bit), installed at
/opt/oracle/product/26ai/dbhomeFree. - The
FREEcontainer database (CDB) with theFREEPDB1pluggable database (PDB), open in read-write mode. - The Oracle Net Listener on TCP port 1521, listening on all interfaces.
- The
oracle-free-26aiservice, which starts the database and the listener at boot. - A first-boot service,
oracle-free-firstboot, that sets a new random password forSYS,SYSTEMandPDBADMINon each virtual machine. - SQL*Plus and SQLcl (
sql). SQLcl and the database tools run on the operating system's OpenJDK 17, whichdnfkeeps up to date. - AI Vector Search, JSON Relational Duality and the other features of Oracle Database Free.
- Oracle Linux 8.10 with the Unbreakable Enterprise Kernel, SELinux enforcing, firewalld and chronyd running, and the Azure Linux Agent (waagent) for provisioning.
- A Hyper-V Generation 2 virtual machine.
- 24/7 SecureAnyCloud support.
Default user: azureuser. CDB: FREE. PDB: FREEPDB1. Port: 1521. Credentials: /stage/scripts/oracle-database-credentials.log.
Prerequisites
- An active Microsoft Azure subscription.
- The Azure CLI, installed locally or in Azure Cloud Shell (for Option B).
- An SSH key pair.
- A network security group that allows SSH (TCP 22) from your own network only. Open TCP 1521 only if you will connect to the database from outside the virtual machine, and only from your own IP address (Step 7).
Deploy the Virtual Machine
Option A: Azure Portal
- Open the Oracle DB 23ai Free on OL8 by SecureAnyCloud listing on the Azure Marketplace. Choose Get it now, then Create.
- Configure the basics:
- Subscription: Select your Azure subscription.
- Resource Group: Create a new one or select an existing one.
- Virtual Machine Name: Enter a name for your VM.
- Region: Select your preferred Azure region.
- Size: Select a size for your workload. See "Free edition limits" below for the memory the database uses.
- Under Administrator Account, select SSH public key, keep
azureuseras the username and enter your key. - Under Inbound Port Rules, allow SSH (port 22), ideally from your own network only.
- Choose Review + Create, then Create.
Option B: Azure CLI
The image carries a Marketplace purchase plan, so accept its terms once per subscription, then create the virtual machine. Replace <your-vm-size> with the size you chose:
az vm image terms accept --urn sac1647283583153:oracle-db-23ai-free-oel8:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-oracle-free-vm \
--image sac1647283583153:oracle-db-23ai-free-oel8:default:latest \
--size <your-vm-size> \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku StandardConnect over SSH
Run these commands on your own workstation. Find the public IP, then connect:
az vm show --resource-group myResourceGroup --name my-oracle-free-vm --show-details --query publicIps -o tsv ssh azureuser@<vm-ip>There is no password to enter. If SSH asks for one, the key your client is offering is not the key you supplied when you created the VM.
Wait for the first boot to finish
On its first boot, the virtual machine starts the database and then sets its per-VM password. On the virtual machines we checked, this finished about two minutes after boot. Check the status with:
systemctl is-active oracle-free-firstboot oracle-free-26aiBoth lines read active when the database is up and your password is ready. While the first boot is still running, the first line reads activating or inactive. Wait a minute and check again.
The first boot runs once. A later reboot keeps your password.
Read your credentials
Check the file permissions, then read the file:
sudo ls -l /stage/scripts/oracle-database-credentials.log
sudo cat /stage/scripts/oracle-database-credentials.logThe file belongs to root with mode 0600 (-rw-------), so only root can read it. It records when it was generated. It lists one password, generated for this virtual machine, for the SYSTEM, SYS (connect AS SYSDBA) and PDBADMIN (FREEPDB1 only) accounts, with the local and remote connection details.
Change the passwords after your first login (Step 9).
Connect locally with SQL*Plus
The database software belongs to the oracle operating system user, whose profile sets ORACLE_HOME, ORACLE_SID=FREE and the PATH. Switch to that user and connect with operating system authentication, which needs no password:
sudo su - oracle sqlplus / as sysdbaSELECT banner_full FROM v$version; SELECT name, open_mode FROM v$pdbs;The banner reads Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free, and FREEPDB1 is READ WRITE (PDB$SEED is READ ONLY).
To connect to the pluggable database as SYSTEM through the listener, run this command as the oracle user. SQL*Plus asks for the password from Step 4:
sqlplus system@//localhost:1521/FREEPDB1SQLcl is on the oracle user's path as sql and takes the same connect strings:
sql system@//localhost:1521/FREEPDB1A first AI Vector Search query
Oracle Database Free includes AI Vector Search, with a VECTOR column type and the VECTOR_DISTANCE function.
As the oracle user, run sqlplus / as sysdba. This example creates a schema-only account (one that nobody can log in to directly) and a small table of three-number embeddings. It then finds the rows nearest to a query vector:
ALTER SESSION SET CONTAINER = FREEPDB1; CREATE USER demo NO AUTHENTICATION DEFAULT TABLESPACE users QUOTA UNLIMITED ON users; ALTER SESSION SET CURRENT_SCHEMA = demo; CREATE TABLE docs (id NUMBER PRIMARY KEY, title VARCHAR2(40), embedding VECTOR(3, FLOAT32)); INSERT INTO docs VALUES (1, 'Backups', '[0.9, 0.1, 0.0]'); INSERT INTO docs VALUES (2, 'Networking', '[0.1, 0.9, 0.1]'); INSERT INTO docs VALUES (3, 'Restores', '[0.8, 0.2, 0.1]'); COMMIT; SELECT title, ROUND(VECTOR_DISTANCE(embedding, VECTOR('[1, 0, 0]'), COSINE), 3) AS distance FROM docs ORDER BY distance FETCH FIRST 2 ROWS ONLY;TITLE DISTANCE ------------ ---------- Backups .006 Restores .037Real embeddings have hundreds of dimensions and come from an embedding model. The column type, the distance function and the FETCH FIRST pattern are the same.
JSON Relational Duality works on the same table. This view presents each row as a JSON document that can also be updated:
CREATE JSON RELATIONAL DUALITY VIEW docs_dv AS SELECT JSON {'_id': d.id, 'title': d.title} FROM docs d WITH UPDATE; SELECT json_serialize(data) FROM docs_dv WHERE ROWNUM = 1;For your own applications, create a normal user with a password (Step 9) instead of using the schema-only demo account.
Connect remotely
The listener accepts connections on all interfaces, and the virtual machine's own firewall (firewalld) already allows TCP 1521. Your network security group decides who can reach it. Add an inbound rule for TCP 1521 from your own IP address only:
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-oracle-free-vmNSG \
--name allow-oracle-from-my-ip \
--priority 1010 \
--access Allow --protocol Tcp --direction Inbound \
--source-address-prefixes <your-ip>/32 \
--destination-port-ranges 1521az vm create names the security group <vm-name>NSG unless you chose one. Then connect from SQL Developer, SQLcl or any Oracle client with these settings:
- Host: the virtual machine's public IP.
- Port: 1521.
- Service name: FREEPDB1.
- User:
SYSTEM, or the application user you create in Step 9.
sql system@//<vm-ip>:1521/FREEPDB1Never open port 1521 to the whole internet.
Manage the database service
As the azureuser account, run:
sudo /etc/init.d/oracle-free-26ai status
sudo /etc/init.d/oracle-free-26ai stop
sudo /etc/init.d/oracle-free-26ai startstatus reports LISTENER status: RUNNING and FREE Database status: RUNNING. The service is enabled at boot. FREEPDB1 opens in read-write mode again after every start, because its open state is saved.
To see listener details, run:
sudo su - oracle -c 'lsnrctl status'Change passwords and create an application user
As the oracle user, run sqlplus / as sysdba, then run these statements:
-- in the CDB ALTER USER SYSTEM IDENTIFIED BY "<new password>"; ALTER USER SYS IDENTIFIED BY "<new password>"; -- in the PDB ALTER SESSION SET CONTAINER = FREEPDB1; ALTER USER PDBADMIN IDENTIFIED BY "<new password>"; CREATE USER appuser IDENTIFIED BY "<password>" QUOTA UNLIMITED ON USERS; GRANT DB_DEVELOPER_ROLE TO appuser;Then connect your application as appuser@//<vm-ip>:1521/FREEPDB1.
The credentials file is not updated when you change a password. Keep the new passwords in your own password manager, and delete or update the file.
Free edition limits
Under the Oracle Free Use Terms and Conditions, Oracle limits Oracle Database Free to 2 CPU threads, 2 GB of database memory and 12 GB of user data.
On this image, the instance is set to cpu_count 2, a 1.5 GB SGA target and a 512 MB PGA target. The operating system needs memory on top of that, so choose a size with headroom above 2 GB. For larger workloads, move to a licensed Oracle Database edition.
Security notes
- Per-VM password. The first boot sets it on each virtual machine. It is stored only in the root-only credentials file and passed to the database on standard input, never on a command line.
- SSH. Key authentication only (
passwordauthentication no). - Network. The listener (1521) and SSH (22) are the services to expose. firewalld allows
sshand1521/tcp. Keep both behind your network security group, restricted to your own addresses. Oracle's XDB HTTP and HTTPS ports (used by EM Express) are not enabled on this image. Both report port 0. - SELinux. SELinux is enforcing.
- Time zone. The virtual machine's clock is set to US Eastern time (
America/New_York). The credentials file records its time in UTC. To change the time zone, run a command such assudo timedatectl set-timezone Europe/London.
Keeping the system up to date
Update the operating system packages with:
sudo dnf -y upgradeThis updates Oracle Linux and the OpenJDK used by SQLcl and the database tools. The image does not run an update by itself on first boot, so run this command after you deploy and on your normal schedule.
Oracle updates Oracle Database Free itself as new Free releases ship. To move to a newer release, export your data and import it into a new virtual machine.
Back up your data with Data Pump (expdp and impdp, as the oracle user) or with Azure disk snapshots taken while the database is stopped.
Server Components
Component Value
Database Oracle AI Database 26ai Free, release 23.26.3
Oracle home /opt/oracle/product/26ai/dbhomeFree
Container database FREE
Pluggable database FREEPDB1
Listener TCP 1521, all interfaces
Database service oracle-free-26ai (/etc/init.d/oracle-free-26ai)
First-boot service oracle-free-firstboot (log /var/log/oracle-free-firstboot.log)
Credentials /stage/scripts/oracle-database-credentials.log (root, 0600)
Operating system Oracle Linux 8.10
Troubleshooting
- The credentials file is not there yet, or
oracle-free-firstbootis stillactivating: the first boot is still running. Wait a minute and check again. You can also readsudo cat /var/log/oracle-free-firstboot.log, which ends withfirstboot complete. ORA-01017: invalid credential or not authorized; logon denied: the user name or password is wrong for this virtual machine. Use the password from this virtual machine's own credentials file (Step 4), or the one you set in Step 9.- Cannot connect remotely: confirm your network security group allows TCP 1521 from your IP. Also confirm that
sudo ss -tlnp | grep 1521showstnslsnron0.0.0.0:1521. sqlplus: command not found: run it as theoracleuser (sudo su - oracle), whose profile puts the Oracle tools on the path.
Support
SecureAnyCloud provides 24/7 support for this image. Email sales@secureanycloud.com with your virtual machine details and a description of the issue.
Deploy on Azure
Launch Oracle Database 23ai Free on Oracle Linux 8 on Azure with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com