管理数据源 - OracleManage your data source - Oracle

安装本地数据网关之后,需要添加可与该网关结合使用的数据源。Once you have installed the on-premises data gateway, you will need to add data sources that can be used with the gateway. 本文将探讨如何使用网关和数据源。This article will look at how to work with gateways and data sources. 你可以使用 Oracle 数据源进行计划刷新或 DirectQuery。You can use the Oracle data source either for scheduled refresh or for DirectQuery.

下载和安装网关Download and install the gateway

你可以从 Power BI 服务中下载网关。You can download the gateway from the Power BI service. 选择“下载” > “数据网关”,或转到网关下载页Select Downloads > Data Gateway, or by going to the gateway download page.

警告

为了使网关能够连接到你的 Oracle 服务器,需要安装和配置 .NET 的 Oracle 数据提供程序 (ODP.NET)。In order for the gateway to be able to connect to your Oracle server, the Oracle Data Provider for .NET (ODP.NET) needs to be installed and configured. 这是 Oracle 数据访问组件 (ODAC) 的一部分。This is part of the Oracle Data Access Components (ODAC). 有关如何下载 Oracle 提供程序的详细信息,请参阅 安装 Oracle 客户端For more information on how to download the Oracle provider, see Installing the Oracle Client below.

安装 Oracle 客户端Installing the Oracle client

对于 32 位版本的 Power BI Desktop,请使用以下链接来下载并安装 32 位 Oracle 客户端:For 32-bit versions of Power BI Desktop, use the following link to download and install the 32-bit Oracle client:

有关 64 位版本的 Power BI Desktop 或本地数据网关,请使用以下链接下载并安装 64 位 Oracle 客户端:For 64-bit versions of Power BI Desktop, or for the on-premises data gateway, use the following link to download and install the 64-bit Oracle client:

安装后,将需要使用正确的信息对你的数据库配置 tnsnames.ora 文件。Once that is installed, you will need to configure your tnsnames.ora file with the proper information for your database. Power BI Desktop 和网关会从 tnsnames.ora 文件中定义的 net_service_name 脱离。Power BI Desktop and the gateway will go off of the net_service_name defined in the tnsnames.ora file. 如果未对其配置,则不能进行连接。If it isn't configured, you will not be able to connect. tnsnames.ora 的默认路径如下:[Oracle Home Directory]\Network\Admin\tnsnames.oraThe default path for tnsnames.ora is the following: [Oracle Home Directory]\Network\Admin\tnsnames.ora. 有关如何配置 tnsnames.ora 文件的详细信息,请参阅 Oracle:本地命名参数 (tnsnames.ora)For more information about how to configure tnsnames.ora files, see Oracle: Local Naming Parameters (tnsnames.ora).

示例 tnsnames.ora 文件条目Example tnsnames.ora file entry

tnsname.ora 中条目的基本格式如下。The basic format of an entry in tnsname.ora is the following.

net_service_name=
 (DESCRIPTION=
   (ADDRESS=(protocol_address_information))
   (CONNECT_DATA=
     (SERVICE_NAME=service_name)))

此处是服务器和端口信息填充的一个示例。Here is an example of the server and port information filled in.

CONTOSO =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracleserver.contoso.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = CONTOSO)
    )
  )

添加网关Add a gateway

若要添加网关,只需下载并在你的环境中的服务器上安装该网关即可。To add a gateway, simply download and install the gateway on a server in your environment. 安装网关后,该网关将显示在管理网关下的网关列表中。After you have installed the gateway, it will show in the lists of gateways under Manage gateways.

备注

除非你至少是一个网关的管理员,否则“管理网关”将不会显示。Manage gateways will not show up until you are the admin of at least one gateway. 作为管理员添加网关或安装和配置网关时就会出现这种情况。This can happen either by being added as an admin or you installing and configuring a gateway.

删除网关Remove a gateway

删除网关也将删除该网关下的所有数据源。Removing a gateway will also delete any data sources under that gateway. 此外,还会中断任何仪表板和依赖于这些数据源的报表。This will also break any dashboards and reports that rely on those data sources.

  1. 选择右上角的齿轮图标 > 管理网关Select the gear icon in the upper-right corner > Manage gateways.
  2. “网关”> 删除Gateway > Remove

添加数据源Add a data source

可以通过选择某个网关,然后单击添加数据源,或者转到“网关”> 添加数据源来添加数据源。You can add a data source by either selecting a gateway and click Add data source, or go to Gateway > Add data source.

然后,你可以从列表中选择数据源类型You can then select the Data Source Type from the list.

然后需要填写数据源(包括服务器数据库)的信息。You will then want to fill in the information for the data source which includes the Server and the Database.

你还需要选择身份验证方法You will also need to choose an Authentication Method. 可能是 Windows基本This can either be Windows or Basic. 如果你打算使用在 Oracle 内创建的帐户而非 Windows 身份验证,则会想要选择“基本”。You would want to choose Basic if you are going to use an account that is created within Oracle instead of Windows Authentication. 然后输入将用于此数据源的凭据。Then enter the credentials that will be used for this data source.

备注

将使用这些凭据运行对数据源的所有查询。All queries to the data source will run using these credentials. 有关详细信息,请参阅主要本地数据网关文章以了解更多有关如何存储凭据的信息。For more information, see the main on-premises data gateway article to learn more about how credentials are stored.

所有内容填写完毕之后,可以单击添加You can click Add after you have everything filled in. 现在可以使用此数据源对本地 Oracle 服务器进行计划刷新或 DirectQuery。You can now use this data source for scheduled refresh, or DirectQuery, against an Oracle server that is on-premises. 如果成功,则会看到连接成功You will see Connection Successful if it succeeded.

高级设置Advanced settings

可以为你的数据源配置隐私级别。You can configure the privacy level for your data source. 以便控制数据的混搭方式。This controls how data can be mashed up. 这仅适用于计划刷新。This is only used for scheduled refresh. 它不适用于 DirectQuery。It does not apply to DirectQuery. 了解详细信息Learn more

删除数据源Remove a data source

删除数据源将中断依赖于给定的数据源的所有仪表板或报表。Removing a data source will break any dashboards or reports that rely on the given data source.

若要删除数据源,请转到“数据源”> 删除To remove a Data Source, go to the Data Source > Remove.

管理管理员Manage administrators

在网关的“管理员”选项卡上,可以添加和删除能够管理网关的用户(或安全组)。On the Administrators tab for the gateway, you can add and remove users (or security groups) that can administer the gateway.

管理用户Manage users

在数据源的“用户”选项卡上,可以添加和删除可使用此数据源的用户或安全组。On the Users tab, for the data source, you can add, and remove, users, or security groups, that can use this data source.

备注

用户列表仅控制允许发布报表的人员。The users list only controls who are allowed to publish reports. 报表所有者可以创建仪表板(或内容包),并与其他用户共享它们。The report owners can create dashboards, or content packs, and share those with other users. 使用报表或仪表板的用户无需位于用户列表中。Users that are consuming the report or dashboard do not need to be in the users list.

使用数据源Using the data source

创建数据源后,可通过 DirectQuery 连接或通过计划刷新使用该数据源。After you have created the data source, it will be available to use with either DirectQuery connections, or through scheduled refresh.

警告

Power BI Desktop 和本地数据网关内的数据源之间的服务器名称和数据库名称必须匹配!Server and database name have to match between Power BI Desktop and the data source within the on-premises data gateway!

数据集和网关内的数据源之间的链接取决于服务器名称和数据库名称。The link between your dataset and the data source within the gateway is based on your server name and database name. 这些名称必须匹配!These have to match! 例如,如果提供了一个服务器名称的 IP 地址,则在 Power BI Desktop 中,你将需要使用网关配置中的数据源 IP 地址。For example, if you supply an IP Address for the server name, within Power BI Desktop, you will need to use the IP Address for the data source within the gateway configuration. 此名称也必须与 tnsnames.ora 文件内定义的别名匹配。This name also has to match an alias defined within the tnsnames.ora file. 有关 tnsnames.ora 文件的详细信息,请参阅 安装 Oracle 客户端For more information about the tnsnames.ora file, see Installing the Oracle Client.

