By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,007 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,007 IT Pros & Developers. It's quick & easy.

Modification time

P: n/a
Hi!

I'm using DB2 v8.2.2 on Windows.
Is there a way to know when a table was last modified (ALTER TABLE). There
is create time for the table in SYSCAT.TABLES, but I have not seen
modification time.

Any pointers, please ?

Best regards,
Kovi
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
creation is one time event and create-time recorded once in syscat. But
mod time could change from msec to msec on every table. I don't think
it is just impractical for db2 to maintain mod time for each table
object.

JL

Nov 12 '05 #2

P: n/a

<jl*******@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
creation is one time event and create-time recorded once in syscat. But
mod time could change from msec to msec on every table. I don't think
it is just impractical for db2 to maintain mod time for each table
object.


It is when you consider that you'd be doubling the number of updates you'd
have to do for every SQL -- you'd have the update on the table as per the
SQL statement (insert/update/delete), and then a corresponding update to the
proper data element in the catalogs.

Do you think that people who don't care about the last mod time to a table
should suffer the performance penalty?

The DB2 event monitor feature is a great way to track this information, so
if you want/need the last mod time for each table, configure and enable the
appropriate event monitor.

--
Matt Emmerton
Nov 12 '05 #3

P: n/a
If you take a look at your db2 admin guide and do a search on AUDIT you'll
find DB2 gives you an abilitiy to audit only OBJMAINT (amongst other things)
which will track for you in a log all commands maintaining (including ALTER)
db objects.
You may have to pay a performance (slight I think) hit for it but it gives
you exactly what you want:
Who, what, when, where, how. What more do you need!!
HTH, Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Gregor Kovac" <gr**********@mikropis.si> a écrit dans le message de news:
25*****************@news.siol.net...
Hi!

I'm using DB2 v8.2.2 on Windows.
Is there a way to know when a table was last modified (ALTER TABLE). There
is create time for the table in SYSCAT.TABLES, but I have not seen
modification time.

Any pointers, please ?

Best regards,
Kovi


Nov 12 '05 #4

P: n/a
Matt Emmerton wrote:
It is when you consider that you'd be doubling the number of updates you'd
have to do for every SQL -- you'd have the update on the table as per the
SQL statement (insert/update/delete), and then a corresponding update to
the proper data element in the catalogs.


I thought the OP was interested in the timestamp when the table definition
was changed last.

Tracking the changes of the data in the table is in the catalog, of course,
not very smart because the catalog would instantly become a bottle-neck.

--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena
Nov 12 '05 #5

P: n/a
Hi!

Yes, this is OK, but I need to do a SELECT stmt from my Java program or my
SQL procedure.
How do I do that if logs are stored in some external file ?

Best regards,
Kovi

Pierre Saint-Jacques wrote:
If you take a look at your db2 admin guide and do a search on AUDIT you'll
find DB2 gives you an abilitiy to audit only OBJMAINT (amongst other
things) which will track for you in a log all commands maintaining
(including ALTER) db objects.
You may have to pay a performance (slight I think) hit for it but it gives
you exactly what you want:
Who, what, when, where, how. What more do you need!!
HTH, Pierre.


Nov 12 '05 #6

P: n/a
There's an audit command (See your Admin. Guide) that you can put in a
script to extract the data in an asc del file. You can then use a load
command to load the data in a table you build and extract what you need and
query against the table.
Your proc can probably do all that work.
Hey, it's just a suggestion if you don't think it fits.....!
HTH, Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Gregor Kovac" <gr**********@mikropis.si> a écrit dans le message de news:
Na*****************@news.siol.net...
Hi!

Yes, this is OK, but I need to do a SELECT stmt from my Java program or my
SQL procedure.
How do I do that if logs are stored in some external file ?

Best regards,
Kovi

Pierre Saint-Jacques wrote:
If you take a look at your db2 admin guide and do a search on AUDIT
you'll
find DB2 gives you an abilitiy to audit only OBJMAINT (amongst other
things) which will track for you in a log all commands maintaining
(including ALTER) db objects.
You may have to pay a performance (slight I think) hit for it but it
gives
you exactly what you want:
Who, what, when, where, how. What more do you need!!
HTH, Pierre.


Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.