Skip to content

LUMC/dbexport

Repository files navigation

dbExport (for Oracle)

This tool exports Oracle database objects (packages, stored procedures, triggers, etc.) to SQL files. This helps with searching, AI usage and version control.

Configuration

Create a config.properties file in the same directory as the jar (or in the root directory of the project). See config.properties.example.

Usage

Use the VS Code launch config, or run the tool with:

java -jar dbexport.jar

The tool will:

  1. Connect to the Oracle database
  2. Export all database objects to SQL files
  3. Export table data for tables matching the configured patterns
  4. Export DDL for tables and views
  5. Remove any files no longer needed

Note that files for objects that are no longer in the database will be removed from the output directory.

Output Structure

The files are saved in the following structure:

database/
  package/
    my_package.sql         (package body)
    my_package_header.sql  (package header)
  trigger/
    my_trigger.sql 
  procedure/
    my_procedure.sql
  table/
    my_table.sql           (DDL including indexes and grants)
  view/
    my_view.sql            (DDL including grants)
  domeinwaarden/
    my_table_data.sql      (INSERT statements)

Each SQL file begins with create or replace or appropriate DDL statements and can be used directly to recreate the object in the database.

Features

  • Exports package bodies and headers
  • Exports procedures, functions, and triggers
  • Exports table DDL including comments, indexes, and grants
  • Exports view DDL including comments and grants
  • Exports table data as INSERT statements
  • Sets appropriate NLS parameters for database connections
  • Cleans up unused files automatically
  • Supports exclusion patterns for objects

Building

mvn clean package

About

Export Oracle database objects (packages, stored procedures, triggers, etc.) to SQL files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages