Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2007
    Posts
    27

    Unanswered: How to extract create database command from an existing database

    Hi All,

    Is there a way to extract the create database command from an existing DB2 V8.2 database? Any 3rd party tools that has this feature? Any help is greatly appreciated.

    Thanks,
    Dev

  2. #2
    Join Date
    May 2011
    Posts
    4
    DB2LOOK command with the appropriate parameters will create the DDL for you

  3. #3
    Join Date
    Sep 2007
    Posts
    27
    I tried DB2LOOK. DB2LOOK does not give you "create database" command. If you know the parameters please let me know.

    Thanks

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    There is no command to recreate a create database command used for a specific database. Some of the basic information could be obtained via SQL and/or various admin views, etc, but probably not every parameter that can be used in a create database.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Sep 2007
    Posts
    27
    So whats the easiest way to migrate a database from SOLARIS to LINUX? Due to endian difference, we cannot just do a backup-restore. Also DB2LOOK and DB2MOVE does not give me the "create database" statement. And, we have over 300 databases which we need to migrate over to LINUX. So writing individual "CREATE DATABASE" statement is pain-staking and time consuming.

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by debayan View Post
    So whats the easiest way to migrate a database from SOLARIS to LINUX? Due to endian difference, we cannot just do a backup-restore. Also DB2LOOK and DB2MOVE does not give me the "create database" statement. And, we have over 300 databases which we need to migrate over to LINUX. So writing individual "CREATE DATABASE" statement is pain-staking and time consuming.
    That depends on which options you want to specify in the create database statement. Are you expecting the options to be different (other than database name and path names) for each database? You could easily generate the statements if you just have a list of the databases and you use a standard convention for database path and automatic storage path.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Stupid question: you don't have the scripts archived that were used to create the databases?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •