Sub topic 9
Limits, Persistence, and Lifecycle of Oracle Practice Environments
Assume you know basic SQL and can run commands in a terminal. This chapter focuses on what happens to your database, scripts, and connections over time. These details matter because a free environment can be useful for learning while still being unsuitable as the only copy of important work.
The three environments have different lifecycles
Persistence means that data remains available after you disconnect, restart a service, or close a browser. Lifecycle means the events that create, stop, reset, or remove the environment.
| Environment | Where it runs | What normally persists | Main lifecycle risk |
|---|---|---|---|
| FreeSQL | Hosted browser service | Saved scripts and service-managed workspace | Sessions, quotas, or service behavior can change |
| 26ai Free container | Your computer | Data only if stored outside the container | Removing the container can remove its database files |
| Always Free Autonomous Database | Oracle Cloud | Cloud database and saved objects | Instance limits, suspension, deletion, or account policies |
The most important distinction is control. A local container gives you control over files and startup. Autonomous Database gives you managed storage and remote access. FreeSQL gives you the least setup, but also the least control over the database server.
FreeSQL: convenient, but not a private server
FreeSQL is useful when you want to run SQL from a browser without installing Oracle Database. You can create tables, insert data, and save scripts in the service. Saved scripts are different from database data. A script is text that can recreate or test your work. A table is an object stored in a database schema.
Treat FreeSQL as a practice workspace rather than a long-term archive. Keep important scripts in a local file or version-control system. A saved script may remain available in your account, but that does not make it an independent backup of the data it creates.
A browser session can also expire. Closing the browser may end the connection, while objects created in the service may remain according to its workspace rules. Do not depend on an uncommitted transaction. Run COMMIT when you want changes to be durable in that database session.
CREATE TABLE lifecycle_note (
id NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
body VARCHAR2(200) NOT NULL
);
INSERT INTO lifecycle_note (body)
VALUES ('Keep the script outside the browser too');
COMMIT;A local container: persistence depends on storage
A container is an isolated process environment. The database files inside the container's writable layer usually exist while that container exists. Stopping and starting the same container normally preserves those files. Removing the container does not.
Use a named volume for database storage. A volume is storage managed separately from the container, so you can replace the container without automatically replacing the database files.
docker volume create oracle-free-data
docker run -d --name oracle-free \
-p 1521:1521 \
-e ORACLE_PWD='ChangeMe_123' \
-v oracle-free-data:/opt/oracle/oradata \
container-registry.oracle.com/database/free:latestThe exact data directory is part of the image's documented setup. Confirm it when changing image versions. A volume protects against accidental container replacement, but it is not a backup. A failed disk, deleted volume, or corrupted database can still destroy the data. Export important schemas or copy the volume data using a documented backup method.
Stopping the container preserves its files:
docker stop oracle-free
docker start oracle-freeRemoving it is a lifecycle change. Do not remove the volume unless you intend to discard the database.
Autonomous Database: managed persistence with service limits
An Always Free Autonomous Database stores its database files in Oracle Cloud. You do not manage the database host or its storage directories. Database objects normally remain when you disconnect, close Database Actions, or stop using the browser.
The service still has limits. CPU, memory, storage, concurrent sessions, and network access are constrained by the selected Always Free configuration. Oracle can also change service rules, stop idle resources, or reclaim resources under account and service policies. Check the current OCI terms and the instance's status before relying on it for continued availability.
Cloud persistence does not replace backups. Export schemas, save SQL scripts, and keep connection information separate from the database. A wallet contains connection configuration and certificates, not a substitute copy of your tables.
Lifecycle decisions
Use this sequence when deciding where to keep practice work:
FreeSQL is the fastest choice for a short exercise. Use a container with a named volume when you need repeatable local administration or offline access. Use Autonomous Database when you need a managed database reachable from more than one machine.
Exercise
You stop a local Oracle container, remove it, and then create a new container with the same image. What determines whether your tables are still present?
Show answer
The storage location determines it. Data in the removed container's writable layer is lost. Data in a retained volume or host-mounted directory can be reused by the new container.