Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2006
    Posts
    119

    Unanswered: 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.

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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.

  3. #3
    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

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Jan 2006
    Posts
    119
    Thanks to all.

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  7. #7
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    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).

Posting Permissions

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