EXAplus and many other database browsers provide the functionality to create the DDL for the database. The attached file provides a Lua script to do the same task and generates the DDL for each database object based on the system tables.
There are parameters to influence the output style. Documentation on the parameters and some known restrictions can be found at the beginning of the script. Version 2 adds support for new features in version 6.1. Please see the header of the script for more information on what is supported and the current limitations.
If true then DDL for adding roles and users is added (at the top, before everything else).
If true then DDL for user & role privileges is added (at the bottom, after everything else).
If true, the entire output is stored in the table "DB_HISTORY"."DATABASE_DDL" before the output is displayed.
You can execute the script with the below statement: