If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Staring and Stopping Databases

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-13-11, 07:17
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Staring and Stopping Databases

I know it is possible to start and stop a DB2 instance which can contain multiple databases. I was wondering is it possible to start and stop individual databases?

Also, is there a command which will tell me the status of what is running on a server.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 08-13-11, 08:47
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
The db is considered stopped (inactive/offline) when you don't see any applications connected to it in the list applications output and it's not listed in the list active databases output.
Reply With Quote
  #3 (permalink)  
Old 08-13-11, 10:12
skchandra skchandra is offline
Registered User
 
Join Date: Nov 2010
Posts: 14
In addition to what db2girl said, you can issue explicitly start and stop selected databases by using commands.

db2 "ACTIVATE DATABASE db_name"

db2 "DEACTIVATE DATABASE db_name"


The explicit activation has some performance benefits over the implicit activation ( "CONNECT TO") method.

Cheers,
SK Chandra
Reply With Quote
  #4 (permalink)  
Old 08-14-11, 16:47
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
Also, is there a command which will tell me the status of what is running on a server.

yes : list applications (show detail)
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 08-14-11, 17:38
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Thanks to all.
Reply With Quote
  #6 (permalink)  
Old 08-15-11, 10:14
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
There needs to be a clarification on the ACTIVATE DATABASE and DEACTIVATE DATABASE commands. When you issue the ACTIVATE DATABASE command, it will start the database if is is not already started (either by a previous ACTIVATE DATABASE command or a connection to the database). It will also prevent the database from going inactive when the last connection is ended whether it started it or not. The DEACTIVATE DATABASE will only stop the database if there are no connections to it. If there are connections, the database will then deactivate when the last connection has ended.

Andy
Reply With Quote
  #7 (permalink)  
Old 08-16-11, 06:12
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Quote:
Originally Posted by ARWinner View Post
There needs to be a clarification on the ACTIVATE DATABASE and DEACTIVATE DATABASE commands. When you issue the ACTIVATE DATABASE command, it will start the database if is is not already started (either by a previous ACTIVATE DATABASE command or a connection to the database). It will also prevent the database from going inactive when the last connection is ended whether it started it or not. The DEACTIVATE DATABASE will only stop the database if there are no connections to it. If there are connections, the database will then deactivate when the last connection has ended.

Andy
That is why propagate a 1:1 relationship between instances & databases. If 1 database has 1 dedicated instance it is more easy to manage (db2stop/db2start).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On