How to create a DB2 Tablespace in storage group STG1 and bufferpool BP01?


A table space is a logical entity in DB2 architecture. It is basically a collection of data files. A tablespace contains tables, indexes, objects, etc. To create a new tablespace we have to issue the following command.

CREATE TABLESPACE TABSPA1
   IN DBSET1
   USING STOGROUP STG1
   PRIQTY 50
   SECQTY 50
   BUFFERPOOL BP03

The CREATE AND TABLESPACE are the reserved words which are followed by the name of tablespace we want to create. In this case it is TABSPA1.

IN is a reserved word which is followed by the name of the database in which we want to create this tablespace. The database is DBSET1 in this case.

USING STOGROUP are the reserved words which are accompanied by the name of the storage group to be used for this tablespace.

The PRIQTY and SECQTY are reserved words which describe the storage space in KB for primary and secondary allocation respectively.

The BUFFERPOOL parameter is used to give the name of bufferpool which has to be used for this tablespace.

Updated on: 11-Sep-2020

112 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements