vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| |||
| 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. |
| |||
| As for IBM DB2 UDB, this link may help you: http://publib.boulder.ibm.com/infoce...help/index.jsp For WebSphere, this may help: http://publib.boulder.ibm.com/infoce...info/index.jsp For everything else which IBM publishes: ;-) http://publib.boulder.ibm.com/infocenter enjoy!! dotyet |
| |||
| Small correction: the last one should be: http://www.elink.ibmlink.ibm.com/pub...CTY=US&FNC=ICL OR you click on "Information Centers and Libraries" link. regards, dotyet |
| ||||
| 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. |