Skip to main content
The driver for Oracle is community-supported and is not maintained by Cube or the database vendor.

Prerequisites

  • The hostname for the Oracle database server
  • The username/password for the Oracle database server
  • The name of the database to use within the Oracle database server
The driver uses node-oracledb in Thin mode, which supports Oracle Database 12.1 and later. Older servers (e.g. 11g) require Thick mode, which the driver does not currently enable — track this issue.

Setup

Manual

Add the following to a .env file in your Cube project:

Environment Variables

Pre-Aggregations

By default, pre-aggregations are stored in Cube Store and need no setup in Oracle. Pre-aggregations with external: false are built inside Oracle, in a schema that you create first. Cube can’t create it because an Oracle schema is a user account.
  1. Create a dedicated user for pre-aggregations. Replace users with the tablespace that should hold the pre-aggregation tables:
  2. Let CUBEJS_DB_USER create, index, drop and read tables in that schema. On Oracle 23ai and later, grant this on that schema only:
    Earlier releases only have database-wide CREATE ANY TABLE, CREATE ANY INDEX, DROP ANY TABLE and SELECT ANY TABLE privileges. They let the user read and drop tables in every schema.
  3. Set CUBEJS_PRE_AGGREGATIONS_SCHEMA to that user, e.g., cube_preaggs.
Use this schema only for pre-aggregations. Every build drops the tables in it that are not current pre-aggregation tables, so never point it at a schema that holds your data.

SSL

To enable SSL-encrypted connections between Cube and Oracle, set the CUBEJS_DB_SSL environment variable to true. For more information on how to configure custom certificates, please check out Enable SSL Connections to the Database.