DB2 - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

DB2 Bufferpool

DB2 Bufferpool

shape Description

The bufferpool is segment of a fundamental memory space that can be distributed by the manage of the database. The function for the bufferpools includes in index data and cache table that are reserved inside the table. Each and every databases has their individual bufferpools. A default bufferpool is generated at the time of generation of a new database. It called as "IBMDEFAULTBP". Contingent upon the client necessities, it is conceivable to make various bufferpools. In the bufferpool, the manager of the database puts the row of the table information as a page. This page reserved in the bufferpool until the database is shutdown or until the space is composed with new information. All the pages inside the bufferpool are overhauled with information yet are not composed onto the disk, called as "Dirty" pages. After the overhauled information pages in the bufferpool are composed in the disk, the bufferpool is prepared to take another information.

Bufferpool size

shape Description

The bufferpool page size is a collection while utilizing the command "DATABASE CREATE". On the off chance that the user don't indicate the page size, it will take default page size, which is 4KB. Once the bufferpool is generated, it is unrealistic to alter the page estimate later.

shape Conceptual figure

shape Syntax

The syntax for bufferpool is as follows:
Select * from syscat.bufferpools Syscat => Is a command for viewing the files. Bufferpools => Is a segment in the distributed database.

shape Examples

By viewing the below example, the concept of bufferpool can be understood easily. [c] db2 => create database bufferpool bfrdb2 DB20000I The CREATE DATABASE command completed successfully. db2 => connect to bufferpool Database Connection Information Database server = DB2/NT64 11.1.0 SQL authorization ID = KALYAN.V... Local database alias = HOPE Db2 =>Create bufferpool bfrdb2 immediate size 1000 page size 4 k DB0000I The SQL command completed successfully. db2 => select * from syscat.bufferpools BPNAME BUFFERPOOLID DBPGNAME NPAGES PAGESIZE ESTORE NUMBLOCKPAGES BLOC KSIZE NGNAME -------------------------------------------------------------------------------- ------------------------------------------------ ------------ ------------------ -------------------------------------------------------------------------------- ------------------------------ ----------- ----------- ------ ------------- ---- ------- ------------------------------------------------------------------------ -------------------------------------------------------- IBMDEFAULTBP 1 - -2 4096 N 0 0 - 1 record(s) selected. [/c]

Bufferpool creation

shape Description

To creating another bufferpool for database server, user requires two parameters in particular, “size of page” and “bufferpool name”. The accompanying inquiry is executed to make another bufferpool.

shape Syntax

The syntax for creating a new bufferpool is as follows.
Create bufferpool pagesize Bufferpool => Is a segment in the distributed database. Bp_name => Name of the buffer Size => The size of the bufferpool in the database.

shape Examples

By viewing the below example, the concept of creating a new buffer can be understood easily. [c] db2 => create bufferpool bpnew pagesize 8192 DB20000I The SQL command completed successfully. [/c]

Dropping a Bufferpool

shape Description

Dropping a bufferpool will drop the entire bufferpool from the database.

shape Syntax

The syntax for creating a new bufferpool is as follows.
drop bufferpool Bufferpool => Is a segment in the distributed database. Bp_name => Name of the buffer

shape Examples

By viewing the below example, the concept of dropping a buffer can be understood easily. [c] db2 => drop bufferpool bpnew DB20000I The SQL command completed successfully. [/c]

Summary

shape Key Points

  • DB2 Bufferpools - Is a fundamental segment inside the memory space.
  • Bufferpool size - Is a buffer pool size that are oftenly created.
  • Bufferpool creation - Creation of bufferpool with 2 parameters.
  • Dropping a bufferpool - Dropping a bufferpool from the database.