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?
-
There are options on db2look that let you generate those commands if I remember correctly.– Chris AldrichMar 22, 2016 at 13:02
-
@MaxVernon - you have the DB2 for z link. OP is asking for LUW.– Chris AldrichMar 22, 2016 at 13:06
-
@RobertEJohnson - here is the link for the documentation on db2look. Multiple parameters depending on what you want: ibm.com/support/knowledgecenter/SSEPGG_10.5.0/… Be careful as some of the parameters don't match together or order may matter. See Ember Crooks blog (db2commerce.com) on db2look.– Chris AldrichMar 22, 2016 at 13:08
1 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
-
I can see the -createdb option in the documentation, but it does not seem to work with my express-c 10.5 fixpak 1. Do you know if this option requires a certain license? May 5, 2016 at 19:36
-
It may have been introduced in 10.5.3 or 10.5.4, which came out shortly before and shortly after 10.1.4, respectively. May 5, 2016 at 20:38