Personal tools
You are here: Home Forums DB2 How to Stop One Database Under Single Instance??
Navigation
Log in


Forgot your password?
 
Document Actions

How to Stop One Database Under Single Instance??

Up to DB2

How to Stop One Database Under Single Instance??

Posted by Pawan at May 12. 2008

I have around 30 databases in single instance running  How can I stop only one database so that the users can't access that database?


I have already deactivated the database in my server like below, still the users are able to connect to it



db2 deactivate db



so how i can stop the users???



Thanks & Regards


Pawan


Re: How to Stop One Database Under Single Instance??

Posted by perallis at May 12. 2008

Hello Pawan,

You do that executing the followings commands:


db2 connect to <dbname>

Where <dbname> is the database name you desire no permit connections


db2 quiesce db immediate

The example above forces off all users with connections to the database.


After QUIESCE DATABASE, users with sysadm, sysmaint, sysctrl, or dbadm authority, and GRANT/REVOKE privileges can designate who will be able to connect. This information will be stored permanently in the database catalog tables.


For example,


grant quiesce_connect on database to <username/groupname>  
revoke quiesce_connect on database from <username/groupname>

Re: How to Stop One Database Under Single Instance??

Posted by perallis at May 12. 2008

Example:


db2 connect to sample

 Database Connection Information

 Database server        = DB2/NT 9.5.0
 SQL authorization ID   = PERALLIS
 Local database alias   = SAMPLE


db2 quiesce db immediate

DB20000I  The QUIESCE DATABASE command completed successfully.


db2 connect to sample

SQL0752N  Connecting to a database is not permitted within a logical unit of
work when the CONNECT type 1 setting is in use.  SQLSTATE=0A001


Powered by Ploneboard
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls