Everyone maybe has the experience when you try to drop one database in DB2, You use control center to select delete one database.  And it does works.

But when you try to set up one same-name database, system will give you the error message:

 

SQL1005N  The database alias "***" already exists in either the local database directory or system database directory.

You can take the following action:

db2 list db directory  ----- to check the directory of specific db;

catalog db db_name on directory  ---- Re-mount the db to its directory;

drop db db_name ---- delete the db;

 

Then you can re-create the same name db successfully

Explanation: 

The alias name specified has already been used. If no alias is specified in the catalog database command, the database name is used as the alias.  When a database is created, the alias name is the same as the database name.  

 This error may occur on the catalog database command when the 

alias already exists in the system database directory.  

 On the create database command this error may occur in one of 

the following situations: 

o   The alias already exists in the system database directory and local database directory.  

o   The alias already exists in the system database directory but not in the local database directory.  

o   The alias already exists in the local database directory but  not in the system database directory.  

User Response: 

For the catalog database command, uncatalog the alias from the system database directory and resubmit your original command or catalog the database with a different alias name.  

 For the create database command, do the following operations with respect to the above 3 situations: 

o   Drop the database using the alias name.  Resubmit your original command.  

o   Uncatalog the alias.  Resubmit your original command.  

o   Catalog the alias into the system database directory.  Drop  the database using the same alias.  Resubmit your original command.