Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2001
    Posts
    10

    Unanswered: How to get DDL for triggers and grants

    Hi Friends,
    I am using DB2 6.1 for Unix. I have a database which contains some tables, views and trigers. I want to copy the same database to a different environment. Using DB2LOOK we can get a DDL for all tables, views and constraints. But we also need triggers and grants. Can somebody suggest how to extract the information related to triggers and grants from our current database in an automated way.

  2. #2
    Join Date
    Nov 2001
    Posts
    3

    ddl for grants

    Modify your db2look command line parms...

    db2look -d dbname -u creator.id -e -a -x -c -o outfile.ddl

    This will get you everything including grants.


    Try the following to obtain your triggers.

    select * from sysibm.systriggers



    or

    describe table sysibm.systriggers

  3. #3
    Join Date
    Dec 2001
    Posts
    10
    Hi dcronin,

    Many thanks for information.....I found out one more way to get the required DDL statments which will be helpful for other guys. DB2 7.1 DB2LOOK utility is having options to create DDL statements for triggers also. So What I did is, I cataloged my 6.1 database from a 7.1 DB2 client and issued DB2LOOK on my database and captured the complete DDL for my database (including triggers).

  4. #4
    Join Date
    Dec 2001
    Posts
    10
    Many thanks for your information. I found out one more way to get the required information. DB2 7.1 DB2LOOK will create DDL statements for triggers also. So what I did is I have cataloged my 6.1 database from a 7.1 DB2 client and issued DB2LOOK and captured the complete DDL statements(including triggers).

Posting Permissions

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