Sub topic 1
Three free ways to get an Oracle database
You can practice Oracle SQL without buying a license or installing a server on your own hardware. Oracle offers three no-cost environments, and they differ in setup effort, control, persistence and what they are good for. This chapter introduces all three and gives you a working model for comparing them. Later chapters cover each one in detail.
Prerequisites
This chapter assumes you already have:
- Basic SQL: you can write
SELECT,INSERTandCREATE TABLEstatements. - Comfort with a terminal: you can run commands and read their output.
- A basic idea of a client-server database: a database server process listens on a network port, and client tools connect to it over the network.
- For the local option only: some familiarity with running a container using Docker or Podman.
You do not need any Oracle-specific knowledge. Terms such as "pluggable database" and "wallet" are defined when they first matter.
What "practice database" means here
A practice database is one where you can create tables, load data, break things and start over without risk to anything important. For Oracle, three things matter most:
- A real Oracle Database engine. SQL behavior, data types and error messages should match what you meet at work. Oracle-specific features such as
VARCHAR2,NUMBER, sequences, identity columns and PL/SQL should all work. - Enough privileges to learn. You should be able to create your own tables and users, not just query sample data.
- Low cost of failure. Mistakes should be cheap to undo, and the environment should be easy to recreate.
All three options below satisfy the first point. They differ mostly on the second and third.
The three options at a glance
| Row | FreeSQL | Oracle Database 26ai Free in a container | Always Free Autonomous Database |
|---|---|---|---|
| Where it runs | Oracle's servers, in your browser | Your machine, in Docker or Podman | Oracle Cloud Infrastructure (OCI) |
| What you install | Nothing | A container runtime and the image | Nothing locally; a cloud account is required |
| Account needed | Optional, to save scripts | No Oracle account to pull the image | Yes, an Oracle Cloud account |
| Administrative control | None | Full (SYS, SYSTEM, PDBADMIN) | Limited (ADMIN user, no OS access) |
| Persistence | Saved scripts only if signed in | As long as you keep the container and its data | Persists while the database is active |
| Works offline | No | Yes | No |
| Best for | Quick experiments, following examples | Learning administration, local development | Cloud features, connecting apps over the network |
The limits in this table are summaries. Oracle changes quotas and policies from time to time, so confirm the current numbers in the official documentation before you rely on them.
FreeSQL: SQL in the browser
FreeSQL is a web site where you type SQL into an editor and run it against an Oracle database that Oracle hosts for you. There is nothing to install and no server to manage. You open the page, write a statement and see the result.
What it gives you:
- A real Oracle Database behind a browser editor, so syntax and results match Oracle.
- Saved scripts if you sign in with an Oracle account. Without signing in, treat your work as temporary.
- Example scripts and a quick way to try a snippet from a tutorial.
What it does not give you:
- A connection from external tools. You cannot point SQL*Plus, SQLcl, or your application at it.
- Administrative control. You work in a sandboxed schema and cannot create other users or change instance settings.
- A long-lived environment you shape yourself. The session is meant for experiments, not for a project you will build over weeks.
Think of FreeSQL as a scratchpad. It is the fastest route to "does this statement work?" and the weakest route to "how do I run and manage a database?"
Oracle Database 26ai Free in a container
Oracle Database Free is a no-cost edition of the Oracle Database engine. Oracle publishes it as a container image in its container registry, so you can run it with Docker or Podman on a laptop or a server. The 26ai release is the current Free version at the time of this tutorial.
A container is a packaged process with its own filesystem. The image already contains a configured database, so you do not run an installer. Starting it looks like this:
docker run -d --name oracle-free \
-p 1521:1521 \
-e ORACLE_PWD='ChangeMe_123' \
container-registry.oracle.com/database/free:latestThe command does three things. It publishes port 1521, the default Oracle listener port, so clients on your machine can reach the database. It sets the password for the administrative accounts through the ORACLE_PWD environment variable. It starts the container in the background. The first start creates the database, which takes a few minutes. The next chapters cover how to know when it is ready and how to connect.
What you get:
- Full control. You can connect as
SYSandSYSTEM, create users, change settings and inspect the instance. - Any client. SQL*Plus, SQLcl, VS Code extensions, JDBC and Python drivers all connect to
localhost:1521. - Offline use, with no cloud account.
What to watch for:
- Resource limits. Free is capped on resources. Oracle documents limits on CPU threads, memory and user data size. They are enough for practice, not for production-scale data.
- Container runtime and memory. The database needs a few gigabytes of RAM available to the container. On a small virtual machine or a laptop with other heavy applications, startup can fail or be slow.
- Persistence. If the container is removed and its data is not stored in a volume, the database goes with it. Later chapters cover this lifecycle.
- Multitenant architecture. The database is a container database (CDB) that holds a pluggable database (PDB) named
FREEPDB1. You do your practice work in the PDB, not in the CDB root. This catches many learners the first time and has its own chapter.
Always Free Autonomous Database
Autonomous Database is Oracle's managed cloud database service. Oracle runs the infrastructure, patching, backups and tuning. Oracle Cloud's Always Free tier lets you create a small Autonomous Database that does not expire as long as you keep using it, with no charge.
What you get:
- A real, always-on Oracle Database that you reach from anywhere with an internet connection.
- A browser-based set of tools called Database Actions, including a SQL worksheet, so you can start without installing any client.
- Network connections from external clients and applications, secured with TLS (Transport Layer Security, the protocol that encrypts the connection). Connecting from a desktop tool or application usually involves a wallet, which is a small bundle of files holding connection details and credentials.
- Cloud features you cannot practice locally, such as managed backups, Oracle REST Data Services (ORDS) endpoints and cloud console operations.
What to watch for:
- Account and sign-up. You need an Oracle Cloud account. Sign-up typically asks for a payment card for identity verification. Region choice at sign-up also matters, because Always Free resources are tied to your home region.
- Limited administrative control. You get an
ADMINuser that is powerful in the database but is notSYS. You cannot log in to the host operating system. - Inactivity rules. Always Free databases are stopped automatically after a period of inactivity and can be reclaimed if left stopped too long. Check Oracle's current policy and treat anything you care about as needing a backup.
- Small allocation. CPU, memory and storage are small. Again, that is fine for learning.
How the three differ in practice
Three questions separate the options. Each question points to one dimension.
Who operates the database? With FreeSQL, Oracle does everything. With Autonomous Database, Oracle operates the infrastructure and you operate your schema. With the container, you operate everything, including starting, stopping and recovering it.
How do you connect? FreeSQL has only its web editor. Autonomous Database offers the web tools and network connections that need TLS settings or a wallet. The container offers a plain listener on port 1521 at localhost.
What happens to your data? FreeSQL keeps saved scripts but is not a place for lasting data. Autonomous Database keeps data while the database stays active. The container keeps data only as long as the container, or a volume you attach, exists.
The last chapter of this tutorial returns to this decision with more criteria. For now, the diagram is enough to orient you.
Same engine, different edges
All three environments run Oracle Database, so most SQL transfers directly between them. The differences appear at the edges:
- Privileges. A statement such as
CREATE USERworks asSYSorPDBADMINin the container and asADMINin Autonomous Database, but fails in FreeSQL. Apermission deniedorinsufficient privilegeserror (ORA-01031) usually means you are in a more restricted environment than you assumed. - Features that are managed for you. Autonomous Database restricts some operations that a self-managed database allows, because Oracle manages storage and parameters. Examples include certain tablespace and initialization parameter changes.
- Version differences. The three services do not always upgrade at the same time. If a new feature fails with a syntax error, check the database version first.
You can check where you are and who you are with a short query. This one works in all three:
SELECT sys_context('USERENV', 'CON_NAME') AS container_name,
sys_context('USERENV', 'SESSION_USER') AS session_user
FROM dual;In the container you should see FREEPDB1 as the container name when connected to the right place. In Autonomous Database the value is a generated name. Verification gets its own chapter.
Common mistakes at the start
- Choosing by habit instead of goal. Learners often install the container because it feels more "real", then spend a week on Docker memory settings when they only needed to practice joins. Start with the lightest option that meets your goal.
- Working as an administrator. Practicing as
SYSorADMINhides privilege problems that appear later in real applications. Later chapters create a development user for this reason. - Expecting persistence everywhere. Data created in FreeSQL, or in a container without a volume, can disappear. Keep your setup scripts in files so you can rebuild any environment quickly.
- Mixing up the CDB and the PDB. In the container, objects you create in the root container are in the wrong place. Connect to
FREEPDB1for practice. - Ignoring licensing text. Free options are free for the uses Oracle's terms allow. Read the terms before using one for anything beyond learning and development.
What comes next
The rest of the tutorial follows the plan below.
- FreeSQL and its script features.
- Starting the container and connecting to
FREEPDB1. - Creating an Always Free Autonomous Database and connecting with Database Actions, TLS and wallets.
- Creating a development user, then verifying the environment with SQL.
- Limits, lifecycle, troubleshooting and a final decision guide.
Exercise
You want to practice window functions for twenty minutes during a lunch break, on a computer where you cannot install software. Which option fits best, and what is the main limitation you accept by choosing it?
Show answer
FreeSQL fits best because it runs in the browser with nothing to install. The limitations are that you cannot connect external tools, you have no administrative control, and your work is not a lasting environment unless you save scripts by signing in.
Exercise
A teammate runs CREATE USER in an environment and gets ORA-01031 (insufficient privileges). Name two of the three environments where this is the most likely setting, and one where it would succeed with the right login.
Show answer
It is most likely in FreeSQL, where you work in a restricted sandbox schema. It could also happen in the container or Autonomous Database if you are connected as an ordinary user instead of an administrative one. It would succeed in the 26ai Free container as SYS or PDBADMIN, or in Autonomous Database as ADMIN.
Exercise
Why is it risky to practice only as SYS or ADMIN, and what do you plan to do about it later in this tutorial?
Show answer
Administrative accounts bypass many privilege checks, so scripts that work for you may fail for a normal application user. A later chapter creates a non-administrative development user and does the practice work there.