An Oracle SQL and PL/SQL reference project for accounts, transfers, loans, auditing, access roles, Scheduler jobs, reporting, and recovery planning.
OraBank focuses on database behavior rather than a mock banking interface. The central transfer package validates inputs, locks both accounts in a deterministic order, updates balances, writes balance history, stores the transaction pair, and leaves the final commit decision to the caller.
- Relational model for clients, accounts, cards, transfers, loans, and audit data.
- Indexes for foreign keys and common account and transaction paths.
ORABANK_ACCOUNT_PKGwith balance and transfer operations.- Loan creation and installment payment procedures.
- Account history and loan interest functions.
- Balance audit trigger.
- Oracle Scheduler jobs for balance snapshots and expired loans.
- Least-privilege admin, teller, and auditor roles.
- Reporting views and an optional materialized view.
- Optional interval partitioning examples.
- Data Pump recovery runbook.
- SQL*Plus object validation and a transactional smoke test.
MAKE_TRANSFER performs these steps in one caller-controlled transaction:
- Rejects non-positive amounts and transfers to the same account.
- Locks both active accounts in account ID order.
- Verifies the sender balance.
- Updates both balances and writes balance history.
- Creates outgoing and incoming
BANK_TRANSACTIONrows. - Links the outgoing row to
TRANSFER. - Rolls back to its savepoint on failure.
The package intentionally does not issue COMMIT.
Oracle Database 19c or 21c and SQL*Plus are required. Create an empty development schema without storing its password in scripts, connect as that schema, then run:
@install.sql
@tests/smoke_test.sqlOptional modules:
@10_wydajnosc/orabank_performance.sql
@05_partycjonowanie/orabank_partitioning.sqlRole and user creation requires an administrative connection:
@08_bezpieczenstwo/orabank_security.sqlThat script prompts for passwords with hidden input and expires them on first login.
install.sql fails on SQL errors and runs tests/validate_objects.sql. The smoke test creates isolated sample records, executes a transfer, checks balances and transaction counts, and rolls all test data back.
The GitHub workflow also runs repository checks for missing installation files, accidental example passwords, stale table names, and known invalid PL/SQL patterns.
03_tabele core relational model
04_indeksy supporting indexes
05_partycjonowanie optional interval partitioning lab
06_plsql packages, procedures, and functions
07_triggery audit trigger
08_bezpieczenstwo roles, reporting views, and users
09_joby Oracle Scheduler jobs
10_wydajnosc optional reporting and statistics
11_backup Data Pump recovery runbook
tests object validation and smoke test
This is an educational database engineering project, not production banking software. Real deployment would additionally require encryption and key management, stronger identity controls, regulatory audit retention, reconciliation, idempotency keys, fraud controls, monitoring, disaster recovery exercises, and formal security review.
MIT. See LICENSE.
