Start of change

DB2 table spaces

A DB2® table space is a set of volumes on disks that hold the data sets in which tables are actually stored. Every table is stored in table space.

Start of changeA table space consists of a number of VSAM linear data sets (LDSs). Table spaces are divided into equal-sized units, called pages. Each page is read from disk to the assigned buffer pool, or written from the buffer pool to disc, in a single operation. The page size is controlled by the buffer pool that you assign to the table space (4 KB, 8 KB, 16 KB, or 32 KB in size) for the data. The default page size is 4 KB.End of change

Data in most table spaces can be compressed, which can allow you to store more data on each data page.

You can let DB2 create and manage the table space for you by issuing a CREATE TABLE statement that does not specify an existing table space. DB2 creates a partition-by-growth or range-partitioned universal table space and assigns the table space to the default database and the default storage group. For more information, see Creation of table spaces.

You can also explicitly define table spaces by issuing CREATE TABLESPACE statements. You specify the database that the table space belongs to, and the storage group that it uses. When you create a table space, certain options that you specify control the type of table space that is created. In most cases, it is best to create universal table spaces. Other table space types are deprecated. That is, they are supported in DB2 10, but support might be removed in the future.

For descriptions of the various table space types, see Types of DB2 table spaces.

Some table space types can contain more than one table. However, in the cases of the recommended universal table space types, each table space contains only a single table.

For smaller tables, multiple-table segmented table spaces can sometimes help to reduce the number of data sets that need to be managed for backup and recovery, and the number of data sets that the database system needs to open and close during DB2 operations. Nevertheless, this type is deprecated.

End of change