

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建立 Athena 資料表
<a name="create-manual-table"></a>

AWS 包含您在 AWS CUR 儲存貯體中建立此資料表所需的 SQL。<a name="create-manual-table-steps"></a>

**建立您的 Athena 資料表**

1. 登入 AWS 管理主控台 ，並在 [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/)：// 開啟 Amazon S3 主控台。

1. 從儲存貯體清單中，選擇您選擇接收成本和用量報告的儲存貯體。

1. 導覽路徑 `your-report-prefix-your-report-name-path-to-report`。

   確切路徑取決於您的 AWS CUR 是否設定為覆寫先前的版本。如需詳細資訊，請參閱[成本和用量報告交付時間表](understanding-report-versions.md#access-cur-s3-timeline)。

1. 開啟檔案 `my-report-name-create-table.sql`。

1. 從檔案中複製 SQL，以 `CREATE` 開頭，並以 `LOCATION 's3://your-report-prefix/your-report-name/the-rest-of-the=path'` 結尾。請記下第一行，因為您需要資料庫名稱和資料表來建立 Athena 資料庫。

1. 前往 [https://console.aws.amazon.com/athena/](https://console.aws.amazon.com/athena/home) 開啟 Athena 主控台。

1. 在 **New query 1 (新查詢 1)** 查詢窗格中，貼上以下 SQL。在 *`<database name>.<table name>`* 中，請使用您複製的 SQL 第一行中的資料庫和資料表名稱。

   ```
   CREATE DATABASE <database name>
   ```

1. 選擇 **Run query** (執行查詢)。

1. 在下拉式功能表中，選擇您剛才建立的資料庫。

1. 在 **New query 1 (新查詢 1)** 查詢窗格中，貼上 SQL 檔案中的其餘 SQL。

1. 選擇 **Run query** (執行查詢)。

建立資料表之後，您需要載入您的分割區，然後才能執行查詢。如需詳細資訊，請參閱[上傳您的報告分割區](upload-report-partitions.md)。