跳转至

Oracle Database(Oracle 数据库)

Connect Foundry to Oracle Database to read and sync data between Oracle databases and Foundry.

:::callout{theme="warning"} If your external data source uses a version of the Oracle database that is older than 12.1 (which was released in 2013), you should use the general JDBC connector, and upload your own driver. The Oracle Database connector described below implements the Oracle JDBC 21.x driver. Learn more about the JDBC driver interoperability matrix for Oracle database versions in the official Oracle documentation ↗. :::

The Oracle Database connector is a Palantir-provided driver connector. Review the official documentation for this driver ↗.

Supported capabilities

Capability Status
Exploration 🟢 Generally available
Batch syncs 🟢 Generally available
Incremental 🟢 Generally available
Change data capture syncs 🟢 Generally available
Table exports 🟢 Generally available

Setup

  1. Open the Data Connection application and select + New Source in the upper right corner of the screen.
  2. Select Oracle from the available connector types.
  3. Follow the additional configuration prompts to continue the setup of your connector using the information in the sections below.

Learn more about setting up a connector in Foundry.

Authentication

The Oracle Database connector supports authentication using a username and password. We recommend using service credentials rather than individual user credentials.

Networking

For Foundry worker sources, add the appropriate egress policies to the connector:

Domain/Host Required
Oracle host/IP Always

The default port for Oracle database connections is 1521, but your specific configuration may use a different port.

Connection details

Option Required? Description
Host type Yes The type of host identifier being provided. Can be either hostname or ipv4.
Hostname Yes The hostname or IP address of your Oracle database server.
Port Yes The port number of your Oracle database (default is 1521).
Service identifier type Yes The type of service identifier to use. Can be either SID or Service name.
TLS No Enable TLS encryption ↗ for the connection. When enabled (default), the connection will use TLS to encrypt all communication with the Oracle database.
Username Yes The username to authenticate with the Oracle database.
Password Yes The password to authenticate with the Oracle database.
Client certificates & private key No Client certificates and private keys may or may not be required by your source to secure the connection.
Server certificates No Server certificates may or may not be required by your source to secure the connection.

Change data capture

The Oracle Database source supports change data capture (CDC) syncs.

Foundry CDC syncs from Oracle Databases use Debezium to capture row-level changes. This requires one-time system configuration changes, privilege grants, and supplemental logging enabled at a table-level. To configure your Oracle Database to allow a user named PLTR to set up a CDC sync on MY_SCHEMA.MY_TABLE, you can run the following commands:

-- One time configuration changes
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

ALTER USER PLTR QUOTA UNLIMITED ON PALANTIR_DATA;
GRANT CONNECT, RESOURCE TO PLTR;
GRANT SELECT_CATALOG_ROLE TO PLTR;
GRANT SELECT ON V_$DATABASE TO PLTR;
GRANT SELECT ON V_$LOGMNR_CONTENTS TO PLTR;
GRANT SELECT ON V_$LOGMNR_LOGS TO PLTR;
GRANT SELECT ON V_$LOGMNR_PARAMETERS TO PLTR;
GRANT SELECT ON V_$LOGFILE TO PLTR;
GRANT SELECT ON V_$LOG TO PLTR;
GRANT SELECT ON V_$ARCHIVED_LOG TO PLTR;
GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO PLTR;
GRANT EXECUTE ON "SYS"."DBMS_FLASHBACK" TO PLTR;
GRANT EXECUTE ON "SYS"."DBMS_LOGMNR_D" TO PLTR;
GRANT EXECUTE ON "SYS"."DBMS_LOGMNR" TO PLTR;
GRANT EXECUTE ON DBMS_LOGMNR TO PLTR;
GRANT SELECT ANY DICTIONARY TO PLTR;
GRANT SELECT ANY TRANSACTION TO PLTR;
GRANT CREATE SESSION TO PLTR;
GRANT LOGMINING TO PLTR;

-- Table-level configurations, repeat for each table
GRANT SELECT, LOCK, FLASHBACK ON TABLE "MY_SCHEMA"."MY_TABLE" TO PLTR
ALTER TABLE "MY_SCHEMA"."MY_TABLE" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

Troubleshooting

Oracle listener logs can provide valuable information about the connection attempts from the Palantir CDC connector. Check the log for any connection-related errors or issues. The default location of the listener log is:

$ORACLE_BASE/diag/tnslsnr/<hostname>/<listener_name>/trace/listener.log

You can check the active sessions in the Oracle Database to determine if the user is connected. To do this, run the following SQL query:

SELECT username, osuser, status, machine, program FROM v$session WHERE username = `<user>`;

If the V_ $ tables grants fail, try running the following query with SYS.V_ $:

