You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Date: 2026-04-06
Auditor: Qwen Code (acting as senior Oracle DBA / Python architect)
Scope: Full codebase audit of OraSchemaGen modular Oracle schema generator
Executive Summary
OraSchemaGen is a Python-based tool that generates Oracle DDL and PL/SQL scripts. The audit identified 37 issues across the codebase, of which 26 were fixed with concrete code changes and 11 remain as documented limitations.
The most critical findings were:
DATE columns in INSERT statements used bare string literals ('2022-12-10') instead of TO_DATE(), making output NLS-dependent and non-portable
Multiple procedures used BOOLEAN parameters which are PL/SQL-only and cannot be called from SQL
Package spec and body function signatures were randomly generated independently, guaranteeing mismatches
REGEXP_LIKE calls had missing closing parentheses (syntax errors)
Foreign key constraints referenced tables that were never created when --tables < 8
Triggers referenced columns that don't exist on their target tables
All critical issues have been fixed. 27 unit tests now pass, validating SQL generation patterns.
No live Oracle execution testing - All validation is static. Generated SQL has not been executed against a real Oracle database.
Legacy oracle-sql-generator.py not updated - The original single-file generator still has the old DATE literal and other issues. It is superseded by the modular generators.
Non-deterministic test data - Faker uses random seeds; generated data varies between runs. No seed control option exists.
No PL/SQL compilation validation - We test string patterns, not actual Oracle PL/SQL compilation.
Schema privilege assumptions - Generated scripts assume the executing user has CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, CREATE PROCEDURE, etc. privileges.
Exadata-specific storage clauses - FLASH_CACHE and CELL_FLASH_CACHE parameters are no-ops on non-Exadata systems.
Next Recommended Actions
High Priority
Add seed control for Faker - Enable --seed 42 for deterministic data generation
Add --no-storage CLI flag - Already supported internally, expose in main.py
Update oracle-sql-generator.py - Apply same fixes to legacy single-file generator or deprecate it
Add PL/SQL syntax validation - Use oracle-parser or regex-based PL/SQL block validator
Medium Priority
Add schema prefix support - Allow --schema HR to prefix all objects
Add idempotency mode - Generate DROP ... CASCADE CONSTRAINTS before CREATE
Add Oracle integration tests - Test against actual Oracle (via Docker) if available
Add SQL*Plus execution smoke test - Run generated script through sqlplus -S if Oracle is available
Add PyPI packaging - Make installable via pip install oraschemagen
Conclusion
The OraSchemaGen codebase has been significantly improved. All CRITICAL and HIGH severity issues that could produce invalid Oracle SQL have been fixed. The generated output now uses explicit TO_DATE/TO_TIMESTAMP for date columns, VARCHAR2('Y'/'N') instead of BOOLEAN for SQL-callable interfaces, matching package spec/body signatures, and conditional FK generation that only references created tables.
27 unit tests validate the generation patterns. 10 ADRs document architectural decisions. A comprehensive Principles & Patterns document covers architecture, design patterns, anti-patterns, and Oracle compatibility principles.
The tool is now suitable for generating Oracle DDL and PL/SQL scripts for development, testing, and educational purposes, with the caveat that all generated SQL should be reviewed before production use.