- 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 AMPFor more information on contiguous and sparse maps, see Database Design.
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);
|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:
|‘ ’||A normal message|
|‘D’||Rebuilding database 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|