Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Posts
    5

    Unanswered: How do I just stop a db and not the instance

    Hi,

    I have to be sure, that nobody can connect to a special database or manipulate the data inside.
    So I force the applications to disconnect. Now I want to be sure that no application can connect to the database. It works with db2stop, but in that way the whole instance with all databases is stopped.

    It is important, that all other databases are running.

    How do I stop just one database?

    Thanks,
    Volle

    PS: I tried it with quiesce database, but I still can connect to the database.

  2. #2
    Join Date
    Nov 2002
    Location
    Rio de Janeiro - Brazil
    Posts
    78

    Re: How do I just stop a db and not the instance

    Hey Volle,
    There´s one sollution, can´t tell it´s the best one, but might work.
    Actually you have 2 options. One is to remove the connection permission from all users, and the other is to establish a connection in exclusive mode:

    After forcing all connections from the database, connect to the database in exclusive mode. This way, no other user will be able to connect to DB while you´re connected. As far as I´ve read, you can´t shut down a single database, only the whole instance.

    The connection statement to aquire the exclusive mode is:
    "CONNECT TO <DB> IN EXCLUSIVE MODE [ON SINGLE NODE] [USER username [USING password]]"

    HTH
    Fernando.

    Originally posted by volle
    Hi,

    I have to be sure, that nobody can connect to a special database or manipulate the data inside.
    So I force the applications to disconnect. Now I want to be sure that no application can connect to the database. It works with db2stop, but in that way the whole instance with all databases is stopped.

    It is important, that all other databases are running.

    How do I stop just one database?

    Thanks,
    Volle

    PS: I tried it with quiesce database, but I still can connect to the database.

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: How do I just stop a db and not the instance

    When using connect in exclusive mode, you should be aware that the same user can connect from another session ., ie ,

    connect to sample user db2admin in exclusive mode

    and from another window, if you say

    connect to sample user db2admin in share mode

    The second statement will work ... it will fail only if you try to connect as another user ..

    Cheers

    Sathyaram
    Last edited by sathyaram_s; 06-30-03 at 13:35.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    In DB2 OS/390 one can stop a database or tablespace, and then start it in read-only mode, utility only mode, etc. This feature is sorely needed on the other platforms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •