How to create a DB2 segmented tablespace TABSPAC2 in storage group STOGRP1?


A segmented table space is divided in multiple segments. A segment is defined as a contiguous set of fixed number of pages. This fixed number is defined during the table space definition using the SEGSIZE parameter. The SEGSIZE serves multiple purposes - It defines the tablespace as segmented and also defines the size of the segment.

In a segmented tablespace, the rows of a table are stored in one or more segments and a particular segment can only have rows from one table.

The segmented tablespace can be created by using the CREATE TABLESPACE command with SEQSIZE parameter as below.


CREATE TABLESPACE TABSPA1
   IN DBSPAC1
   USING STOGROUP STG1
   PRIQTY 50
   SECQTY 50
   BUFFERPOOL BP02
   ERASE NO
   SEQSIZE 4

The SEQSIZE parameter 4 indicates here that one segment in this tablespace will have 4 pages.

Updated on: 12-Sep-2020

273 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements