By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,287 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,287 IT Pros & Developers. It's quick & easy.

How to tell if a table is in REORG PENDING state

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.