469,299 Members | 2,050 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

How to tell if a table is in REORG PENDING state

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....
Nov 23 '07 #1
1 22390
deangc wrote:
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
Nov 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by GB | last post: by
7 posts views Thread by satish mullapudi | last post: by
1 post views Thread by amitabh.mehra | last post: by
1 post views Thread by balubkp | last post: by
1 post views Thread by balubkp | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.