On 16 Feb., 23:28, "morch" <f...@mairhtin.comwrote:
C'MON... SOMEONE must have an answer to this. :) Please!!
Mairhtin
On Jan 30, 10:10 am, "morch" <f...@mairhtin.comwrote:
Hello,
I have an oddity on a production database. I get the following from
the DB CFG :
Backup pending = NO
Database is consistent = NO
Rollforward pending = TABLESPACE
Restore pending = NO
but no tablespaces are in a state other than 0 when I do a list
tablespaces show detail. ?????
How can I find out which tablespace is in conflict?
Mairhtin O'Feannag
aka mairhtin at mairhtin dot com
Weird - a pragmatic method to test it would be:
Just pick by random a table from each tablespace and do a "select *
with fetch first 1 rows only". If all selects work well then db2 cfg
lies - if not you'll know which tablespace has a problem. You can
generate the necessary select with a sql query like this:
with temp1 as
(SELECT max(rtrim(tabschema) concat '.' concat rtrim(TABNAME)) as
TABNAME,TBSPACEID
FROM SYSCAT.TABLES where tbspaceid 0
group by tbspaceid)
select 'SELECT * FROM ' concat tabname concat ' FETCH FIRST 1 ROWS
ONLY;' as SELECT_STMT from temp1
This method will not cover tablespaces where only indexes are stored
in. In this case you will need to modify the selects in such a way
that an index access will happen
HTH
Joachim