Usage Notes - Advanced SQL Engine - Teradata Database

Database Utilities

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-06-15
dita:mapPath
boh1556732696163.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1102
lifecycle
previous
Product Category
Teradata Vantage™
  • Regardless of whether the AMP to be rebuilt is offline or online during Table Rebuild, all other AMPs in the same cluster must be online. AMPs in other clusters may be offline.
  • Tables that use sparse maps (or contiguous maps that include only a subset of all AMPs in the system) are not necessarily distributed to all AMPs of the system. If a table specified for rebuilding does not exist on an AMP specified in the REBUILD command, Table Rebuild issues the following message:
    Unable to rebuild table tablename due to table not in rebuilt AMP
    For more information on contiguous and sparse maps, see Teradata Vantage™ - Database Design, B035-1094.
  • Teradata Database can isolate some file system errors to a specific data or index subtable, or to a contiguous range of rows ("region") in a data or index subtable. In these cases, Teradata Database marks only the affected subtable or region down. This improves system performance and availability by allowing transactions that do not require access to the down subtable or rows to proceed, without causing a database crash that would require a system restart.

    The normal rebuild process removes down-region information from the table header.

Running Table Rebuild in the Background

When you specify the LOG INTO logdbase.logtbl option, Table Rebuild runs as a background task. You can run multiple Table Rebuild operations both in the background and foreground (interactive mode) at the same time. Completion messages for background rebuilds are sent to the system console and to the user-defined table specified in the LOG INTO option.

The table specified in the LOG INTO option must have been created previously as follows:

CREATE SET TABLE logDB.LogTbl, FALLBACK
  ( MsgDate CHAR(8),     /* format:  'yy/mm/dd' */ 
    MsgTime CHAR(8),     /* format:  'hh:mm:ss' */ 
    MsgAMP  CHAR(6),     /* format:  'nnnn' */ 
    MsgCode CHAR(1),     /* see below */
    MsgText VARCHAR(600) CHARACTER SET UNICODE) /* message text */ 
  PRIMARY INDEX (MsgDate, MsgTime);
Column Contents
MsgDate and MsgTime The system date and time when the message was generated. Together these columns comprise a non-unique primary index for the log table.
MsgAMP The four-digit vproc number of the rebuilding AMP.
MsgCode A single character code indicating the type of rebuild message. See below.
MsgText The text of the rebuild message.

MsgCode is one of the following values:

Value Meaning
‘ ’ A normal message
‘D’ Rebuilding database message
‘E’ Error message
‘J’ Rebuilding table message for a journal
‘N’ Rebuilding table message for a no-fallback table
‘R’ Rebuilding table message for tables used by recovery
‘S’ Start/Restart rebuild operation
The table-level messages do not include the database names. The reports should include all the ‘D’ class messages and be ordered by date and time for proper identification.