Skip to main content
Version: current [25.x]

Oracle

This topic describes Oracle data source considerations and Dremio configuration.

User Impersonation

The Oracle database username provided in the source configuration is the default username that is used for running queries. When queries are run against Oracle in Dremio, users use the privileges associated with the Oracle database username and run queries under that username.

You can change this default in Dremio by enabling user impersonation in the Advanced Options, which allows users to run queries under their own usernames and restricts their access. For example, user_1 can run queries as user_1 rather than oracle_svc. Before enabling user impersonation, some setup is required in Oracle to allow one user to impersonate another user, because the username of the user in Dremio must be the same as their username in Oracle and the user must be able to connect through the Oracle database username.

To set up user impersonation, follow these steps:

  1. Ensure the user's username in Oracle matches their username in Dremio. If the usernames do not match, modify one of the usernames or create a new user account with a matching username.

  2. Run a ALTER USER command in Oracle to allow the user to connect through the Oracle database username:

Example of altering the user in Oracle
ALTER USER testuser1 GRANT CONNECT THROUGH proxyuser;

In this example, the user can log in as testuser1 in Dremio and in Oracle, and they can connect through the proxyuser. The proxyuser is the Oracle database username provided in the source configuration.

  1. Log in as an admin to Dremio.

  2. Follow the steps for Dremio Configuration using the Oracle database username and enable User Impersonation in the Advanced Options.

  3. Grant source privileges to the user.

Now that you have enabled user impersonation, a user logging in to Dremio with their username can access the Oracle source and its datasets according to their privileges. The user also runs queries against Oracle under their username.

Connection Information

The following connection information is needed prior to adding Oracle as a data source.

  • Hostname or IP
  • Port
  • Site Identifier (SID) of the Oracle server
note

Ensure that your Dremio cluster has access to the appropriate port for your Oracle source. By default this is port 1521.

Initial Connection

Depending on the number of tables in your Oracle source, the final step of adding it to Dremio can take anywhere from a few seconds to a few minutes as the source's metadata is processed. However, this is a one-time cost and further queries to the source will not incur additional metadata reads.

Configuring Oracle as a Source

  1. On the Datasets page, to the right of Sources in the left panel, click This is the Add Source icon..
  2. In the Add Data Source dialog, under Databases, select Oracle.

General

Under Name, enter the name to identify the data source in Dremio. The name cannot include the following special characters: /, :, [, or ].

Host

NameDescription
HostOracle host name.
PortOracle port number. Defaults to 1521.
Service NameService Name of your database.
Encrypt connectionEnables secure connections.

Authentication

  • No Authentication
  • Master Credentials (default):
    • Username: Oracle username

    • Password:

      • Dremio: Provide the Oracle password in plain text. Dremio stores the password.
      • Azure Key Vault: Provide the URI for the Azure Key Vault secret that stores the Oracle password. The URI format is https://<vault_name>.vault.azure.net/secrets/<secret_name> (for example, https://myvault.vault.azure.net/secrets/mysecret).
      note

      To use Azure Key Vault as your application secret store, you must:
      - Deploy Dremio on Azure.
      - Complete the Requirements for Authenticating with Azure Key Vault.

      It is not necessary to restart the Dremio coordinator when you rotate secrets stored in Azure Key Vault. Read Requirements for Secrets Rotation for more information.

      • AWS Secrets Manager: Provide the Amazon Resource Name (ARN) for the AWS Secrets Manager secret that holds the Oracle password, which is available in the AWS web console or using command line tools.
      • HashiCorp Vault (Dremio 25.0.4+): Choose the HashiCorp secrets engine you're using from the dropdown menu and enter the secret reference for the Oracle password in the correct format in the provided field.
  • Secret Resource Url: Provide the username and secret resource URL for Dremio to use for the source.
  • Kerberos

Advanced Options

!
  • Use timezone as connection region: If checked, uses timezone to set connection region.
  • Include synonyms: If checked, includes synonyms as datasets.
  • Map Oracle DATE columns to TIMESTAMP: If selected, the DATE column will display values in timestamp format.
  • Record fetch size: Number of records to fetch at once. Set to 0 (zero) to have Dremio automatically decide. Default: 10
  • Maximum idle connections: The total number of connections allowed to be idle at a given time. By default, this is set to 8.
  • Connection idle time (s): The amount of time (in seconds) allowed for a connection to remain idle before the connection is terminated. By default, this is set to 60.
  • Query timeout: The amount of time (in seconds) allowed to wait for the results of a query. If this time expires, the connection being used is returned to an idle state.
  • Enable legacy dialect
  • Encryption: Provide the SSL/TLS server certificate distinguished name, otherwise, leave blank to disable the DN match.

Reflection Refresh

!
  • Never refresh -- Specifies how often to refresh based on hours, days, weeks, or never.
  • Never expire -- Specifies how often to expire based on hours, days, weeks, or never.

Metadata

!

Dataset Handling

  • Remove dataset definitions if underlying data is unavailable (Default).
    If this box is not checked and the underlying files under a folder are removed or the folder/source is not accessible, Dremio does not remove the dataset definitions. This option is useful in cases when files are temporarily deleted and put back in place with new sets of files.

Metadata Refresh

  • Dataset Discovery: Refresh interval for top-level source object names such as names of DBs and tables.
    • Fetch every -- Specify fetch time based on minutes, hours, days, or weeks. Default: 1 hour
  • Dataset Details: The metadata that Dremio needs for query planning such as information needed for fields, types, shards, statistics, and locality.
    • Fetch mode -- Specify either Only Queried Datasets, All Datasets, or As Needed. Default: Only Queried Datasets
      • Only Queried Datasets -- Dremio updates details for previously queried objects in a source.
        This mode increases query performance because less work is needed at query time for these datasets.
      • All Datasets -- Dremio updates details for all datasets in a source. This mode increases query performance because less work is needed at query time.
      • As Needed -- Dremio updates details for a dataset at query time. This mode minimized metadata queries on a source when not used, but might lead to longer planning times.
    • Fetch every -- Specify fetch time based on minutes, hours, days, or weeks. Default: 1 hour
    • Expire after -- Specify expiration time based on minutes, hours, days, or weeks. Default: 3 hours

Privileges

On the Privileges tab, you can grant privileges to specific users or roles. See Access Controls for additional information about privileges.

note

All privileges are optional.

  1. For Privileges, enter the user name or role name that you want to grant access to and click the Add to Privileges button. The added user or role is displayed in the USERS/ROLES table.
  2. For the users or roles in the USERS/ROLES table, toggle the checkmark for each privilege you want to grant on the Dremio source that is being created.
  3. Click Save after setting the configuration.

Oracle TLS Configuration

To use TLS to connect to an Oracle source, do the following:

  1. Select the option Connect using SSL/TLS during initial configuration.
  2. If you want to ensure that the server you’re connecting to exactly matches a particular certificate string, add the Server Certificate Distinguished Name under SSL/TLS in Advanced Options.
  3. Add the Certificate Authority certificate to Dremio's trust store. To add the CA certificate that is used to sign the Oracle certificate into Dremio's trust store:
    1. Import the CA certificate and convert the certificate into DER format (required by Java keytool). For example, using OpenSSL tool:
      $ openssl x509 -outform der -in oracle-ca.pem -out oracle-ca.der
    2. Add the certificate to a new or existing truststore.
      $ keytool -import -alias oracle-ca -keystore dremio-truststore.jks -file oracle-ca.der
    3. Modify the DREMIO_JAVA_SERVER_EXTRA_OPTS section of the dremio-env configuration file to use the trust store by adding the following:
      Djavax.net.ssl.trustStore=<path/to>/dremio-truststore.jks Djavax.net.ssl.trustStoreType=JKS
      Djavax.net.ssl.trustStorePassword=<password>

Updating an Oracle Source

To update an Oracle source:

  1. On the Datasets page, under Databases in the panel on the left, find the name of the source you want to update.
  2. Right-click the source name and select Settings from the list of actions. Alternatively, click the source name and then the The Settings icon at the top right corner of the page.
  3. In the Source Settings dialog, edit the settings you wish to update. Dremio does not support updating the source name. For information about the settings options, see Configuring Oracle as a Source.
  4. Click Save.

Deleting an Oracle Source

note

If the source is in a bad state (for example, Dremio cannot authenticate to the source or the source is otherwise unavailable), only users who belong to the ADMIN role can delete the source.

To delete an Oracle source, perform these steps:

  1. On the Datasets page, click Sources > Databases in the panel on the left.
  2. In the list of data sources, hover over the name of the source you want to remove and right-click.
  3. From the list of actions, click Delete.
  4. In the Delete Source dialog, click Delete to confirm that you want to remove the source.
note

Deleting a source causes all downstream views that depend on objects in the source to break.

Predicate Pushdowns

Dremio delegates the execution of these expressions and functions to the database being queried, often dramatically improving query performance. It can also offload entire SQL queries that include one or more of these expressions and functions.

*, +, -, /, %
<, <=, <>, =, >, >=, !=
AND, NOT, OR, ||
ABS
ACOS
ADD_MONTHS
ASIN
ATAN
ATAN2
AVG
CAST
CEIL
CEILING
CHAR_LENGTH
CHARACTER_LENGTH
CONCAT
COS
COSH
COT
COVAR_POP
COVAR_SAMP
DATE_ADD
DATE_SUB
DATE_TRUNC_DAY
DATE_TRUNC_HOUR
DATE_TRUNC_MINUTE
DATE_TRUNC_MONTH
DATE_TRUNC_QUARTER
DATE_TRUNC_WEEK
DATE_TRUNC_YEAR
DEGREES
E
EXP
EXTRACT_CENTURY
EXTRACT_DAY
EXTRACT_DOW
EXTRACT_DOY
EXTRACT_HOUR
EXTRACT_MINUTE
EXTRACT_MONTH
EXTRACT_QUARTER
EXTRACT_SECOND
EXTRACT_WEEK
EXTRACT_YEAR
FLOOR
IS DISTINCT FROM
IS NOT DISTINCT FROM
IS NOT NULL
IS NULL
LAST_DAY
LCASE
LEFT
LENGTH
LIKE
LN
LOCATE
LOG
LOG10
LOWER
LPAD
LTRIM
MAX
MEDIAN
MIN
MOD
PERCENT_CONT
PERCENT_DISC
PI
POSITION
POW
POWER
RADIANS
REGEXP_LIKE
REPLACE
REVERSE
RIGHT
ROUND
RPAD
RTRIM
SIGN
SIN
SINH
SQRT
STDDEV
STDDEV_POP
STDDEV_SAMP
SUBSTR
SUBSTRING
SUM
TAN
TANH
TO_CHAR
TO_DATE
TRIM
TRUNC
TRUNCATE
UCASE
UPPER
VAR_POP
VAR_SAMP

note

Since Oracle has no Boolean type, project operations that contain SQL expressions which evaluate to true or false (e.g. SELECT username, friends > 0), and filter operations that include boolean literals in a filter (e.g. WHERE currentAccount = true) cannot be executed as pushdowns.

Running Queries Directly on Oracle Through Dremio

Dremio users can run pass queries through Dremio to run on Oracle. Doing so can sometimes decrease query execution times. For more information, see Querying Relational-Database Sources Directly.

For More Information