Home | Previous Page | Next Page   Database Reference > Disk Structures and Storage > Dbspace Structure and Storage >

Structure of the Tblspace Tblspace

In the initial chunk of every dbspace, the page that follows the chunk free-list page is the first page of the tblspace tblspace. The tblspace tblspace is a collection of pages that describe the location and structure of all tblspaces in this dbspace.

Tblspace Tblspace Entries

Each page in the tblspace tblspace describes one tblspace in the dbspace and is considered one entry. Entries in the tblspace tblspace are added when a new table is created or when a fragment is added to a fragmented table.

The first page in every tblspace tblspace is a bit map of the pages in the tblspace tblspace. The second page is the first tblspace entry, and it describes the tblspace tblspace itself. The third page describes the first user-created table in this dbspace. Each tblspace tblspace entry (page) includes the following components.

To display information on a tblspace, use the onutil CHECK INFO IN TABLESPACE partnum DISPLAY command. For more information, see CHECK INFO.

Component
Description
Page header
56 bytes, standard page-header information
Page-ending time stamp
4 bytes
Tblspace header
68 bytes, general tblspace information.
Column information
Each special column in the table is tracked with an 12-byte entry. (A special column is defined as a VARCHAR, BYTE, or TEXT data type.)
Tblspace name
variable length, database.owner.tablename
Index information
Each index on the table contains a 20-byte header that contains general information about the index, followed by a 4-byte entry for each column component of the index.
Extent information
Each extent allocated to this tblspace is tracked with a 12-byte entry.

Tblspace Numbers

Each tblspace that is described in the tblspace tblspace receives a tblspace number. This tblspace number is the same value that is stored as the partnum field in the systables system catalog table and as the partn field in the sysfragments system catalog table.

The following SQL query retrieves the partnum for every table in the database (these can be located in several different dbspaces) and displays it with the table name and the hexadecimal representation of partnum:

SELECT tabname, tabid, partnum, HEX(partnum) hex_tblspace_name 
FROM systables

If the output includes a row with a table name but a partnum of 0, this table consists of two or more table fragments, each located in its own tblspace. For example, Figure 6 shows a table called account that has partnum 0.

Figure 6. Output from systables Query with partnum Values
tabname        tabid   partnum          hex_tblspace_name

sysfragments    25     1048611          0x00100023
branch         100     1048612          0x00100024
teller         101     1048613          0x00100025
account        102           0          0x00000000
history        103     1048615          0x00100027
results        104     1048616          0x00100028

To obtain the actual tblspace numbers for the fragments that make up the table, you must query the sysfragments table for the same database. Figure 7 shows that the account table from Figure 6 has three table fragments and three index fragments.

Figure 7. Output from sysfragments Table with partn Values
tabid fragtype           partn     hex_tblspace_name

  102 T                  1048614   0x00100026
  102 T                  2097154   0x00200002
  102 T                  3145730   0x00300002
  102 I                  1048617   0x00100029
  102 I                  2097155   0x00200003
  102 I                  3145731   0x00300003

Tblspace Number Elements

The first page in a tblspace is logical page 0. (Physical page numbers refer to the address of the page in the chunk.) The root space tblspace tblspace is always contained in the first dbspace and is described by logical page 1 within the tblspace tblspace. (The bit-map page is page 0.)

Tblspace Tblspace Size

The initial size of the tblspace tblspace is configurable with the FRAGS_PER_DBS parameter, and is 50 pages by default. These tblspace tblspace pages are allocated as an extent when the dbspace is initialized. If the database server attempts to create a table, but the tblspace tblspace is full, the database server allocates a next extent to the tblspace.

When a table is removed from the dbspace, its corresponding entry in the tblspace tblspace is deleted.

Tblspace Tblspace Bit-Map Page

The first page of the tblspace tblspace, like the first page of any tblspace, is a bit map that describes the page fullness of the following pages. Each page that follows has an entry on the bit-map page. If needed, additional bit-map pages are located throughout the contiguous space allocated for the tblspace, arranged so that each bit map describes only the pages that follow it, until the next bit map or the end of the tblspace. Bit-map pages fall at distinct intervals within tblspaces pages. Each bit-map page describes a fixed number of pages that follow it.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]