A lightweight, reproducible Oracle 23c Free environment for SQL + PL/SQL practice.
Features:
- Docker-based Oracle DB with persistent volume
- Automatic schema + seed initialization on first run
- Make commands for common workflows
- Ability to run custom SQL scripts
- Easy full reset / rollback
- Seed data included for immediate experimentation
plsql-lab/
ββ docker-compose.yml
ββ .env # secrets & config (not checked in)
ββ db/
β ββ init/ # runs ONLY on first database creation
β β ββ 01_schema.sql
β β ββ 02_seed_data.sql
β ββ startup/ # runs at EVERY container start
β ββ 01_after_start.sql
ββ scripts/
β ββ seed.sh # apply any .sql file(s) on demand
β ββ reset.sh # stop & wipe volumes & re-create
ββ Makefile
chmod +x scripts/*.shStart the environment:
docker compose up -dCheck logs:
docker compose logs -f oracleStop:
docker compose downFull reset (recreates DB + reruns init scripts):
docker compose down -v && docker compose up -dStart DB:
make upStop DB:
make downLogs:
make logsOpen shell:
make shRun any SQL file as APP_USER:
make seed FILE=path/to/script.sqlFull reset (fresh DB + auto-seed):
make resetgit clone git@github.com:Kotmin/PL-SQL-Lab.gitTest default state with
SHOW USER;
SELECT table_name FROM user_tables ORDER BY table_name;
-- Which schema am I?
SHOW USER;
SELECT owner, table_name
FROM all_tables
WHERE table_name IN ('STUDENCI','EGZAMINY','EGZAMINATORZY','OSRODKI','PRZEDMIOTY')
ORDER BY owner, table_name;
To install connect and use lab within Visual Studio Code
Details
Enable display to console(in that preset it should be already enabled)
SET SERVEROUTPUT ON;
BEGIN
DBMS_OUTPUT.PUT_LINE('5');
END;
/
To install connect and use lab with DataGrip
Details
oracle dialect
Enable display to console(in that preset it should be already enabled)
SET SERVEROUTPUT ON;
BEGIN
DBMS_OUTPUT.PUT_LINE('5');
END;
/
Files in:
db/init/
run once on first DB creation:
- 01_schema.sql β creates tables
- 02_seed_data.sql β loads example data
Re-run by performing a reset:
make resetFiles in:
db/startup/
run every time the container starts (useful for views, helpers, maintenance).
Test that PL/SQL + DBMS_OUTPUT works:
SET SERVEROUTPUT ON;
BEGIN
DBMS_OUTPUT.PUT_LINE('Oracle Lab OK');
END;
/Test your sample data:
SELECT COUNT(*) FROM studenci;
SELECT COUNT(*) FROM egzaminy;
Database schema didnβt initialize.
Fix:
make resetUse:
make seed FILE=yourfile.sqlEnable in your client:
SET SERVEROUTPUT ON;Remove volume + restart:
make reset- Oracle version: 23c Free
- Main schema: APP_USER
- Service name for connections: FREEPDB1
- Data persists until you reset the volume
- Safe sandbox β reset anytime for a clean environment