此示例适用于 DirectQuery 和计划刷新这两种情况。This is the case for both DirectQuery and scheduled refresh.

通过 DirectQuery 连接使用数据源Using the data source with DirectQuery connections

你需要确保 Power BI Desktop 和为网关配置的数据源之间的服务器名称和数据库名称相互匹配。You will need to make sure the server and database name matches between Power BI Desktop and the configured data source for the gateway. 还需要确保你的用户列在数据源的用户选项卡中,以便发布 DirectQuery 数据集。You will also need to make sure your user is listed in the Users tab of the data source in order to publish DirectQuery datasets. 首次导入数据时,需要在 Power BI Desktop 中选择 DirectQuery。The selection, for DirectQuery, occurs within Power BI Desktop when you first import data. 了解详细信息Learn more

发布之后,应从 Power BI Desktop 或获取数据启动报表。After you publish, either from Power BI Desktop or Get Data, your reports should start working. 在网关中创建数据源之后,可能会花费几分钟时间连接才可用。It may take several minutes, after creating the data source within the gateway, for the connection to be usable.

通过计划刷新使用数据源Using the data source with scheduled refresh

如果你被列于网关内配置的数据源的“用户”选项卡中,并且服务器和数据库名称匹配,则你可将网关视为用于计划刷新的一个选项。If you are listed in the Users tab of the data source configured within the gateway, and the server and database name match, you will see the gateway as an option to use with scheduled refresh.

故障排除Troubleshooting

当命名语法不正确或未正确配置时,可能会遇到来自 Oracle 的多种错误。You may encounter serveral errors from Oracle when the naming syntax is either incorrect or not configured properly.

  • ORA-12154:TNS:无法解析指定的连接标识符ORA-12154: TNS: could not resolve the connect identifier specified
  • ORA-12514:TNS 侦听器目前不知道连接描述符所需的服务ORA-12514: TNS listener does not currently know of service requested in connect descriptor
  • ORA-12541:TNS:无侦听器ORA-12541: TNS: no listener
  • ORA-12170:TNS:发生连接超时ORA-12170: TNS:Connect timeout occurred
  • ORA-12504:TNS 侦听器未给定 SERVICE_NAME in CONNECT_DATAORA-12504: TNS listener was not given the SERVICE_NAME in CONNECT_DATA

如果 Oracle 客户端未安装或未正确配置,则会出现这些错误。These errors could occur if either the Oracle client is not installed, or if it is not configured properly. 如果 Oracle 客户端已安装,你将会想要验证是否已对 tnsnames.ora 文件进行了正确配置并正在使用正确的 net_service_name。If it is installed, you will want to verify the tnsnames.ora file is properly configured and you are using the proper net_service_name. 还需确保使用 Power BI Desktop 的计算机和运行网关的计算机之间的 net_service_name 是相同的。You will also need to make sure that the net_service_name is the same between the machine using Power BI Desktop and the machine that is running the gateway. 有关详细信息,请参阅 安装 Oracle 客户端For more information, see Installing the Oracle Client.

备注

你也可能会遇到 Oracle 服务器版本和 Oracle 客户端版本间的兼容性问题。You may also be hitting an issue due to compatability between the Oracle server version and the Oracle client version. 通常,你希望它们是匹配的。Typically you want these to match.

有关与网关相关的其他疑难解答信息,请参阅 本地数据网关疑难解答For additional troubleshooting information relating to the gateway, see Troubleshooting the on-premises data gateway.

后续步骤Next steps

本地数据网关On-premises data gateway
本地数据网关 - 深入了解On-premises data gateway - in-depth
本地数据网关疑难解答Troubleshooting the on-premises data gateway
Power BI PremiumPower BI Premium

更多问题?More questions? 尝试咨询 Power BI 社区Try asking the Power BI Community