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/*.sh
Start the environment:
docker compose up -d
Check logs:
docker compose logs -f oracle
Stop:
docker compose down
Full reset (recreates DB + reruns init scripts):
docker compose down -v && docker compose up -d
Start DB:
make up
Stop DB:
make down
Logs:
make logs
Open shell:
make sh
Run any SQL file as APP_USER:
make seed FILE=path/to/script.sql
Full reset (fresh DB + auto-seed):
make reset
git clone git@github.com:Kotmin/PL-SQL-Lab.git
Test 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
visual studio code oracle sql developer for db conn
visual studio code connection setup visual studio code new sql
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 reset
Files 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 reset
Use:
make seed FILE=yourfile.sql
Enable 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