Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > DB2 > How to get DDL for triggers and grants

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-02, 05:42
psudhakar psudhakar is offline
Registered User
 
Join Date: Dec 2001
Posts: 10
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.
Reply With Quote
  #2 (permalink)  
Old 01-09-02, 11:06
dcronin dcronin is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 01-10-02, 04:53
psudhakar psudhakar is offline
Registered User
 
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).
Reply With Quote
  #4 (permalink)  
Old 01-10-02, 04:59
psudhakar psudhakar is offline
Registered User
 
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).
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On