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 > Getting DB Design of a DB. Please help.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-15-10, 03:19
smokkyydesperado smokkyydesperado is offline
Registered User
 
Join Date: Jul 2010
Posts: 1
Getting DB Design of a DB. Please help.

I have a DB server which has a database. say . A and inside the database there is an active schema. S which contains around 100 tables ( with relations )

I want to extract DB design(in excel format ) of this table which will contain the following information ( as columns and sub-columns)

Table Name
Table Description
No: Of Parents
No: Of Children
Column
Name Type Length Nulls Default
Primary Key
Name Column
UNIQUE KEY
Name Column
Foreign Key
Name Column Parent Key Parent Table
Delete Rule
Update Rule
Check Constraint


How can i get this without manual work?. Is there any query to retrieve this kind of information or Can i use any tool for getting the same?

Would be most obliged if someone can help me out.
Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 07-15-10, 04:34
singhipst singhipst is offline
Registered User
 
Join Date: Jul 2006
Location: Bangalore
Posts: 57
you could execute query againest the metadata to retrive desired result.
Metadata catalog tables/view you could use SYSIBM.SYSTABLES A,SYSIBM.SYSCOLUMNS,syscat.tabconst, syscat.keycoluse, syscat.references

For Example:
Code:
select B.TBNAME,B.NAME,B.COLTYPE,B.LONGLENGTH,B.NULLS from SYSIBM.SYSTABLES A,SYSIBM.SYSCOLUMNS B WHERE A.NAME=B.TBNAME AND A.TYPE='T'
have a look to below link also post

Query to count number of coulmns in constraints
__________________
Ritesh Kumar Singh
IBM Certified DB2 DBA for LUW
**Knowledge Is Theft If Not Shared !!**
Reply With Quote
  #3 (permalink)  
Old 07-16-10, 06:19
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
how about db2look
db2look - DB2 Statistics and DDL Extraction Tool - IBM DB2 9.7 for Linux, UNIX, and Windows
or create a custom query if table is needed
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
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