azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Oracle 数据库连接器入门Get started with the Oracle Database connector

05/20/2020

本文内容

使用 Oracle 数据库连接器,可以创建使用现有数据库中数据的组织工作流。Using the Oracle Database connector, you create organizational workflows that use data in your existing database. 此连接器可以连接到本地 Oracle 数据库,或者连接到安装了 Oracle 数据库的 Azure 虚拟机。This connector can connect to an on-premises Oracle Database, or an Azure virtual machine with Oracle Database installed. 借助此连接器,可以:With this connector, you can:

通过向客户数据库添加新客户或在订单数据库中更新订单生成工作流。Build your workflow by adding a new customer to a customers database, or updating an order in an orders database.

使用操作获取数据行、插入新行,甚至删除。Use actions to get a row of data, insert a new row, and even delete. 例如,在 Dynamics CRM Online 中创建记录时(触发器),则在 Oracle 数据库中插入行(操作)。For example, when a record is created in Dynamics CRM Online (a trigger), then insert a row in an Oracle Database (an action).

该连接器不支持以下项:This connector doesn't support the following items:

视图Views

包含复合键的任意表Any table with composite keys

表中的嵌套对象类型Nested object types in tables

具有非标量值的数据库函数Database functions with non-scalar values

本文介绍如何在逻辑应用中使用 Oracle 数据库连接器。This article shows you how to use the Oracle Database connector in a logic app.

先决条件Prerequisites

支持的 Oracle 版本:Supported Oracle versions:

Oracle 9 及更高版本Oracle 9 and later

Oracle 客户端软件 8.1.7 及更高版本Oracle client software 8.1.7 and later

安装本地数据网关。Install the on-premises data gateway. 若要连接到 Oracle 数据库,或者连接到安装了 Oracle DB 的 Azure VM,网关是必需的。The gateway is required to connect to an on-premises Oracle Database, or an Azure VM with Oracle DB installed.

备注

本地数据网关的作用好似一架桥,提供本地数据(不在云中的数据)与逻辑应用之间的安全数据传输。The on-premises data gateway acts as a bridge, and provides a secure data transfer between on-premises data (data that is not in the cloud) and your logic apps. 可以将同一网关用于多个服务和多个数据源。The same gateway can be used with multiple services, and multiple data sources. 因此,可能只需安装网关一次。So, you may only need to install the gateway once.

将 Oracle 客户端与本地数据网关安装在同一计算机上。Install the Oracle Client on the machine where you installed the on-premises data gateway. 请务必安装 Oracle 提供的 64 位用于 .Net 的 Oracle 数据提供程序:Be sure to install the 64-bit Oracle Data Provider for .NET from Oracle:

提示

如果未安装 Oracle 客户端,则在尝试创建或使用连接时,会发生错误。If the Oracle client is not installed, an error occurs when you try to create or use the connection. 请参阅本文中的常见错误。See the common errors in this article.

添加连接器Add the connector

重要

此连接器没有任何触发器。This connector does not have any triggers. 它只有操作。It has only actions. 因此,请在创建逻辑应用时,添加另一个用于启动逻辑应用的触发器,例如“计划 - 重复周期”或“请求/响应 - 响应”。So when you create your logic app, add another trigger to start your logic app, such as Schedule - Recurrence, or Request / Response - Response.

在 Azure 门户中,创建一个空白逻辑应用。In the Azure portal, create a blank logic app.

在启动逻辑应用时,请选择“请求/响应 - 请求”触发器:At the start of your logic app, select the Request / Response - Request trigger:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第1张图片

选择“保存”。Select Save. 保存时,会自动生成请求 URL。When you save, a request URL is automatically generated.

选择“新步骤”,并选择“添加操作”。Select New step, and select Add an action. 若要查看可用操作,请键入 oracle:Type in oracle to see the available actions:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第2张图片

提示

这也是查看适用于任何连接器的触发器和操作的最快方式。This is also the quickest way to see the triggers and actions available for any connector. 键入连接器的部分名称,例如 oracle。Type in part of the connector name, such as oracle. 设计器会列出任何触发器和任何操作。The designer lists any triggers and any actions.

选择其中一个操作,例如“Oracle 数据库 - 获取行”。Select one of the actions, such as Oracle Database - Get row. 选择“通过本地数据网关连接”。Select Connect via on-premises data gateway. 输入 Oracle 服务器名称、身份验证方法、用户名、密码,并选择网关:Enter the Oracle server name, authentication method, username, password, and select the gateway:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第3张图片

连接后,从列表中选择一个表,并向表中输入行 ID。Once connected, select a table from the list, and enter the row ID to your table. 需要知道表的标识符。You need to know the identifier to the table. 如果不知道该标识符,请与 Oracle DB 管理员联系,从 select * from yourTableName 获取输出。If you don't know, contact your Oracle DB administrator, and get the output from select * from yourTableName. 这样即可获取进一步操作所需的标识信息。This gives you the identifiable information you need to proceed.

