Kill a zombie database (not in the directory but can’t create it)

I tried to create a database but couldn’t because of “SQL1005N  The database alias “W3IBMDB” already exists in either the local database directory or system database directory.“. I knew I had once such a database, but I thought it existed no more. And indeed “list database directory” didn’t list it. So it was there and it wasn’t there.

It seems that DB2 remembers the old databases if you don’t remove them in the correct way (whatever that is). The steps to fix this were:

  • catalog db w3ibmdb
  • check “list database directory” to verify that it is listed now
  • drop database W3IBMDB
  • create database W3IBMDB                                      — Voila – no more error messages

Published by Jakub Holý

I’m a JVM-based developer since 2005, consultant, and occasionally a project manager, working currently with Iterate AS in Norway.