DB Bufferpool


0  0 2015-12-15 08:59:39

DB2 - Bufferpools

        The bufferpool is portion of a main memory space which is allocated by the database manager. The purpose of bufferpools is to cache table and index data from disk. All databases have their own bufferpools. A default bufferpool is created at the time of creation of new database. It called as “IBMDEFAULTBP”. Depending on the user requirements, it is possible to create a number of bufferpools. In the bufferpool, the database manager places the table row data as a page. This page stays in the bufferpool until the database is shutdown or until the space is written with new data. The pages in the bufferpool, which are updated with data but are not written onto the disk, are called “Dirty” pages. After the updated data pages in the bufferpool are written on the disk, the bufferpool is ready to take another data.

       Relationship between tablespaces and bufferpools: Each table space is associated with a specific buffer pool in a database. One tablespace is associated with one bufferpool. The size of bufferpool and tablespace must be same. Multiple bufferpools allow you to configure the memory used by the database to increase its overall performance.

  • Bufferpool sizes

          The size of the bufferpool page is set when you use the “CREATE DATABASE” command. If you do not specify the page size, it will take default page size, which is 4KB. Once the bufferpool is created, it is not possible to modify the page size later

  • Creating the bufferpool

          To create a new bufferpool for database server, you need two parameters namely, “bufferpool name” and “size of page”. The following query is executed to create a new bufferpool.

Syntax:  ‘bp_name’ indicates bufferpool name and ‘size’ indicates size for page you need to declare for bufferpools (4K, 8K, 16K, 32K)

              db2 create bufferpool <bp name> pagesize <size>

  • Dropping the bufferpool

Before dropping the bufferpool, it is required to check if any tablespace is assigned to it.

Syntax: Drop bufferpool <bp_name>

Comments (0)

Post Your Comments


Hong Kong Office

Find Us On

Website Development Company
Digital Marketing
website development company in Hong Kong
website designer in pune