16.10 - Table Rebuild Utility Commands - Teradata Database

Teradata Database Utilities

Teradata Database
Release Number
June 2017
English (United States)
Last Update

Table Rebuild presents a command-line environment that allows the entry of the following commands.

Command Description
REBUILD AMP Rebuilds all tables, a selected table, or all tables in a selected database for a specified AMP.
REBUILD AMP FALLBACK TABLES Rebuilds only tables with fallback protection.
RESTART REBUILD Restarts an all-table rebuild operation (REBUILD command with the ALL TABLES options specified).

The commands are discussed in detail in the sections that follow.

Usage Notes

Normally, Table Rebuild is run interactively, as a foreground process started from a Database Window application window. Output from the program is directed to the window. Optionally, Table Rebuild can be run as a background process. Output from the program is logged to a special table, rather than being displayed on screen. All background rebuild operations continue to run to completion, even after Table Rebuild is quit. For more information, see the LOG INTO option described for REBUILD AMP and REBUILD AMP FALLBACK TABLES.

Several rebuild operations, both foreground and background rebuilds, can be run simultaneously. Up to four interactive foreground sessions can utilize the four application windows available in Database Window. Each session must rebuild tables on AMPs in different clusters.

Any number of background process rebuilds can run simultaneously, and can be launched from the same application window. Each rebuild process must rebuild tables on an AMP in different clusters.

Error Handling

Table Rebuild issues messages interactively.

The following message might be returned by Table Rebuild after processing is complete:

Bad table header on AMP ccc-p for table tablename

This message can be caused by one of the following conditions:

  • The table header does not exist. This might be because the table was dropped after Table Rebuild was started.
  • A header was found, but the table was rebuilt unsuccessfully on the identified AMP.

To recover the table, restore it from the latest archive. If restoring from an archive is not an option, contact the Teradata Support Center.

When a table is marked by the Reconfig utility as being in an invalid state and not redistributable, there is no guarantee that the rows in the table are where they should be. Table Rebuild cannot rebuild the table, and displays “Unable to rebuild due to pending Reconfig Abort of table tablename.” In these cases, before rebuilding the table you should first recover these tables by restoring them from the latest archive, or drop these tables.

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 Database Design.

For more information on error messages involving AMP operations, see Messages.

Getting Help

To get help information about the Table Rebuild utility, press the F7 key while in the Database Window application window. A set of second-level function keys will display as shown below:

The Table Rebuild utility allows you to recover the data tables on a
specified AMP’s disk(s) by copying the fallback copy maintained by the
other AMPs in the cluster.  You may rebuild all or part of the tables on
an AMP via the options listed below.>

<F2> - Rebuild all tables on an AMP
<F3> - Rebuild all data tables in a database
<F4> - Rebuild a single table
<F5> - Rebuild fallback protected tables only
<F6> - Rebuild a previous rebuild after a system restart
<F7> - General syntax

For information on the subjects listed on the screen, press the corresponding function key. To return to the next-higher menu level, press the F8 key. To exit the help system and return to the Table Rebuild command prompt, press F8 from the top-level menu.