在以下示例中,从“人力资源”数据库返回了作业数据:In the following example, job data is being returned from a Human Resources database:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第4张图片

在这个后续步骤中,可以使用任何其他连接器来生成工作流。In this next step, you can use any of the other connectors to build your workflow. 如需测试能否从 Oracle 获取数据,则请使用某个发送电子邮件连接器(例如 Office 365 Outlook)向自己发送一封包含 Oracle 数据的电子邮件。If you want to test getting data from Oracle, then send yourself an email with the Oracle data using one of the send email connectors, such as Office 365 Outlook. 使用 Oracle 表中的动态令牌生成电子邮件的 Subject 和 Body:Use the dynamic tokens from the Oracle table to build the Subject and Body of your email:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第5张图片

保存 逻辑应用,并选择“运行”。Save your logic app, and then select Run. 关闭设计器,并在运行历史记录中查看状态。Close the designer, and look at the runs history for the status. 如果该操作失败,请选择失败的消息行。If it fails, select the failed message row. 设计器会打开,并且会显示具体的失败步骤,以及错误信息。The designer opens, and shows you which step failed, and also shows the error information. 如果该操作成功,应该会收到一封电子邮件,其中包含你添加的信息。If it succeeds, then you should receive an email with the information you added.

工作流创意Workflow ideas

想要监视 #oracle 哈希标记,并将推文置于数据库中,使之可以在其他应用程序中查询和使用。You want to monitor the #oracle hashtag, and put the tweets in a database so they can be queried, and used within other applications. 在逻辑应用中添加Twitter - When a new tweet is posted触发器,并输入 #oracle 哈希标记。In a logic app, add the Twitter - When a new tweet is posted trigger, and enter the #oracle hashtag. 然后添加Oracle Database - Insert row操作并选择表:Then, add the Oracle Database - Insert row action, and select your table:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第6张图片

此时会向服务总线队列发送消息。Messages are sent to a Service Bus queue. 想要获取这些消息并将其置于数据库中。You want to get these messages, and put them in a database. 在逻辑应用中,添加Service Bus - when a message is received in a queue触发器,并选择队列。In a logic app, add the Service Bus - when a message is received in a queue trigger, and select the queue. 然后添加Oracle Database - Insert row操作并选择表:Then, add the Oracle Database - Insert row action, and select your table:

azure oracle客户端,连接到 Oracle 数据库 - Azure Logic Apps | Microsoft Docs_第7张图片

常见错误Common errors

错误:无法访问网关Error: Cannot reach the Gateway

原因: 本地数据网关不能连接到云。Cause: The on-premises data gateway is not able to connect to the cloud.

缓解措施:请确保网关正在安装了该网关的本地计算机上运行,并确保该网关可以连接到 Internet。Mitigation: Make sure your gateway is running on the on-premises machine where you installed it, and that it can connect to the internet. 建议不要将网关安装在可能会关闭或进入睡眠状态的计算机上。We recommend not installing the gateway on a computer that may be turned off or sleep. 还可以重新启动本地数据网关服务 (PBIEgwService)。You can also restart the on-premises data gateway service (PBIEgwService).

错误:所使用的提供程序已弃用:“System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 版或更高版本”。Error: The provider being used is deprecated: 'System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.'.

原因: Oracle 客户端 SDK 未安装在运行本地数据网关的计算机上。Cause: The Oracle client SDK is not installed on the machine where the on-premises data gateway is running.

解决方法:下载 Oracle 客户端 SDK 并将其与本地数据网关安装在同一计算机上。Resolution: Download and install the Oracle client SDK on the same computer as the on-premises data gateway.

错误:表“[表名]”未定义任何键列Error: Table '[Tablename]' does not define any key columns

原因: 该表没有主键。Cause: The table does not have any primary key.

解决方法:Oracle Database 连接器要求使用包含主键列的表。Resolution: The Oracle Database connector requires that a table with a primary key column be used.

特定于连接器的详细信息Connector-specific details

在连接器详细信息中查看在 Swagger 中定义的触发器和操作,并查看限制。View any triggers and actions defined in the swagger, and also see any limits in the connector details.

获取帮助Get some help

The Microsoft Q&A question page for Azure Logic Apps is a great place to ask questions, answer questions, and see what other Logic Apps users are doing.

You can help improve Logic Apps and connectors by voting and submitting your ideas at https://aka.ms/logicapps-wish.

后续步骤Next steps

创建逻辑应用,并在 API 列表中了解逻辑应用中的可用连接器。Create a logic app, and explore the available connectors in Logic Apps at APIs list.

你可能感兴趣的:(azure,oracle客户端)