Results 1 to 7 of 7

Thread: Db2look Doubt

  1. #1
    Join Date
    Jun 2007
    Posts
    66

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

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

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  4. #4
    Join Date
    Aug 2007
    Posts
    1
    give db2look -d <dbname> -e -l -o <output file name>

    you will get what you are seeing

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  6. #6
    Join Date
    Jan 2010
    Posts
    206
    And what tool makes it possible to get such a command like " create database " of my existing database?

    Thanks in advance.

  7. #7
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

Posting Permissions

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