使用客户管理的异构连接创建数据库链接,以实现可公开访问的非 Oracle 数据库
使用 DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
从基于专用 Exadata 基础结构的 Autonomous Database 创建数据库链接,该链接位于 Oracle Database Gateway 的公共端点上,用于访问非 Oracle 数据库。
Oracle Database Gateway 是专为访问特定非 Oracle 系统而设计的网关。使用 Oracle Database Gateway,您可以访问分布式数据库系统中的任意位置的数据,而无需知道数据的位置或存储方式。将 Autonomous Database 上的数据库链接与 Oracle Database Gateway 结合使用,可支持异构环境,无需定制应用即可访问非 Oracle 系统中的数据。
注意:
仅 19c 版本为 19.25 及更高版本,23ai 版本为 23.6 及更高版本,支持创建具有客户管理的异构连接的数据库链接,以公开访问的非 Oracle 数据库。相关主题
Prerequisites
要在公共端点上使用来自 Autonomous Database 实例的数据库链接,请执行以下操作:
-
配置 Oracle Database Gateway 以访问非 Oracle 数据库。有关详细信息,请参阅 Oracle Database 19c Database Heterogeneous Connectivity User's Guide 或 Oracle Database 23ai Database Heterogeneous Connectivity User's Guide 中的 Oracle Database Gateways 。
根据要连接到的数据库,您可以参考相应的《安装和配置指南》和《网关用户指南》。
例如,对于 Oracle Database Gateway for SQL Server,请参阅:
-
Oracle Database 19c Installation and Configuration Guide for Microsoft Windows 或 Oracle Database 23ai Installation and Configuration Guide for Microsoft Windows 中的 Installing and Configuring Oracle Database Gateway for SQL Server
-
Oracle Database 19c User's Guide 或 Oracle Database 23ai User's Guide 中的 Oracle Database Gateway for SQL Server 简介
-
Oracle Database 19c Installation and Configuration Guide for Microsoft Windows 或 Oracle Database 23ai Installation and Configuration Guide for Microsoft Windows 中的 Configure Oracle Net for the Gateway
-
-
配置 Oracle Net Listener 以处理 Oracle Database Gateway 上的传入请求。
-
在 Oracle Database Gateway 上创建一个自签名的 wallet。
- 将目标网关配置为使用 TCP/IP 和 SSL (TCPS) 验证。有关详细信息,请参阅 Oracle Database 19c Security Guide 或 Oracle Database 23ai Security Guide 中的 Configuring Transport Layer Security Authentication 。
过程
使用 DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK
创建数据库链接,从公共端点上的 Autonomous Database 实例到 Oracle Database Gateway 以访问非 Oracle 数据库。
BEGIN
DBMS_CLOUD.UPDATE_CREDENTIAL(
credential_name =>'DB_LINK_CRED',
attribute =>'PASSWORD',
value=>'password'
);
END;
/
其中,口令是新口令。
执行此操作后,使用此身份证明的现有数据库链接将继续工作,而不必删除并重新创建数据库链接。
有关详细信息,请参阅:UPDATE_CREDENTIAL 过程
有关创建指向 Oracle Database Gateway 的数据库链接以访问 Microsoft SQL Server 数据库的示例,请参见 How to Access Non-Oracle Databases from Autonomous Database using Oracle Database Gateway 。
注意:
尽管上面的博客在 Autonomous Database Serverless 的背景下进行了讨论,但该博客中的所有内容也适用于 Autonomous Database on Dedicated Exadata Infrastructure 。