GRANT SELECT ON SYS.V_$DATABASE TO `<user>`;

The Oracle alert log contains important information about the database's operations, errors, and other significant events. The location of the alert log depends on your Oracle version and configuration. It is typically located in:

$ORACLE_BASE/diag/rdbms/<db_unique_name>/<instance_name>/trace/alert_<instance_name>.log

If the connector does not seem to be receiving new change events, it might be due to infrequent log switches. Query the V $ LOG_HISTORY view to see the history of log switches and their frequency:

SELECT * FROM v$log_history ORDER BY first_time DESC;

Set parameter ARCHIVE_LAG_TARGET to force a switch at regular intervals if required.

Ensure that your Oracle database is running in ARCHIVELOG mode, as this is a requirement for the connector to work. You can check the current mode with the following query:

SELECT log_mode FROM v$database;

If ARCHIVELOG mode is not enabled, you can enable it with the following commands:

ORACLE_SID=<SID> <user> sqlplus /nolog
CONNECT sys/top_secret AS SYSDBA
alter system set db_recovery_file_dest_size = 10G;
alter system set db_recovery_file_dest = '/opt/oracle/data/recovery_area' scope=spfile;
shutdown immediate
startup mount
alter database archivelog;
alter database open;

Ensure that minimal supplemental logging is enabled at the database level. You can check if it is enabled with the following query:

SELECT supplemental_log_data_min FROM v$database;

Virtual tables

This section provides additional details around using virtual tables from an Oracle Database source. This section is not applicable when syncing to Foundry datasets.

Virtual tables capability Status
Manual registration 🟢 Generally available
Automatic registration 🔴 Not available
Compute pushdown 🔴 Not available

When using virtual tables, remember the following source configuration requirements:

  • You must use a Foundry worker source. Virtual tables do not support use of agent worker connections.
  • Ensure that bi-directional connectivity and allowlisting is established as described in the Networking section above.
  • If using virtual tables in Code Repositories, refer to the related documentation for details about additional required source configurations.
  • When setting up the source credentials, you must use username/password.

中文翻译

Oracle 数据库

将 Foundry 连接到 Oracle 数据库,以在 Oracle 数据库和 Foundry 之间读取和同步数据。

:::callout{theme="warning"} 如果您的外部数据源使用的 Oracle 数据库版本低于 12.1(该版本于 2013 年发布),则应使用通用 JDBC 连接器,并上传您自己的驱动程序。下文描述的 Oracle 数据库连接器实现了 Oracle JDBC 21.x 驱动程序。有关 Oracle 数据库版本的 JDBC 驱动程序互操作性矩阵的更多信息,请参阅官方 Oracle 文档 ↗。 :::

Oracle 数据库连接器是一个 Palantir 提供的驱动程序连接器。请查阅该驱动程序的官方文档 ↗

支持的功能

功能 状态
探索 🟢 正式发布
批量同步 🟢 正式发布
增量同步 🟢 正式发布
变更数据捕获同步 🟢 正式发布
表导出 🟢 正式发布

设置

  1. 打开 数据连接 应用程序,并在屏幕右上角选择 + 新建数据源
  2. 从可用的连接器类型中选择 Oracle
  3. 按照其他配置提示,使用以下各节中的信息继续设置您的连接器。

了解有关在 Foundry 中设置连接器的更多信息。

身份验证

Oracle 数据库连接器支持使用用户名和密码进行身份验证。我们建议使用服务凭据,而不是个人用户凭据。

网络

对于 Foundry 工作节点数据源,请为连接器添加适当的出站策略:

域名/主机 必需
Oracle 主机/IP 始终需要

Oracle 数据库连接的默认端口是 1521,但您的特定配置可能使用不同的端口。

连接详情

选项 是否必需? 描述
主机类型 提供的主机标识符类型。可以是 hostnameipv4
主机名 Oracle 数据库服务器的主机名或 IP 地址。
端口 Oracle 数据库的端口号(默认为 1521)。
服务标识符类型 要使用的服务标识符类型。可以是 SID服务名称
TLS 为连接启用 TLS 加密 ↗。启用后(默认),连接将使用 TLS 加密与 Oracle 数据库的所有通信。
用户名 用于向 Oracle 数据库进行身份验证的用户名。
密码 用于向 Oracle 数据库进行身份验证的密码。
客户端证书和私钥 您的数据源可能需要也可能不需要客户端证书和私钥来保护连接。
服务器证书 您的数据源可能需要也可能不需要服务器证书来保护连接。

变更数据捕获

Oracle 数据库数据源支持变更数据捕获(CDC)同步。

