

# 在 Athena 中使用 Amazon DataZone
<a name="datazone-using"></a>

您可以使用 [Amazon DataZone](https://aws.amazon.com/datazone) 跨组织边界大规模共享、搜索和发现数据。DataZone 简化了您在 Athena、AWS Glue 和 AWS Lake Formation 等 AWS 分析服务中的体验。例如，如果您在不同的数据来源中有 PB 级数据，则可使用 Amazon DataZone 根据人员、数据和工具分组构建业务用例。有关更多信息，请参阅 [What is Amazon DataZone？](https://docs.aws.amazon.com/datazone/latest/userguide/what-is-datazone.html)。

在 Athena 中，您可以使用查询编辑器来访问和查询 DataZone 环境。DataZone 环境指定了 DataZone 项目和域的组合。从 Athena 控制台使用 DataZone 环境时，您将代入 DataZone 环境的 IAM 角色，并且只能看到属于该环境的数据库和表。权限由您在 DataZone 中指定的角色决定。

在 Athena 中，您可以使用查询编辑器页面上的 **DataZone 环境**选择器来选择 DataZone 环境。

**在 Athena 中打开 DataZone 环境**

1. 从 [https://console.aws.amazon.com/athena/](https://console.aws.amazon.com/athena/home) 打开 Athena 控制台。

1. 在 Athena 控制台右上角的**工作组**旁边，选择 **DataZone 环境**。
**注意**  
只有 DataZone 中有一个或多个可用域时，才会出现 **DataZone 环境**选项。  
![\[选择 DataZone 环境。\]](http://docs.aws.amazon.com/zh_cn/athena/latest/ug/images/datazone-using-1.png)

1. 使用 **DataZone 环境**选择器选择一个 DataZone 环境。  
![\[选择一个 DataZone 环境\]](http://docs.aws.amazon.com/zh_cn/athena/latest/ug/images/datazone-using-2.png)

1. 在**切换到 DataZone 环境**对话框中，确认该环境是您想要的环境，然后选择**切换到 DataZone 环境**。  
![\[确认对 DataZone 环境所作的更改。\]](http://docs.aws.amazon.com/zh_cn/athena/latest/ug/images/datazone-using-3.png)

有关开始使用 DataZone 和 Athena 的更多信息，请参阅《Amazon DataZone User Guide》**中的 [Getting started](https://docs.aws.amazon.com/datazone/latest/userguide/getting-started.html) 教程。