This tool exports Oracle database objects (packages, stored procedures, triggers, etc.) to SQL files. This helps with searching, AI usage and version control.
Create a config.properties
file in the same directory as the jar (or in the root directory of the project). See config.properties.example
.
Use the VS Code launch config, or run the tool with:
java -jar dbexport.jar
The tool will:
- Connect to the Oracle database
- Export all database objects to SQL files
- Export table data for tables matching the configured patterns
- Export DDL for tables and views
- 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.
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.
- 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
mvn clean package