All Products
Search
Document Center

AnalyticDB:MSCK REPAIR TABLE

Last Updated:Aug 12, 2025

AnalyticDB for MySQL supports the MSCK REPAIR TABLE statement to sync the partitions of OSS external tables.

Prerequisites

The kernel version of the cluster must be 3.1.8.0 or later.

Note

To view and update the minor version of an AnalyticDB for MySQL cluster, log on to the AnalyticDB for MySQL console and go to the Configuration Information section of the Cluster Information page.

Usage notes

This syntax applies only to partitions of OSS external tables. It does not apply to internal tables of AnalyticDB for MySQL.

Syntax

MSCK REPAIR TABLE table_name [SYNC_DIR 'Location'];

Parameters

Parameter

Description

table_name

The name of the external table.

SYNC_DIR 'Location'

Synchronizes the specified partition. If you do not specify this parameter, the entire table is synchronized. Location specifies the OSS path of the partition.

Examples

  • Sync all partitions of a table.

    MSCK REPAIR TABLE adb_external_db.partition_table_test;
  • Sync a specific partition.

    MSCK REPAIR TABLE adb_external_db.partition_table_test SYNC_DIR 'oss://testBucketName/test_db/partition_table_test/dt=20220619';

References