4

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?

3
  • There are options on db2look that let you generate those commands if I remember correctly. Mar 22, 2016 at 13:02
  • @MaxVernon - you have the DB2 for z link. OP is asking for LUW. Mar 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. Mar 22, 2016 at 13:08

1 Answer 1

2

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

2
  • 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.
    – mustaccio
    May 5, 2016 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.