IBM Support

DROP Database fails with 'SQL1035N The database is currently in use' error.

Troubleshooting


Problem

SQL1035N The database is currently in use. SQLSTATE=57019 when trying to DROP database

Cause

There are still applications trying to connect to the database even after force applications

Resolving The Problem

1) First attempt to force the applications. Then try to drop the database.

db2 force application all

db2 drop db <dbname>

2) If this fails, recycle the instance and unset db2comm=tcpip to prevent remote connections over TCP/IP to connect

db2stop force

db2set db2comm=

db2start

db2 drop db <dbname>

After performing DROP database, set db2comm=tcpip.

db2stop force

db2set db2comm=tcpip

db2start

db2 drop db <dbname>

3) If this still doesn't work and the source of the connections are local ones, there is no real way to stop local connections from accessing the database, unsetting db2comm=tcpip will only stop incoming connections from TCP/IP clients. If there are local connections still arriving, investigation may need to be done to stop the source of those connections.

Quiescing the database or deactivating would not work in this case because the applications are continuously trying to connect to the database.

See Technote 1588531 (DROP database fails with SQL1035N) for an alternate solution.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Routines (SP & UDF) - SQL","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21691319