

# Deleting metadata tables
<a name="metadata-tables-delete-table"></a>

If you want to delete the metadata tables that you created for an Amazon S3 general purpose bucket, you can delete the metadata tables from your Amazon managed table bucket. 

**Important**  
Deleting a table is permanent and can't be undone. Before deleting a table, make sure that you have backed up any important data.
Before you delete a metadata table, we recommend that you first delete the associated metadata table configuration on your general purpose bucket. For more information, see [Deleting metadata table configurations](metadata-tables-delete-configuration.md).

To delete your Amazon managed table bucket, see [Deleting table buckets](https://docs.amazonaws.cn/AmazonS3/latest/userguide/s3-tables-buckets-delete.html) and [https://docs.amazonaws.cn/AmazonS3/latest/API/API_s3TableBuckets_DeleteTableBucket.html](https://docs.amazonaws.cn/AmazonS3/latest/API/API_s3TableBuckets_DeleteTableBucket.html) in the *Amazon S3 API Reference*. Before you delete your Amazon managed table bucket, we recommend that you first delete all metadata table configurations that are associated with this bucket. You must also first delete all metadata tables in the bucket. 

You can delete a metadata table by using the Amazon Command Line Interface (Amazon CLI), the Amazon SDKs, or the Amazon S3 REST API.

## Delete a metadata table
<a name="delete-metadata-table-procedure"></a>

### Using the Amazon CLI
<a name="delete-metadata-table-cli"></a>

To run the following commands, you must have the Amazon CLI installed and configured. If you don’t have the Amazon CLI installed, see [Install or update to the latest version of the Amazon CLI](https://docs.amazonaws.cn//cli/latest/userguide/getting-started-install.html) in the *Amazon Command Line Interface User Guide*.

Alternatively, you can run Amazon CLI commands from the console by using Amazon CloudShell. Amazon CloudShell is a browser-based, pre-authenticated shell that you can launch directly from the Amazon Web Services Management Console. For more information, see [What is CloudShell?](https://docs.amazonaws.cn//cloudshell/latest/userguide/welcome.html) and [Getting started with Amazon CloudShell](https://docs.amazonaws.cn//cloudshell/latest/userguide/getting-started.html) in the *Amazon CloudShell User Guide*.

**To delete a metadata table configuration by using the Amazon CLI**

To use the following example commands, replace the `user input placeholders` with your own information. 

1. Use the following command to delete the metadata table from your Amazon managed table bucket:

   ```
   aws s3tables delete-table \
   --table-bucket-arn arn:aws-cn:s3tables:us-east-2:111122223333:bucket/aws-s3 \
   --namespace b_general-purpose-bucket-name \
   --name journal \
   --region us-east-2
   ```

1. To verify that the table was deleted, use the following command:

   ```
   aws s3tables get-table \
   --table-bucket-arn arn:aws-cn:s3tables:us-east-2:111122223333:bucket/aws-s3 \
   --namespace b_general-purpose-bucket-name \
   --name journal \
   --region us-east-2
   ```

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

You can send REST requests to delete a metadata table configuration. For more information, see [https://docs.amazonaws.cn/AmazonS3/latest/API/API_s3TableBuckets_DeleteTable.html](https://docs.amazonaws.cn/AmazonS3/latest/API/API_s3TableBuckets_DeleteTable.html) in the *Amazon S3 API Reference*.

### Using the Amazon SDKs
<a name="delete-metadata-table-sdk"></a>

You can use the Amazon SDKs to delete a metadata table configuration in Amazon S3. For information, see the [list of supported SDKs](https://docs.amazonaws.cn/AmazonS3/latest/API/API_s3TableBuckets_DeleteTable.html#API_s3TableBuckets_DeleteTable_SeeAlso) in the *Amazon S3 API Reference*.