Db2 – How to generate the DDL that created a DB2 LUW database

db2db2-luwscripting

There are various options for db2look you can use to see the DDL for just about every object in the database except the command that created the database itself. Is there any way with db2look, or perhaps with some other system command, where you can see the exact command structure that created a database?

Best Answer

The minimum requirement is to have DB2 10.1.4 or DB2 10.5 installed.

-createdb: Generate the CREATE DATABASE command that was used to create the source database

db2look -d sample -createdb