Oracle DDL Creation
DBMS_METADATA.GET_DDL
If you have multiple schema Architecture to seperate Businesslogic, technical Topics and APEX Views. You need a Deploying Pipeline.
We started with the easiest Way ..
Developing in Database Schemas, Calling generators for the View and API Layers and midnight we call a sqlcl .js file to export all DDLs and push it into git.
Generate all DDL with dbms_metadata.
Because of Don't care about the Schema name we did:
SQL> execute DBMS_METADATA.SET_TRANSFORM_PARAM(
DBMS_METADATA.SESSION_TRANSFORM, 'EMIT_SCHEMA', false);
But in Case of Synonyms you can get things like this:
create synonym LOG for LOG; => thats not a valid Statement.
original it is
create synonym TARGET_SCHEMA.LOG for SOURCE_SCHEMA.LOG;
Dbms Metadata Emit schemas everywhere not only in target schema.