Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Better Update of column CARD on syscat.tables

499 views
Skip to first unread message

Bruce

unread,
Oct 10, 2011, 3:44:51 PM10/10/11
to
Hi all -

DB2 for LUW 9.1.4...on AIX 6...

Going through a PeopleSoft migration..about 3600 tables...big boss
wants us to do a runstats AFTER a redirected-restore to ensure that
the row-count is the same on the target DB as it was on the source...I
tried to explain...etc.etc.etc... but they still want this.

I did 'db2 reorgchk update statistics...' and it took 17 hours.

I did a 'db2 runstats on table xyz' for the entire DB and it took 10
hours...

Is there a better faster way to get CARD on syscat.tables updated?

I suppose I could SELECT COUNT(*) for all tables...on source and
target DB's...and write the results somewhere and compare...

The entire exercise is pointless but...still...thought I'd
ask....Looking for a quick thinggie here.

Arun Srini

unread,
Oct 11, 2011, 6:22:45 AM10/11/11
to
Reorgchk is an utility to check the requirement for a reorg - which is
the activity involving de-clustering the data in a table or index.
The option of 'update statistics' does collect all the stats but it's
main aim is to check for reorg and so does a lot more than just
collecting stats.
runstats is mainly used to collect statistics for db2 optimizer's use
and it too does a lot more than collect a cardinality of the
table(frequency stats, quantile stats etc). It helps DB2 to form the
best access paths for any query, and it's cardinality may not be
accurate when run while the table data is being modified.
What you should be doing is to fire off 'select count(*)' statements
and check against the source data and using the above two utilities is
like going to Italy to eat a pizza.

Arun

Bruce

unread,
Oct 11, 2011, 8:14:35 AM10/11/11
to
> > ask....Looking for a quick thinggie here.- Hide quoted text -
>
> - Show quoted text -

Did you even read my question? Sheesh...I know all
that...obviously...I pointed it all out in my posting...I'm asking for
a simple easier way to update CARD without running a long-ass DB2
utility that does 'the world'.

MarkB

unread,
Oct 12, 2011, 2:15:22 AM10/12/11
to
Hi Bruce,

"A simple easier way":

update sysstat.tables
set card=NNN
where tabschema='YOUR_TABLE_SCHEMA' and tabname='YOUR_TABLE_NAME'

and you will see the same value NNN in the syscat.tables.card after
that.

Regards,
Mark B.

Frederik Engelen

unread,
Oct 27, 2011, 12:12:03 PM10/27/11
to
Check the db2look mimic mode...

--
Frederik Engelen
0 new messages