DB2 Version 10.1 for Linux, UNIX, and Windows

Modifying buffer pools

There are a number of reasons why you might want to modify a buffer pool, for example, to enable self-tuning memory. To do this, you use the ALTER BUFFERPOOL statement.

Before you begin

The authorization ID of the statement must have SYSCTRL or SYSADM authority.

About this task

When working with buffer pools, you might need to do one of the following tasks:
To alter a buffer pool using the command line, do the following:
  1. To get the list of the buffer pool names that already exist in the database, issue the following statement:
        SELECT BPNAME FROM SYSCAT.BUFFERPOOLS
  2. Choose the buffer pool name from the result list.
  3. Determine what changes must be made.
  4. Ensure that you have the correct authorization ID to run the ALTER BUFFERPOOL statement.
    Note: Two key parameters are IMMEDIATE and DEFERRED. With IMMEDIATE, the buffer pool size is changed without having to wait until the next database activation for it to take effect. If there is insufficient database shared memory to allocate new space, the statement is run as DEFERRED.

    With DEFERRED, the changes to the buffer pool will not be applied until the database is reactivated. Reserved memory space is not needed; the database manager allocates the required memory from the system at activation time.

  5. Use the ALTER BUFFERPOOL statement to alter a single attribute of the buffer pool object. For example:
        ALTER BUFFERPOOL buffer pool name SIZE number of pages
  • The buffer pool name is a one-part name that identifies a buffer pool described in the system catalogs.
  • The number of pages is the new number of pages to be allocated to this specific buffer pool. You can also use a value of -1, which indicates that the size of the buffer pool should be the value found in the buffpage database configuration parameter.

The statement can also have the DBPARTITIONNUM <db partition number> clause that specifies the database partition on which the size of the buffer pool is modified. If this clause is not specified, the size of the buffer pool is modified on all database partitions except those that have an exception entry in SYSCAT.BUFFERPOOLDBPARTITIONS. For details on using this clause for database partitions, see the ALTER BUFFERPOOL statement.

Changes to the buffer pool as a result of this statement are reflected in the system catalog tables when the statement is committed. However, no changes to the actual buffer pool take effect until the next time the database is started, except for successful ALTER BUFFERPOOL requests specified with the default IMMEDIATE keyword.

There must be enough real memory on the computer for the total of all the buffer pools that you have created. There also needs to be sufficient real memory for the rest of the database manager and for your applications.