Connecting Tech Pros Worldwide Help | Site Map

How to tell if a table is in REORG PENDING state

deangc
Guest
 
Posts: n/a
#1: Nov 23 '07
I have some scripts that drop columns in DB2 9. This leaves the table
in a REORG PENDING state:

[IBM][CLI Driver][DB2/NT] SQL0668N Operation not allowed for reason
code "7" on table "tablename". SQLSTATE=57016

I want to write a script that finds all tables in this state and
REORGs them, but I don't know how to generate a set of tables that are
in this state: if I use REORGCHK_TB_STATS I will have to call it once
for every table in the database. Is there an easy way to tell what
tables are in a REORG_PENDING state?

I was hoping that STATUS in SYSCAT.TABLES would tell me, but no....
The Boss
Guest
 
Posts: n/a
#2: Nov 23 '07

re: How to tell if a table is in REORG PENDING state


deangc wrote:
Quote:
I have some scripts that drop columns in DB2 9. This leaves the table
in a REORG PENDING state:
>
[IBM][CLI Driver][DB2/NT] SQL0668N Operation not allowed for reason
code "7" on table "tablename". SQLSTATE=57016
>
I want to write a script that finds all tables in this state and
REORGs them, but I don't know how to generate a set of tables that are
in this state: if I use REORGCHK_TB_STATS I will have to call it once
for every table in the database. Is there an easy way to tell what
tables are in a REORG_PENDING state?
>
I was hoping that STATUS in SYSCAT.TABLES would tell me, but no....
Try the ADMINTABINFO Administrative View:

select TABSCHEMA, TABNAME
from SYSIBMADM.ADMINTABINFO
where REORG_PENDING = 'Y'

Described in the Information Center: http://tinyurl.com/3aqkes

HTH

--
Jeroen


Closed Thread


Similar DB2 Database bytes