All Products
Search
Document Center

AnalyticDB:MSCK REPAIR TABLE

Last Updated:Mar 28, 2026

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

Prerequisites

Before you begin, ensure that:

  • The cluster's kernel version is 3.1.8.0 or later.

To view or update the minor version, go to the AnalyticDB for MySQL console, open the Cluster Information page, and check the Configuration Information section. For instructions, see Update the minor version of a cluster.

Usage notes

MSCK REPAIR TABLE 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

ParameterDescription
table_nameThe name of the external table.
SYNC_DIR 'Location'Syncs a single partition. Location is the OSS path of the partition directory. If omitted, all partitions in the table are synced.

Examples

Sync all partitions

Run this statement to sync all partitions of a table:

MSCK REPAIR TABLE adb_external_db.partition_table_test;

Sync a specific partition

To sync a single partition, provide its OSS path with SYNC_DIR:

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

What's next