I have several user defined functions which are referenced in triggers
and views. For software upgrades, I need to be able to drop the
triggers and views which reference these user defined functions, then
drop and recreate the user defined functions, then recreate all the
views and triggers. I don't imiagine I'm the first person who needed
to do this, and I don't have a lot of db2 experience, so I wanted to
see if there is a common or generally used technique for handling this.
This will be part of the upgrade process in a commercial software
product, so it has to be a programmatic technique, not something done
from the Control center. I have metadata tables which can tell me the
names of all the views and triggers that I need to drop and recreate,
so I don't need a way of finding which views and triggers need to be
recreated, just the ablility to drop and recreate the ones I specify.
This is for DB2 8.1.
Thanks in advance for any advice. 5 2166
Have a look at 'db2look' utility. it extracts the ddl of views,
triggers and udfs and can store them in a plain ascii file. once
extracted, you can then later recreate those objects by executing this
ddl file. the relevant commands would be similar to:
db2look -d SAMPLE -e -o sample.ddl -p -a
db2 -tfv sample.ddl
regards,
dotyet
Bruce wrote: I have several user defined functions which are referenced in
triggers and views. For software upgrades, I need to be able to drop the triggers and views which reference these user defined functions, then drop and recreate the user defined functions, then recreate all the views and triggers. I don't imiagine I'm the first person who needed to do this, and I don't have a lot of db2 experience, so I wanted to see if there is a common or generally used technique for handling
this. This will be part of the upgrade process in a commercial software product, so it has to be a programmatic technique, not something done from the Control center. I have metadata tables which can tell me
the names of all the views and triggers that I need to drop and recreate, so I don't need a way of finding which views and triggers need to be recreated, just the ablility to drop and recreate the ones I specify. This is for DB2 8.1.
Thanks in advance for any advice.
May sound irrelevent, but . . .
<<db2look -d SAMPLE -e -o sample.ddl -p -a
<<db2 -tfv sample.ddl>>
Where does one find documentation for all such utilities for DB2 with
their switches and options? (Immediateley I'd like to find them for
db2, but also for Webshpere and everything else that IBM publishes.)
SS
_________
dotyet wrote: Have a look at 'db2look' utility. it extracts the ddl of views, triggers and udfs and can store them in a plain ascii file. once extracted, you can then later recreate those objects by executing
this ddl file. the relevant commands would be similar to:
db2look -d SAMPLE -e -o sample.ddl -p -a
db2 -tfv sample.ddl
regards, dotyet
Bruce wrote: I have several user defined functions which are referenced in triggers and views. For software upgrades, I need to be able to drop the triggers and views which reference these user defined functions,
then drop and recreate the user defined functions, then recreate all the views and triggers. I don't imiagine I'm the first person who
needed to do this, and I don't have a lot of db2 experience, so I wanted
to see if there is a common or generally used technique for handling this. This will be part of the upgrade process in a commercial software product, so it has to be a programmatic technique, not something
done from the Control center. I have metadata tables which can tell me the names of all the views and triggers that I need to drop and
recreate, so I don't need a way of finding which views and triggers need to
be recreated, just the ablility to drop and recreate the ones I
specify. This is for DB2 8.1.
Thanks in advance for any advice.
Stanley, try: db2look -h
It lists all options, their meaning and also some examples.
HTH, Pierre and Joyeux Noël
PS: It's sunny and -10°C
Stanley Sinclair wrote: May sound irrelevent, but . . .
<<db2look -d SAMPLE -e -o sample.ddl -p -a <<db2 -tfv sample.ddl>>
Where does one find documentation for all such utilities for DB2 with their switches and options? (Immediateley I'd like to find them for db2, but also for Webshpere and everything else that IBM publishes.)
SS _________
dotyet wrote:
Have a look at 'db2look' utility. it extracts the ddl of views, triggers and udfs and can store them in a plain ascii file. once extracted, you can then later recreate those objects by executing
this
ddl file. the relevant commands would be similar to:
db2look -d SAMPLE -e -o sample.ddl -p -a
db2 -tfv sample.ddl
regards, dotyet
Bruce wrote:
I have several user defined functions which are referenced in
triggers
and views. For software upgrades, I need to be able to drop the triggers and views which reference these user defined functions, then drop and recreate the user defined functions, then recreate all the views and triggers. I don't imiagine I'm the first person who needed to do this, and I don't have a lot of db2 experience, so I wanted to see if there is a common or generally used technique for handling
this.
This will be part of the upgrade process in a commercial software product, so it has to be a programmatic technique, not something done from the Control center. I have metadata tables which can tell me
the
names of all the views and triggers that I need to drop and recreate, so I don't need a way of finding which views and triggers need to be recreated, just the ablility to drop and recreate the ones I specify. This is for DB2 8.1.
Thanks in advance for any advice.
--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc. This discussion thread is closed Replies have been disabled for this discussion. Similar topics
1 post
views
Thread by Fardude |
last post: by
|
3 posts
views
Thread by Florian |
last post: by
|
reply
views
Thread by Marko Poutiainen |
last post: by
|
reply
views
Thread by Dennis Gearon |
last post: by
|
reply
views
Thread by Ulrich Meis |
last post: by
|
2 posts
views
Thread by dbuchanan52 |
last post: by
|
15 posts
views
Thread by rod.weir |
last post: by
|
1 post
views
Thread by db2admin |
last post: by
| | | | | | | | | | | |