Understanding Tablespace definition information (TDI) reference

To automate a redirected restore operation, Backup Object Manager requires information about the table spaces and the table space containers that are used in the original database.

Th following information is used to create the table space containers of the target database, and is required for each table space:
  • The ID and name of the table space.
  • The type of the table space. For example, whether the table space is system (SMS) or database managed (DMS).
  1. The page size in bytes.
  2. The extent size in pages.
  3. The number of pages used. This number can help the administrator when resizing containers. Backup Object Manager also calculates the numbers of total pages and of usable pages from the data that is stored for each table space container.
  4. Information about the table space containers that are used for the table space.
The following information must be available for each table space container:
  • The ID of the table space container.
  • The name of the table space container. For example, whether the directory contains an SMS container or the file contains a DMS container.
  • The type of the table space container. For example, whether a database managed container is stored in a file or on a raw device.
  • For DMS table spaces, the total number of pages that are stored in the container.

The TDI and the DB2® backup images are stored together on the IBM Storage Protect™ server. They are associated by using the combination of the instance name of the database, the database alias, the database node number, and the timestamp of the backup. The name of the TDI is constructed in this format: DB2 instance-<DB2 alias>-DB2 node numbertimestamp.tdi. The tablespace definition information (TDI) can be retrieved from IBM Storage Protect separately with the Backup Object Manager command 'r_tdi' and can be stored as an ASCII file in a specified file system. The availability of TDI in the file system is a prerequisite for the Backup Object Manager redirected restore in batch mode.

These changes can be done to the TDI file to prepare for a batch-mode that is redirected restore:
  • Add or remove of table space containers from dedicated table spaces
  • Modify names (locations) of table space containers
  • Modify the size of a DMS table space container, whereby the sum of container sizes must have at least the number of pages that are used plus ((number of containers + 1) * extent), where extent is the extent size in pages.
  • Add an automatic storage path, if at least one automatic storage path is already present
  • Change the location of an existing automatic storage path
  • Remove one or more existing automatic storage paths, whereby in any case at least one automatic storage path must exist
tablespace 
The following is a sample TDI file:
;    IBM Storage Protect for Enterprise Resource Planning
;                    Data Protection for SAP(R) for DB2
;                - Tablespace Definition Information (TDI) -
;
; The following TDI sections can be modified manually:
;  - Automatic_Storage_Path
;  - Container
;
; An automatic storage path section consists of the following format:
;
;  Automatic_Storage_Path = path#1
;  ...
;  Automatic_Storage_Path = path#n
;
; It is possible to add or remove an automatic storage path entry. For already existing
; automatic storage path entries the assigned path can be updated.
;
; A tablespace section consists of the following format:
;
;  [Tablespace ID "tbsp. name" type page size extent size in pages
;                                                     used pages yes|no]
;  Container[ID 1] = definition ;
   . . .
;  Container[ID n] = definition
;
; where the definition of a container statement is characterized by its tablespace:
; - SMS tablespace: "path"
; - DMS tablespace: file | "path/container name" | size in pages
;
; If the tablespace containers are modified manually (add or remove container,
; adjust container path or size) at least the following conditions have to be
; guaranteed for ensuring the TDI integrity:
; 1) Any new container specified requires empty brackets '[]'. The ID is calculated
;    internally.
;
; 2) Each tablespace block has to have at least one container specification
;
; 3) The sum of container sizes of a DMS tablespace has to have at least the number
;    of used pages plus ((number of containers + 1) * extent).
;
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; ! DO NOT EDIT ANYTHING ELSE EXCEPT THE SECTIONS !
; !      - Automatic_Storage_Path (if present)    !
; !      - Container                              !
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[TDI]
Version = 1.1
Generator = Data Protection for SAP(R) 6400

[Backup]
Alias = T01
Instance = db2t01
Node = 0
Timestamp = 20081130094352
Database_Path = /db2/T01/sapdata1/db2t01/NODE0000/SQL00001/
Automatic_Storage_Path = /db2/T01/sapdata1
Automatic_Storage_Path = /db2/T01/sapdata2

[Tablespace 0 "SYSCATSPACE" dms 16384 4 9264 yes]
Container[0] = file | "/db2/T01/sapdata1/db2t01/NODE0000/T01/T0000000/C0000000.CAT" | 8192
Container[1] = file | "/db2/T01/sapdata2/db2t01/NODE0000/T01/T0000000/C0000001.CAT" | 8192

[Tablespace 1 "TEMPSPACE1" sms 16384 32 1 no]
Container[0] = "/db2/T01/saptemp1"

[Tablespace 10 "T01#USER1D" dms 16384 2 540 no]
Container[0] = file | "/db2/T01/sapdata1/NODE0000/T01#USER1D.container000" | 448
Container[1] = file | "/db2/T01/sapdata2/NODE0000/T01#USER1D.container001" | 448

[Tablespace 11 "T01#USER1I" dms 16384 2 540 no]
Container[0] = file | "/db2/T01/sapdata1/NODE0000/T01#USER1I.container000" | 448
Container[1] = file | "/db2/T01/sapdata2/NODE0000/T01#USER1I.container001" | 448
The following details are related to the TDI file:
  • The [TDI] header block is used to identify the data as TDI and holds some meta-information about it. The Version key holds the version of the TDI syntax. The Generator key denotes some product information.
  • The [Backup] block holds various kinds of information about the database backup the TDI is associated with. This information must be kept within the TDI file so that it is available even when the file is renamed.

    [Backup] additionally includes the database path where database metadata is stored, and all automatic storage paths the database provides for table spaces supporting automatic storage. It is possible to add or remove an automatic storage path entry in that section. Optionally, for automatic storage path entries that already exist, the assigned path can be updated.

  • The [Tablespace] block marks the start of the container definitions of a specific table space.
  • The block header contains the following items in exactly this order: the ID of the table space, its name, its type, the page size in bytes, the extent size in pages and the number of used pages in the table space. Do not change any data within the table space block header.
  • Each container statement defines one container of a table space according to the following rules:
    • The ID is denoted in square brackets if the line was written by the system. If a new container is to be added to a table space, the ID is not yet known. Therefore, the administrator specifies a new container without an ID, just entering consecutive brackets.
    • For an SMS table space, only the fully qualified path is specified.
    • For a DMS table space, the type, location, and size of the container are specified, in this order, and separated by a vertical bar (|). The type is given by one of the strings file or device. The size is interpreted as a number of pages unless a unit is specified. In this case, the unit is used.
    • Names of table spaces and paths must be quoted strings.