Rebuilds only tables with fallback protection, including stored procedure tables. Because Table Rebuild deletes all tables selected for rebuild before the start of the rebuild process, this command prevents tables without fallback protection from being deleted.
This command performs most of the work which is done by normal down AMP recovery, making the actual restart to bring a down AMP back on line as fast as possible, while guaranteeing data integrity. The AMP to be rebuilt must be off line and all of the other AMPs in the cluster must be on line.
Syntax
REBUILD AMP nnnn FALLBACK TABLES [, rebuild_amp_spec [,...] ] ;
- rebuild_amp_spec
{ LOG INTO logdbase.logtbl | WITH { DATABASE | TABLE | ROWRANGE } LOCK | [ n TABLES ] IN PARALLEL }
Syntax Elements
- nnnn
- The number of the AMP vproc to be rebuilt.
- FALLBACK TABLES
- Specifies that only tables with fallback protection will be rebuilt. This prevents tables without fallback protection from being deleted. The first step that Table Rebuild usually performs is to delete the contents of the table that Table Rebuild is rebuilding.
- LOG INTO logdbase.logtbl
- Specifies that Table Rebuild is to run in the quiet mode or background mode. All messages will be written to the system console and to a user-defined table. The table is specified by database name and table name. For more information about running Table Rebuild in the background, see REBUILD AMP.
- WITH DATABASE LOCK
- Specifies that a database-level read lock will be placed on the source AMP database data used to rebuild the corrupted table. This is the default lock setting.
- WITH TABLE LOCK
- Specifies that a table-level read lock will be placed on the source AMP table to be used to rebuild the corrupted table.
- WITH ROWRANGE LOCK
- Specifies that a rolling-read lock (selected groups of row-only locks) will be placed on the source AMP table used to rebuild the corrupted table. This lock allows concurrent updates of the tables being used on the source AMP for the rebuild.For a column-partitioned table, a full table lock is used.
- [n TABLES] IN PARALLEL
- Specifies that multiple tables can be rebuilt in parallel. This can make the rebuild operations complete more quickly. From 2 to 255 tables can be rebuilt simultaneously.