Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-02-13T14:47:58Z by Jotac
Jotac
Jotac
82 Posts
ACCEPTED ANSWER

Pinned topic drop database

‏2013-02-13T11:31:24Z |
Hello,

DB2 v9.7.0.5 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?

ciao
GIovanni
Updated on 2013-02-13T14:47:58Z at 2013-02-13T14:47:58Z by Jotac
  • SystemAdmin
    SystemAdmin
    17917 Posts
    ACCEPTED ANSWER

    Re: drop database

    ‏2013-02-13T13:30:19Z  in response to Jotac
    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?

    Mine is:

    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".

    LooW
    • Jotac
      Jotac
      82 Posts
      ACCEPTED ANSWER

      Re: drop database

      ‏2013-02-13T14:47:58Z  in response to SystemAdmin
      DB21085I Instance "fakefake" uses "64" bits and DB2 code release "SQL09075"
      with level identifier "08060107".
      Informational tokens are "DB2 v9.7.0.5", "special_28356", "IP23292_28356", and
      Fix Pack "5".
      Product is installed at "/opt/ibm/db2/V9.7FP5".

      GIovanni