Foundry 从 Oracle 数据库进行的 CDC 同步使用 Debezium 来捕获行级变更。这需要一次性系统配置更改、权限授予以及在表级别启用补充日志记录。要配置您的 Oracle 数据库以允许名为 PLTR 的用户在 MY_SCHEMA.MY_TABLE 上设置 CDC 同步,您可以运行以下命令:

-- 一次性配置更改
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

ALTER USER PLTR QUOTA UNLIMITED ON PALANTIR_DATA;
GRANT CONNECT, RESOURCE TO PLTR;
GRANT SELECT_CATALOG_ROLE TO PLTR;
GRANT SELECT ON V_$DATABASE TO PLTR;
GRANT SELECT ON V_$LOGMNR_CONTENTS TO PLTR;
GRANT SELECT ON V_$LOGMNR_LOGS TO PLTR;
GRANT SELECT ON V_$LOGMNR_PARAMETERS TO PLTR;
GRANT SELECT ON V_$LOGFILE TO PLTR;
GRANT SELECT ON V_$LOG TO PLTR;
GRANT SELECT ON V_$ARCHIVED_LOG TO PLTR;
GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO PLTR;
GRANT EXECUTE ON "SYS"."DBMS_FLASHBACK" TO PLTR;
GRANT EXECUTE ON "SYS"."DBMS_LOGMNR_D" TO PLTR;
GRANT EXECUTE ON "SYS"."DBMS_LOGMNR" TO PLTR;
GRANT EXECUTE ON DBMS_LOGMNR TO PLTR;
GRANT SELECT ANY DICTIONARY TO PLTR;
GRANT SELECT ANY TRANSACTION TO PLTR;
GRANT CREATE SESSION TO PLTR;
GRANT LOGMINING TO PLTR;

-- 表级别配置,为每个表重复执行
GRANT SELECT, LOCK, FLASHBACK ON TABLE "MY_SCHEMA"."MY_TABLE" TO PLTR
ALTER TABLE "MY_SCHEMA"."MY_TABLE" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

故障排除

Oracle 监听器日志可以提供有关 Palantir CDC 连接器连接尝试的宝贵信息。检查日志中是否有任何与连接相关的错误或问题。监听器日志的默认位置是:

$ORACLE_BASE/diag/tnslsnr/<hostname>/<listener_name>/trace/listener.log

您可以检查 Oracle 数据库中的活动会话,以确定用户是否已连接。为此,请运行以下 SQL 查询:

SELECT username, osuser, status, machine, program FROM v$session WHERE username = `<user>`;

如果 V_ $ 表的授权失败,请尝试使用 SYS.V_ $ 运行以下查询:

GRANT SELECT ON SYS.V_$DATABASE TO `<user>`;

Oracle 警报日志包含有关数据库操作、错误和其他重要事件的重要信息。警报日志的位置取决于您的 Oracle 版本和配置。它通常位于:

$ORACLE_BASE/diag/rdbms/<db_unique_name>/<instance_name>/trace/alert_<instance_name>.log

如果连接器似乎没有接收到新的变更事件,可能是由于日志切换不频繁。查询 V $ LOG_HISTORY 视图以查看日志切换的历史记录及其频率:

SELECT * FROM v$log_history ORDER BY first_time DESC;

如果需要,设置参数 ARCHIVE_LAG_TARGET 以强制按固定间隔进行切换。

确保您的 Oracle 数据库以 ARCHIVELOG 模式运行,这是连接器正常工作的必要条件。您可以使用以下查询检查当前模式:

SELECT log_mode FROM v$database;

如果未启用 ARCHIVELOG 模式,您可以使用以下命令启用它:

ORACLE_SID=<SID> <user> sqlplus /nolog
CONNECT sys/top_secret AS SYSDBA
alter system set db_recovery_file_dest_size = 10G;
alter system set db_recovery_file_dest = '/opt/oracle/data/recovery_area' scope=spfile;
shutdown immediate
startup mount
alter database archivelog;
alter database open;

确保在数据库级别启用了最小补充日志记录。您可以使用以下查询检查它是否已启用:

SELECT supplemental_log_data_min FROM v$database;

虚拟表

本节提供有关从 Oracle 数据库数据源使用虚拟表的更多详细信息。本节不适用于同步到 Foundry 数据集的情况。

虚拟表功能 状态
手动注册 🟢 正式发布
自动注册 🔴 不可用
计算下推 🔴 不可用

使用虚拟表时,请记住以下数据源配置要求:

  • 您必须使用 Foundry 工作节点数据源。虚拟表不支持使用代理工作节点连接。
  • 确保按照上文网络部分所述建立双向连接和允许列表。
  • 如果在代码仓库中使用虚拟表,请参阅相关文档以了解有关其他必需数据源配置的详细信息。
  • 设置数据源凭据时,必须使用 用户名/密码