1

Topic: Statistics of changes under tables DB2

Good afternoon!
We do replication of basis DB2 by the second type of replication in Oracle with saving of history of all changes for a year.
It is necessary to estimate, in what to us it pours out on a source.
Therefore within the limits of this activity there is a task to estimate an amount of operations INSERT, UPDATE, DELETE under tables of DB DB2 on the average for days.
Prompt, whether the given statistics automatically in DB2 gathers?
In Oracle such information is in DBA_TAB_MODOFICATIONS.
Whether there is something similar in DB2?

2

Re: Statistics of changes under tables DB2

martemas;
Good afternoon.
Such  in DB2 it is typed from the moment of basis start by rising counters. If you want to receive the information for time intervals you should make something of type such:

 create table mon_get_table_hist as (
select current timestamp as ts, s.tabschema, s.tabname, s.rows_inserted, s.rows_updated, s.rows_deleted
from table ([url=https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.7.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0053945.html] mon_get_table [/url] (null, null,-2)) s
) definition only in some_tablespace; 

And through the necessary intervals of time to do for the selected tables:

 insert into mon_get_table_hist
select current timestamp, s.tabschema, s.tabname, s.rows_inserted, s.rows_updated, s.rows_deleted
from table (values
(' SYSIBM ', ' SYSTABLES')
, (' SYSIBM ', ' SYSCOLUMNS')
) t (tabschema, tabname)
, table (mon_get_table (t.tabschema, t.tabname,-2)) s;

Or if can and so the filter to impose on tables:

 insert into mon_get_table_hist
select current timestamp, s.tabschema, s.tabname, s.rows_inserted, s.rows_updated, s.rows_deleted
from table (mon_get_table (null, null,-2)) s
--where...
;

Then request on mon_get_table_hist calculate a difference for the necessary interval of time.

3

Re: Statistics of changes under tables DB2

Mark Barinstein;
Yes it and in  if it is fair, is typed  and dropped in a zero in following cases:
1) restarting
2) statistics collection under the table.
wink

4

Re: Statistics of changes under tables DB2

Mark Barinstein;
Thanks big!
Very much helped!

5

Re: Statistics of changes under tables DB2

Kind  - Eh;
Yes, it agree with you.
We considered it at calculations.