Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2011
    Posts
    5

    Unanswered: db2 table inactive after a patch

    I ran the following db2 script with no problem on my terminal. but when I try to access the actual front end page involved with this table I get the error (code 57016) that indicates the table is inactive. I restarted the db2 but still this issue is happening.

    Can anyone please help me out here

    Code:
    alter table CUSTOMER alter column Delivery set default 0! 
    alter table CUSTOMER alter column Delivery set not null! 
    
    alter table CUSTOMER add constraint pref_ck4 check (Delivery between 0 and 1)!
    
    commit!
    quit!
    and the rollback was:

    Code:
    alter table CUSTOMER alter Delivery drop DEFAULT!
    alter table CUSTOMER alter COLUMN Delivery drop NOT NULL!
    
    alter table CUSTOMER drop constraint pref_ck4!
    
    reorg table CUSTOMER!
    
    commit!
    quit!
    The error I receive:

    UncategorisedDatabaseException: Query=[SELECT * FROM CUSTOMER WHERE ID = ?], database vendor error message is: DB2 SQL error: SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7;CUSTOMER, UncategorisedDatabaseException errorCode = -668

    db2 => ? 57016

    SQLSTATE 57016: The table cannot be accessed, because it is inactive.

  2. #2
    Join Date
    Nov 2011
    Posts
    334
    It looks like the table is in reorg pending state. "sqlerrmc :7"-->that must be the reason code。
    You can confirm this using the following sql:
    SELECT TABSCHEMA, TABNAME, NUM_REORG_REC_ALTERS, REORG_PENDING FROM SYSIBMADM.ADMINTABINFO where tabname='CUSTOMER '
    where REORG_PENDING is 'Y' indicate the table need to be reorganized。

  3. #3
    Join Date
    Nov 2011
    Posts
    5
    Quote Originally Posted by fengsun2 View Post
    It looks like the table is in reorg pending state. "sqlerrmc :7"-->that must be the reason code。
    You can confirm this using the following sql:
    SELECT TABSCHEMA, TABNAME, NUM_REORG_REC_ALTERS, REORG_PENDING FROM SYSIBMADM.ADMINTABINFO where tabname='CUSTOMER '
    where REORG_PENDING is 'Y' indicate the table need to be reorganized。

    Thanks for your reply. I ran your query and the answer is yes.
    I then tried to reorganizing the table and now I receive the following error:

    SQL2216N SQL error "-900" occurred while reorganizing a database table or its
    indexes.

  4. #4
    Join Date
    Nov 2011
    Posts
    5
    Quote Originally Posted by comerun View Post
    Thanks for your reply. I ran your query and the answer is yes.
    I then tried to reorganizing the table and now I receive the following error:

    SQL2216N SQL error "-900" occurred while reorganizing a database table or its
    indexes.
    Actually somehow I managed to get it reorganized. now the question is what was wrong with the patch script that created this issue?!

    I dont need to run the reOrg when alter and not drop right?!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •