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;

About these ads

Have Something to Say? Post Your Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s