If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to extract create database command from an existing database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-11, 11:01
debayan debayan is offline
Registered User
 
Join Date: Sep 2007
Posts: 23
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
Reply With Quote
  #2 (permalink)  
Old 05-13-11, 11:30
dbryan dbryan is offline
Registered User
 
Join Date: May 2011
Posts: 4
DB2LOOK command with the appropriate parameters will create the DDL for you
Reply With Quote
  #3 (permalink)  
Old 05-13-11, 12:24
debayan debayan is offline
Registered User
 
Join Date: Sep 2007
Posts: 23
I tried DB2LOOK. DB2LOOK does not give you "create database" command. If you know the parameters please let me know.

Thanks
Reply With Quote
  #4 (permalink)  
Old 05-13-11, 13:44
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #5 (permalink)  
Old 05-13-11, 16:30
debayan debayan is offline
Registered User
 
Join Date: Sep 2007
Posts: 23
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.
Reply With Quote
  #6 (permalink)  
Old 05-13-11, 17:11
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #7 (permalink)  
Old 05-16-11, 01:12
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On