• About Dangerous DBA
  • Table of Contents
Dangerous DBA A blog for those DBA's who live on the edge

Keep your databases active

April 30, 2011 7:26 pm / 2 Comments / dangerousDBA

Do  you have applications that are slow to respond sometimes especially when you connect and disconnect. DB2 to save resources allocates memory (bufferpools etc) and deallocates memory at the first and last connection respectively. Using the following command you can activate the database and the memory will still allocated and your applications should respond better:

ACTIVATE DATABASE <Database Name>

To do this you need to log on as a user that has sysadm, sysctrl or sysmaint privileges, e.g the instance owner. You have to be aware the if you ever want to stop the instance properly you will have to run the deactivate database command, otherwise you will get an error message stating that there are still connections and the database can’t be stopped. So the following will do that for you:

DEACTIVATE DATABASE <Database Name>

Again to do this you need to log on as a user that has sysadm, sysctrl or sysmaint privileges, e.g the instance owner. This will not stop the connections that are currently running against the database, but it will allow you to run the db2stop force command, or wait for them to finish before stopping you instance.

The full syntax for activating the database can be found here. The full syntax for deactivating the database can be found here.

Posted in: Activate Database, DB2, DB2 Administration, DB2 Maintenance, Deactivate Database, IBM

2 Thoughts on “Keep your databases active”

  1. Alan on May 1, 2011 at 5:02 am said:

    Phil, A very useful post. Thanks for this.
    When the database is active, how do I know if the database was activated using ACTIVATE DATABASE Command or was activated by the first connection.
    Thanks
    Alan

    Reply↓
    • philipcarrington on May 8, 2011 at 7:27 am said:

      Hi,
      Thank you for the comment you can use this command I will do another short article on it:

      list active databases

      Cheers Phil

      Reply↓

Leave a Reply to philipcarrington Cancel reply

Post Navigation

← Previous Post
Next Post →

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 757 other subscribers

Recent Posts

  • Self generating Simple SQL procedures – MySQL
  • Google Cloud Management – My Idea – My White Whale?
  • Position Tracker – The Stub – Pandas:
  • Position Tracker – The Stub
  • Position Tracker – In the beginning
  • Whats been going on in the world of the Dangerous DBA:
  • QCon London Day 1
  • Testing Amazon Redshift: Distribution keys and styles
  • Back to dangerous blogging
  • DB2 10.1 LUW Certification 611 notes 1 : Physical Design

Dangerous Topics

added functionality ADMIN_EST_INLINE_LENGTH Bootcamp colum convert data types DB2 db2 DB2 Administration DB2 Development db2advis db2licm Decompose XML EXPORT GCP Google IBM IBM DB2 LUW idug information centre infosphere IOT LOAD merry christmas and a happy new year Position Tracking python Recursive Query Recursive SQL Reorganisation Reorganise Reorganise Indexes Reorganise Tables Runstats sql statement Stored Procedures SYSPROC.ADMIN_CMD Time UDF User Defined Functions V9.7 V10.1 Varchar XML XML PATH XMLTABLE

DangerousDBA Links

  • DB2 for WebSphere Commerce
  • My Personal Blog

Disclaimer:

The posts here represent my personal views and not those of my employer. Any technical advice or instructions are based on my own personal knowledge and experience, and should only be followed by an expert after a careful analysis. Please test any actions before performing them in a critical or nonrecoverable environment. Any actions taken based on my experiences should be done with extreme caution. I am not responsible for any adverse results. DB2 is a trademark of IBM. I am not an employee or representative of IBM.

Advertising

© Copyright 2022 - Dangerous DBA
Infinity Theme by DesignCoral / WordPress