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 > Db2look Doubt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-15-07, 17:06
nivasreddy007 nivasreddy007 is offline
Registered User
 
Join Date: Jun 2007
Posts: 66
Db2look Doubt

Hi,

1)I used db2look -d FINANCEDB -e to extract DDL but i could not see the DDL for create database statement.Is there a way with db2look command that we can get the DDL for create statement

2)Is there a way that we can extract DDL for a particular stored procedure using db2look command.


Thanks
Reply With Quote
  #2 (permalink)  
Old 08-15-07, 21:18
myprotein myprotein is offline
Registered User
 
Join Date: Aug 2007
Posts: 23
1),the db2look utility works on database level,if you dont't have a database ,this command would have no sense. so i guess you wanna use this utility to create a new db on other system, you cannot ,cauz it works on a db level, no db,no this utility.

2),maybe there have some options ,just press "enter" after the statement"db2look"
Reply With Quote
  #3 (permalink)  
Old 08-15-07, 22:16
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Create database is not an SQL statement, so it is not in the db2look. It is a DB2 command.

I don't recall a way to get just one stored procedure, but I have not checked the manual. You can get a table that matches a string name (sort of a "like" statement) with the -tw parm.
__________________
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
  #4 (permalink)  
Old 08-16-07, 06:26
chandra samir chandra samir is offline
Registered User
 
Join Date: Aug 2007
Posts: 1
give db2look -d <dbname> -e -l -o <output file name>

you will get what you are seeing
Reply With Quote
  #5 (permalink)  
Old 08-17-07, 01:30
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by chandra samir
give db2look -d <dbname> -e -l -o <output file name>

you will get what you are seeing
No, you will not get the "create database" command in the db2look, no matter what options you use.
__________________
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
  #6 (permalink)  
Old 04-14-11, 03:49
DB_N00b DB_N00b is offline
Registered User
 
Join Date: Jan 2010
Posts: 152
And what tool makes it possible to get such a command like " create database " of my existing database?

Thanks in advance.
Reply With Quote
  #7 (permalink)  
Old 04-14-11, 20:25
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I don't think DB2 keeps track of all the specific options that were used when a created database was issued. Obviously, some of the important things like the territory code and collating sequence can be retrieved from the db cfg. Some things like the default tablespace definitions (if specified with create database) can be retrieved from the DB2 catalog.
__________________
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
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