Tuesday, August 13, 2013

db2 drop WAREHOUS - how to delete using force.


db2 => connect to warehous

   Database Connection Information

 Database server        = DB2/LINUX 9.7.4
 SQL authorization ID   = DB2INST1
 Local database alias   = WAREHOUS


db2 => list db directory

 System Database Directory

 Number of entries in the directory = 2

Database 1 entry:

 Database alias                       = TEPS
 Database name                        = TEPS
 Local database directory             = /home/db2inst1
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

Database 2 entry:

 Database alias                       = WAREHOUS
 Database name                        = WAREHOUS
 Local database directory             = /home/db2inst1
 Database release level               = d.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =
 


quit 

 db2 force applications all
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

db2 drop database TEPS

-or-
db2  //connect to warehous - first.
drop database TEPS


To drop the WAREHOUS database:( this is if you want to start all over fresh )
 
db2 => drop database WAREHOUS
SQL1035N  The database is currently in use.  SQLSTATE=57019
db2 => quit




db2 => drop database WAREHOUS
DB20000I  The DROP DATABASE command completed successfully. <====== SUCCESS at last.

db2 => list db directory
SQL1057W  The system database directory is empty.  SQLSTATE=01606




No comments:

Post a Comment