Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    1

    Unanswered: 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.

  2. #2
    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

    http://www.dbforums.com/db2/1658333-...nstraints.html
    Ritesh Kumar Singh
    IBM Certified DB2 DBA for LUW
    **Knowledge Is Theft If Not Shared !!**

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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