-497 THE MAXIMUM LIMIT OF INTERNAL IDENTIFIERS HAS BEEN EXCEEDED FOR DATABASE database-name

Explanation

The SQL statement cannot be executed because an internal identifier limit has been exceeded for the database. The cause of this error is due to one of the following:
  1. On a CREATE DATABASE statement, the limit of 65217 DBIDs has been exceeded.
  2. For all other statements, the limit of 32767 OBIDs has been exceeded for that database.
  3. If the database is a WORKFILE database, then one of the following reasons might apply:
    • The number of tablespaces in the WORKFILE database has exceeded the limit of 500.
    • The number of indexes defined on declared global temporary tables belonging to all agents on the local Db2 member has exceeded the limit of 10,000.
    • The number of tables and triggers belonging to a local agent exceeded the limit of 11,767. The tables in the WORKFILE database include work files, created global temporary tables, and declared global temporary tables.

System action

The statement cannot be processed.

Programmer response

Take the appropriate action as described in the following cases:
  1. In the case of a DBID limit being exceeded, DROP all unused databases and issue a COMMIT.
  2. In the case of an OBID limit being exceeded, take one of the following actions:
    • Specify a different database.
    • Drop all unused table spaces or indexes in the database and issue a COMMIT.
    • If the database contains multi-table table spaces that contain a mix of used and unused tables, drop all unused tables and issue a COMMIT. Run the REORG utility on each affected table space, and then run the MODIFY RECOVERY utility to reclaim the dropped table OBIDs. For more information, see Reclaiming space in the DBD.

SQLSTATE

54041