Recently in prod environment we are having problems while dropping the detached partitions its giving this error
""" DB21034E The command was processed as an SQL statement because it
was not a valid Command Line Processor command. During SQL processing
it returned: SQL20285N The statement or command is not allowed because
the table named "schemaname.tablename_JAN1" has detached dependents or
the asynchronous partition detach operation is not complete. Reason
code = "2". SQLSTATE=55057"""
I did some research and could find this from IBM saying we need to restart the instance to solve the issue. Link below I think you could have seen many of such incidents of what i described, please help me with this issue thanks in advance
Best Answer
When you detach a partition from a table, the detach operation returns quickly, but DB2 then starts a background process to clean up any global indexes. You can't drop the table containing the detached partition until this process completes.
So, have you verified that the asynchronous cleanup that occurs after you issue the
ALTER TABLE ... DETACH
is actually finished?