DB2- Creating Table Spaces

There are 3 types of Db2 table spaces.

  1. Universal Partition-By-Growth (PBG) table spaces.
  2. Universal Partition-By-Range (PBR) table spaces
  3. Segmented Tables spaces

There are LOB and XML table spaces.

PBG- Is the default table space.

LOB table spaces will be used for BLOB,CLOB and DBCLOB.

General Rule:

Let us assume we want to create a table in DB2. The below is the process.

CREATE DATABASE DB_SAMP;

CREATE TABLESPACE TS_SAMPP
         IN DB_SAMP
         ERASE NO NUMPARTS 3
         (PART 1
          USING STOGROUP SG_SAMP1
          PRIQTY 2000 SECQTY 50
          COMPRESS NO,

          PART 2
          USING STOGROUP SG_SAMP2
          PRIQTY 4000 SECQTY 150
          COMPRESS YES,

          PART 3
          USING STOGROUP SG_SAMP3
          PRIQTY 1000 SECQTY 50
          COMPRESS YES)

         LOCKSIZE PAGE   BUFFERPOOL BP1   CLOSE NO;
CREATE TABLE TB_SAMP … IN DB_SAMP.TS_SAMPP;

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.