473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Capturing and restoring views and triggers

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.

Nov 12 '05 #1
5 2394
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.


Nov 12 '05 #2
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.


Nov 12 '05 #3
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

Nov 12 '05 #4
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

Nov 12 '05 #5
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.
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fardude | last post by:
I developed a search stored proc that searches all or some of Procs, Views, Triggers and functions. Would anyone be interested to see it posted here? Do you have any suggestions about other...
3
by: Florian | last post by:
I need to set multiple values for some SQL statements, for example SET NUMERIC_ROUNDABORT OFF GO SET ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL,ARITHABORT,QUOTED_IDENTIF IER,ANSI_NULLS...
0
by: Marko Poutiainen | last post by:
Situation: We had to make our SQLServer 2000 database multi-lingual. That is, certain things (such as product names) in the database should be shown in the language the user is using (Finnish,...
0
by: Dennis Gearon | last post by:
If I have all sorts of triggers and constraints, The only way to have them applied incrementally to the data during restore or bulk load is to do the bulk load via individual INSERT statements,...
0
by: Ulrich Meis | last post by:
Hi! Situation two schemas: webviews: Contains a set of views with insert rules on them, accessed via a GUI. devconf: "Business logic", all the tables, functions, triggers that I want to...
2
by: dbuchanan52 | last post by:
Hello, I am building an application for Windows Forms using. I am new to SQL Server 'Views'. Are the following correct understanding of their use? 1.) I believe a view can be referenced in a...
15
by: rod.weir | last post by:
Fellow database developers, I would like to draw on your experience with views. I have a database that includes many views. Sometimes, views contains other views, and those views in turn may...
1
by: db2admin | last post by:
Hello, I am interested in capturing snapshot information using SQL functions or views but i can not reset monitor switches when i use following command. db2 "reset monitor for database...
2
by: SLauren | last post by:
Hi, I am getting the following error while restoring triggers from one db to another db in Windows XP using Mysql Administrator GUI Tool: Access denied for user 'User1'@'%' to database 'TestDB1'. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.