DB2 v184.108.40.206 on Linux
I have done...
1 db2 list active databases (I saw the interested db alias)
2 db2 connect to DB2PDB (it work)
3 db2 list tables (it work)
4 db2 drop database DB2PDB (it work, no messages returned)
5 db2 list tables (it work! still show tables)
6 db2 terminate (it work, no messages returned)
7 db2 list db directory (it work, I do not see anymore the local db alias)
8 db2 drop database DB2PDB (return no database alias found)
9 db2 list active databases (I still see DB2PDB active)
10 db2 deactivate database DB2PDB (return no database alias found)
11 db2 list active databases (I still see DB2PDB active)
13 db2 connect to DB2PDB (return no database alias found)
14 df (the disk space it's still used by the database)
After the db2stop/db2start finally there are no more traces of the database.
The question are...
1) it's expected that a DROP DATABASE is allowed on database with connection active? it's seem strange to me.
2) how come was necessary to stop/start the instance to release the space used by the database?
It's "bizzarre" that the drop database delete the db alias on the dictionary BUT do not close the db and release space, isn't?
This topic has been locked.
Pinned topic drop database
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
SystemAdmin 110000D4XK17917 Posts
Re: drop database2013-02-13T13:30:19ZThis is the accepted answer. This is the accepted answer.Hi Jotac,
This is not the intended behavior. You should get a SQL1035N error as detailed in the docs.
In order to drop the database you need exclusive access which cannot be granted as there is already a connection, or the database has been explicitly activated.
I have done same sequence in 10.1.2 and do not get same behavior. What I get is a SQL1035N when I reach your step number 4.
Which level are you in?
DB21085I This instance or install (instance name, where applicable: "DB2") uses "32" bits and DB2 code release "SQL10012" with level identifier "0203010E".
Informational tokens are "DB2 v10.1.200.238", "s121127", "IP23388", and Fix Pack "2".
Jotac 270004UBMH82 Posts
Re: drop database2013-02-13T14:47:58ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
with level identifier "08060107".
Informational tokens are "DB2 v220.127.116.11", "special_28356", "IP23292_28356", and
Fix Pack "5".
Product is installed at "/opt/ibm/db2/V9.7FP5".