Fork me on GitHub

Reverse-Engineering via DBMS-Provided Tools

Obevo will integrate w/ DBMS-provided tooling for reverse-engineering. We prefer this route over using external tools as the DBMS vendors are more likely to keep up-to-date on their own DDL generation tooling.

Obevo will either A) call the vendor APIs directly or B) provide you the command/s to run to generate some interim artifacts for Obevo to then complete processing.

The following tools are currently supported.

DBMS Tooling Leveraged by Obevo Who will invoke the vendor API?
Sybase ASE ddlgen User
DB2 DB2LOOK User
Postgres pg_dump User
SQL Server Microsoft.SqlServer.Management.Smo.Scripter class in Powershell User
Oracle DBMS_METADATA API via JDBC Obevo

The tooling generally works as follows: A) If Obevo invokes the vendor API 1. Execute the Obevo command. This will invoke the vendor API and save its output into an interim file, and then proceed w/ the rest of the reverse engineering 2. If the reverse-engineering looks good, then you are done 3. Otherwise, modify the interim file and rerun the Obevo command w/ the interim file argument passed in

B) If the user invokes the vendor API 1. Execute the Obevo command to generate the DBMS-specific commands to reverse-engineer the DDLs to a particular format 2. Execute those DBMS-specific commands to generate the DDL output file 3. Re-execute the Obevo command w/ the DDL output file as an additional argument

Execution Steps

Step 1: execute the NEWREVENG command with your arguments

%OBEVO_HOME%\bin\deploy.bat NEWREVENG -dbType DB2 -dbSchema YourSchemaName -mode schema -outputPath h:\reveng-example-output -dbHost yourhost.me.com -dbPort 1234 -dbServer MYDB01

Detailing the arguments:
 -dbType: required, specify SYBASE_ASE or DB2
 -dbSchema: required, the schema/database you are querying from
 -mode: required, use the "schema" value
 -outputPath: required, specify where your reverse-engineered output should go
 Connection arguments - specify either -dbHost and -dbPort for Sybase or -dbHost and -dbPort and -dbServer for DB2

Optional Arguments:
 -debugLogEnabled: use this if you have questions on reverse-engineering that you want to report to the Obevo team. This adds debug information that is useful for support

Step 2: execute the commands that are prompted for you in the instructions from the Step 1 output.

Step 3: execute your step 1 command again, but add the -inputPath <yourFilePath> argument to do the conversion to the obevo format

This will generate the reverse-engineered output under <outputDir>/final

Once you have these files, do the final touches on them as you see fit (e.g. delete junk tables)

Some files that you should note / cleanup

  1. -pleaseAnalyze folders: If you see directories containing this phrase, then the tool could not figure out what to do w/ those sql snippets. Either manually figure out where to put them and do so, or if you find too many such cases, reach out to the product team via Github, including a zip file of your reveng contents
  2. UNMAPPEDSCHEMA folder: The reverse-engineering only works on the schema you specify with the -dbSchema argument. If objects in other schemas are detected in your input script, they will be placed in this folder. Ideally, you should not see this or use these, but we place it here for full transparency.

Note that we explicitly don’t include the grants here. This is because you can (and should) use the global permissioning functionality instead.

Once done, return to the Existing Onboarding Guide to continue the onboarding process.

Notes on using each vendor API:

Sybase ASE - ddlgen

Check with your database administrators on how to obtain the binaries to run ddlgen

DB2 - db2look

Check with your database administrators on how to obtain the binaries to run db2look

PostgreSQL - pgdump

pg_dump is available within the core distribution of PostgreSQL. You can use that distro as a client to connect to your DB; you do not need PostgreSQL installed on your computer.

https://www.postgresql.org/download/

SQL Server

Nothing special should be needed - the SQL scripting binaries should be included by default on Windows (tested on Windows 7 and 10). Please reach out to the Obevo team if you have issues.

Oracle

Nothing special should be needed - the reverse engineering is executed via native Java and Oracle SQL calls. Please reach out to the Obevo team if you have issues.