

# 删除元数据表
<a name="metadata-tables-delete-table"></a>

如果想要删除为 Amazon S3 通用存储桶创建的元数据表，则可以从 AWS 托管式表存储桶中删除这些元数据表。

**重要**  
删除表是永久性的，无法撤消。在删除表之前，请确保您已备份所有重要数据。
在删除元数据表之前，建议您先删除通用存储桶中的关联元数据表配置。有关更多信息，请参阅 [删除元数据表配置](metadata-tables-delete-configuration.md)。

要删除 AWS 托管式表存储桶，请参阅[删除表存储桶](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-delete.html)和《Amazon S3 API Reference》**中的 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3TableBuckets_DeleteTableBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3TableBuckets_DeleteTableBucket.html)。在删除 AWS 托管式表存储桶之前，建议先删除与该存储桶关联的所有元数据表配置。还必须先删除存储桶中的所有元数据表。

可以使用 AWS Command Line Interface（AWS CLI）、AWS SDK 或 Amazon S3 REST API 删除元数据表。

## 删除元数据表
<a name="delete-metadata-table-procedure"></a>

### 使用 AWS CLI
<a name="delete-metadata-table-cli"></a>

要运行以下命令，您必须安装并配置 AWS CLI。如果未安装 AWS CLI，请参阅《AWS Command Line Interface 用户指南》**中的[安装或更新最新版本的 AWS CLI](https://docs.aws.amazon.com//cli/latest/userguide/getting-started-install.html)。

或者，可以从控制台中使用 AWS CloudShell 运行 AWS CLI 命令。AWS CloudShell 是一个基于浏览器、预先经过身份验证的 Shell，您可以直接从 AWS 管理控制台中启动它。有关更多信息，请参阅《AWS CloudShell 用户指南》**中的 [What is CloudShell?](https://docs.aws.amazon.com//cloudshell/latest/userguide/welcome.html) 和 [Getting started with AWS CloudShell](https://docs.aws.amazon.com//cloudshell/latest/userguide/getting-started.html)。

**使用 AWS CLI 删除元数据表配置**

要使用以下示例命令，请将 `{{user input placeholders}}` 替换为您自己的信息。

1. 使用以下命令从 AWS 托管式表存储桶中删除元数据表：

   ```
   aws s3tables delete-table \
   --table-bucket-arn arn:aws:s3tables:{{us-east-2}}:{{111122223333}}:bucket/aws-s3 \
   --namespace b_{{general-purpose-bucket-name}} \
   --name {{journal}} \
   --region {{us-east-2}}
   ```

1. 要验证表是否已删除，请使用以下命令：

   ```
   aws s3tables get-table \
   --table-bucket-arn arn:aws:s3tables:{{us-east-2}}:{{111122223333}}:bucket/aws-s3 \
   --namespace b_{{general-purpose-bucket-name}} \
   --name {{journal}} \
   --region {{us-east-2}}
   ```

### 使用 REST API
<a name="delete-metadata-table-rest-api"></a>

可以发送 REST 请求来删除元数据表配置。有关更多信息，请参阅《Amazon S3 API 参考》**中的 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3TableBuckets_DeleteTable.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3TableBuckets_DeleteTable.html)。

### 使用 AWS SDK
<a name="delete-metadata-table-sdk"></a>

可以使用 AWS SDK 在 Amazon S3 中删除元数据表配置。有关信息，请参阅《Amazon S3 API Reference》**中的 [list of supported SDKs](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3TableBuckets_DeleteTable.html#API_s3TableBuckets_DeleteTable_SeeAlso)。