Skip to main content

SET TABLE STATUS

Description​

The SET TABLE STATUS statement is used to manually set the status of an OLAP table. This statement has the following functionalities:

  • It only supports setting the status of OLAP tables.
  • It can modify the table status to a specified target state.
  • It is used to resolve task blocking caused by the table status.

Supported States:

StateDescription
NORMALIndicates that the table is in a normal state.
ROLLUPIndicates that the table is undergoing a ROLLUP operation.
SCHEMA_CHANGEIndicates that the table is undergoing a schema change.
BACKUPIndicates that the table is undergoing a backup operation.
RESTOREIndicates that the table is undergoing a restore operation.
WAITING_STABLEIndicates that the table is waiting for a stable state.

Syntax​

ADMIN SET TABLE <table_name> STATUS PROPERTIES ("<key>" = "<value>" [, ...]);

Where:

<key>
: "state"

<value>
: "NORMAL"
| "ROLLUP"
| "SCHEMA_CHANGE"
| "BACKUP"
| "RESTORE"
| "WAITING_STABLE"

Required Parameters​

1. <table_name>

Specifies the name of the table for which the status needs to be set.

The table name must be unique within its database.

2. PROPERTIES ("state" = "<value>")

Specifies the target status of the table.

The "state" property must be set, and its value must be one of the supported states.

Access Control Requirements​

Users executing this SQL command must have at least the following permissions:

PrivilegeObjectNotes
ADMINSystemThe user must have ADMIN privileges to execute this command.

Usage Notes​

  • This command is intended for emergency fault recovery; please use it with caution.
  • It only supports OLAP tables and does not support other types of tables.
  • If the table is already in the target state, this command will be ignored.
  • Improper state settings may lead to system anomalies; it is recommended to use this command under technical support guidance.
  • After modifying the status, it is advisable to monitor the system's operational status promptly.

Examples​

  • Set the table status to NORMAL:

    ADMIN SET TABLE tbl1 STATUS PROPERTIES("state" = "NORMAL");
  • Set the table status to SCHEMA_CHANGE:

    ADMIN SET TABLE tbl2 STATUS PROPERTIES("state" = "SCHEMA_CHANGE");