Db2 database objects overview

In Db2 for z/OS, you use database objects, such as tables, table spaces, indexes, index spaces, keys, views, and databases to organize and access your data.

The brief descriptions here show how the structures fit into an overall view of Db2. The following figure shows how some Db2 structures contain others. To some extent, the notion of containment provides a hierarchy of structures.

Figure 1. A hierarchy of Db2 structures
Begin figure description. Relationship of database (with table spaces and index spaces) to storage groups. End figure description.

The Db2 structures from the most to the least inclusive are:

Databases
A set of Db2 structures that include a collection of tables, their associated indexes, and the table spaces in which they reside.
Storage groups
A set of volumes on disks that hold the data sets in which tables and indexes are stored.
Table spaces
Start of changeA logical unit of storage in a database. A table space is a page set. The recommended partition-by-growth and partition-by-range table space types always contain data for only a single table. However, the segmented (non-UTS) and simple table space types, which are deprecated, can each contain one or more tables. For more information, see Table space types and characteristics in Db2 for z/OS.
Deprecated function: Start of changeFL 504 Non-UTS table spaces for base tables are deprecated. CREATE TABLESPACE statements that run at application compatibility level V12R1M504 or higher always create a partition-by-growth or partition-by-range table space, and CREATE TABLE statements that specify a non-UTS table space (including existing multi-table segmented table spaces) return an error. However, you can use a lower application compatibility level to create table spaces of the deprecated types if needed, such as for recovery situations. For instructions, see Creating non-UTS table spaces (deprecated).End of change
End of change
Tables
All data in a Db2 database is presented in tables, which are collections of rows all having the same columns. A table that holds persistent user data is a base table. A table that stores data temporarily is a temporary table.
Views
A view is an alternative way of representing data that exists in one or more tables. A view can include all or some of the columns from one or more base tables.
Indexes
Start of changeAn index is an ordered set of pointers to the data in a Db2 table. The index is stored separately from the table. An index is either a simple index or an extended index. An extended index is one of the following objects:
  • An expression-based index
  • A spatial index
  • An XML index
End of change