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 > Create Database Ddl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-08, 14:58
db2rocks db2rocks is offline
Registered User
 
Join Date: Jan 2008
Posts: 45
Create Database Ddl

Hi friends,

db2look does not give the create database statement.I tried control center and even that did not help.Is there a way we can get the create database statement for a database in db2??
Reply With Quote
  #2 (permalink)  
Old 02-11-08, 17:33
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
"create database" is not DDL, it is a DB2 Command. See the Command Reference manual for details. Most of the settings that you will need to replicate the database can be obtained with the following command on the existing database:

db2 get db cfg
__________________
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
  #3 (permalink)  
Old 02-11-08, 17:37
db2rocks db2rocks is offline
Registered User
 
Join Date: Jan 2008
Posts: 45
Thanks..Is there a way to get CREATE DATABASE command for an existing database ?? Suppose i want to move a database from one environment to other with out using backup,restore option i might need the create database command.Is there a way to know that ??
Reply With Quote
  #4 (permalink)  
Old 02-11-08, 17:47
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I don't think there is a way, unless the Control Center does it. The database code page and territory code are in the "db2 get db cfg" and everything else will default to a value, but can be changed later.
__________________
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 02-11-08, 17:50
db2rocks db2rocks is offline
Registered User
 
Join Date: Jan 2008
Posts: 45
thanks for the info..Quest tool does that i believe.Do you know any APIs that we can use to generate DDL or CREATE DATABASE command??
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