9 Work with Sources
Using saved connections and Datasources, you can set up cubes to interact easily with a variety of source data.
For example, you can set up a partition between a cube and RDBMS tables, share data between a cube and Oracle Database, develop security filters using variables to fetch members or user names from outside source data, and load data from REST API endpoints.
Many cube operations require connection information, such as login details, to access remote source data or hosts. You can define these as connections and Datasources once, and reuse them in various operations, so that you do not have to specify the details each time you perform a task.
You can implement saved connections and Datasources either globally or per application. These abstractions facilitate the following operations:
-
Loading dimensions and data
-
Importing cubes
-
Defining variable security filters
-
Connecting cubes using partitions, and accessing real-time data
-
Drilling through to remote sources of data
Topics in this chapter:
About Connections and Datasources
Many operations call for connecting to source data external to the cube. Connections and Datasources, which you create and save as reusable objects in Oracle Essbase, provide a way to do this efficiently.
If you have network connectivity between an external source of data and Essbase, you can define connections and Datasources in Essbase to easily "pull" data from the external source. If you have no network connectivity between Essbase and the external source of data, then you should stream data loads or dimension builds using the CLI tool, first creating a local connection, and then issuing the dataload or dimbuild command with the stream option.
A connection stores information about an external server and the login credentials that are required to access it. By defining one connection that can be used by multiple processes and artifacts, you can simplify many aspects of your analytics. For example, when it’s time to change a system password, you only need to update one connection.

A Datasource is another object that you can define once and reuse, to help you manage data flow into and out of your cubes. You can define a Datasource to represent any external source of data, whether a relational system, a table, a file, or another cube.

You can define one connection and use it to access multiple Datasources. For example, consider an external Oracle Database server that has separate tables for products, resellers, and sales territories. You need only one connection to access Oracle Database, but you might want to create unique Datasources to access each of the tables.
One use case in which you might define multiple Datasources per connection is as follows: if you use separate load rules to build each dimension in a cube, each rules file can be set up to access the relevant table in Oracle Database. For example, assume your cube has a Market dimension, and you regularly build dimensions using a Dim_Market load rule to populate the Market dimension from a SALES_TERRITORIES table. Likewise, you use a Dim_Product load rule to populate the Product dimension from a PRODUCT table. Both load rules can use the same connection, but because they draw from separate tables, you defined two different Datasources.
Historically, you needed to hard code connection and source data details into Essbase artifacts such as rule files, location aliases, and partitions. While hard coded information is still supported in these artifacts, you can work more efficiently if you define connections and Datasources globally (or, at the application level).
Create Connections and Datasources
Before you can create connections to external source data from Essbase, you must get the connection details such as host names, user names, passwords, and any other service credentials from your system administrator.
Create a Global Connection
To create a global connection (accessible to multiple applications),
-
Log in to the Essbase web interface as a service administrator.
-
Click Sources.
-
Click Create Connection and select the source you need to connect to. Sources and versions included with Essbase are listed in the Database section of the certification matrix (see the Platform SQL table). If you want to use your own preferred JDBC driver that you will upload, refer for details to Create Connections and Datasources for Generic JDBC Drivers.
-
Complete the connection details and save the connection. Next, create one or more Datasources that use the connection. The input details vary depending on the source type.
Create an Application-level Connection
To create an application-level connection (accessible to only that application),
-
Log in to the Essbase web interface as an application manager, or as a power user with application management permission to the specified application.
-
On the Applications page, click the Actions menu to the right of the application name, and click Inspect.
-
Click the Sources tab.
-
Click Create Connection and select the source you need to connect to. Supported sources and versions included with Essbase are listed in the Database section of the certification matrix (see the Platform SQL table). If you want to use your own preferred JDBC driver that you will upload, refer for details to Create Connections and Datasources for Generic JDBC Drivers.
-
Complete the connection details and save the connection. Next, create one or more Datasources that use the connection. The input details vary depending on the source type.
Source-Specific Workflows
For some source-specific workflows, see the following topics:
Create a Connection and Datasource to Access Oracle Database
Define a connection and Datasource between Essbase and Oracle Database.
If applicable, use one of the following subtopics instead of this one:
Create a Connection and Datasource for Oracle Autonomous Data Warehouse
Define a connection and Datasource between Essbase and Autonomous Data Warehouse.
If you will create a federated partition between Essbase and Autonomous Data Warehouse on Shared Infrastructure, use the following topic instead of this one: Create a Connection for Federated Partitions.
To create a global connection, you need to have the service administrator role. To create an application level connection, you need to have user role, plus application manager permission on the application.
Create a Connection and Datasource to Access Another Cube
Define a connection and Datasource between two Essbase cubes (on different instances).
Create a Connection and Datasource to Access a Data File
Define a connection and Datasource between Essbase and a source data file.
Create Connections and Datasources for Generic JDBC Drivers
Use this workflow to enable Essbase to connect to any JDBC source of data, using drivers you upload to the Essbase Server.
If you are the Essbase deployment administrator, you can configure Essbase to use your preferred drivers you upload to the Essbase server machine. Oracle has tested Essbase JDBC connectivity using Oracle drivers. To use JDBC drivers from other vendors, check the driver documentation for requirements on specifying the URL and credentials of your JDBC data source. For any performance-related steps, refer to the vendor JDBC documentation.
Note:
Ensure that the JDBC driver you use with Essbase honors the setFetchSize method for controlling memory used while processing the result set. For optimal performance of data load and dimension build processes, Essbase fetches 1000 records per network call.
To configure Essbase to use generic JDBC drivers,
-
Connect to the Essbase server machine using SSH.
-
Manually create a
drivers
directory in <Essbase Product Home> on the server instance.Ensure
drivers
is all lower case, as the path is case sensitive. -
From your vendor site, download the JDBC driver JARs you want to use.
The Oracle Database JDBC driver supported by Essbase is
ojdbc8.jar
.If you use Autonomous Data Warehouse, you need to download the full archive (
ojdbc8-full.tar.gz
) containing the Oracle JDBC Thin driver and companion JARs. -
Upload the JDBC driver jars to the
drivers
directory on the Essbase instance.Upload only one version of each database driver to the
drivers
directory. For example, do not upload bothsqljdbc41.jar
andsqljdbc42.jar
, or else Essbase will use the older one (as it appears first in CLASSPATH).If you use Autonomous Data Warehouse, extract the archive (
ojdbc8-full.tar.gz
) and move all of the contents directly into thedrivers
directory (not a subfolder). -
Create connections to the JDBC drivers.
-
In the Essbase web interface,
- to create a global connection: on the Sources page, click Connections.
- to create an application-level connection: from the Actions menu to the right of an application name, launch the inspector and click Sources.
-
Click Create Connection and select JDBC.
To find the JDBC driver, Essbase looks in the
drivers
folder. If nojar
files are found, Essbase returns a Class Not Found (or failure to load driver) error when you test the connection. -
In the Create Connection screen,
-
Provide a name for the JDBC connection. For example, OrclJDBC.
-
In the URL field, provide the JDBC connection string. For example,
jdbc:oracle:thin:@myserver:1521:orcl
. Obtain the JDBC connection string from the JDBC provider. -
For User and Password fields, enter the credentials for a user who is authorized to access the database.
-
In the Driver field, provide the fully qualified class name of the JDBC driver. For example,
oracle.jdbc.driver.OracleDriver
.
For Oracle drivers, specify the URL using the following syntax guidelines:
-
To use the Oracle System ID (SID) that uniquely identifies the database, use the syntax
jdbc:oracle:thin:@<host>:<port>:<SID>
. For example,jdbc:oracle:thin:@myhost:1521:orcl
-
If Oracle Database is registered with a listener, you can use Service Name in the URL instead of the SID, using short syntax
jdbc:oracle:thin:@<host>:<port>/<servicename>
. Example:jdbc:oracle:thin:@myhost.example.com:1521/orcl.esscs.myhost.example.com
-
The following example uses Service Name with long syntax.
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(host=myhost.example.com)(protocol=tcp)(port=1521))(CONNECT_DATA=(SERVICE_NAME=orcl.example.com)))
-
If you are using Autonomous Data Warehouse, in the URL syntax, you must include the TNS_ADMIN environment variable specifying the path to the wallet. The wallet can be anywhere on the Essbase server machine, but you must provide the full path, using syntax like
jdbc:oracle:thin:@<database_service_name>?TNS_ADMIN=<walletpath>
.Linux Example
jdbc:oracle:thin:@adwsql_low?TNS_ADMIN=/scratch/oracle_home/dist/essbase/drivers/adwConn
Windows Example
jdbc:oracle:thin:@adwsql_low?TNS_ADMIN="C:\\Oracle123\\Middleware\\Oracle_Home\\essbase\\drivers\\adwConn"
Example on an OCI Deployment
jdbc:oracle:thin:@adwsql_low?TNS_ADMIN=/u01/data/essbase/catalog/users/firstname.lastname@example.com/adwconn
-
-
Click Test to validate the connection, and if successful, click Create.
-
Verify that the connection was created successfully and appears in the list of connections.
-
-
Create Datasources over the generic JDBC driver connections.
-
Click Datasources, and click Create Datasource.
-
From the Connection drop-down box, select the name of the connection you just created; for example, SAMPLE.OrclJDBC. Application-level connections are prefixed with the application name, in the format appName.connectionName.
-
Provide a name for the Datasource; for example, OrclJDBC_DS.
-
Optionally enter a description of the Datasource; for example, SAMPLE_BASIC_TABLE on Oracle Database.
-
In the Query field, provide the appropriate SQL query that selects the data you want to make available in this Datasource.
-
Click Next. If the SQL statement was correct to query a table, you should see the queried columns populated.
-
Change any numeric columns to Double, and click Next.
-
Change any additional source-specific parameters, if applicable, and click Next. For information about parameter use, see Implement Parameters for Datasources.
-
Review the preview panel. You should see the results of the query fetching columns of data from the external source.
-
If the preview looks correct, click Create to finish creating the Datasource.
-
Implement Parameters for Datasources
To make Datasources more flexible, you can implement runtime parameters in the query to allow the Datasource to use variables.
These may be substitution variables defined in Essbase, runtime parameters defined by the grid context when Smart View users drill through to external data, or user defined functions written in an external source system.
Whenever you plan to use variables in Essbase Datasources, you first need to
-
Include variable syntax in the Datasource query. For example, the Datasource query must include
?
in its syntax, where the?
is a placeholder for some variable to be defined at runtime. -
Do one of the following:
-
Set a fixed, default parameter value in the Datasource for Essbase to use as a fallback in case the variable has an invalid context at runtime, OR
- Set a substitution variable to be used by the Datasource
-
Pass an external, user-defined function (or stored procedure) as a parameter
-
To define Datasources and implement parameters for them, you must be an application manager or higher.
Enabling the use of variables in Essbase Datasources helps you streamline operations by requiring fewer Datasources to maintain. Implementing variables to Datasources enables you to specify a runtime query context that will be applied whenever a user accesses a Datasource associated with an Essbase cube.
For example, assume the following use cases.
-
A database manager oversees a recurring data load job that loads data to the cube on a monthly basis. The database manager can now use a substitution variable to load data for the current month, instead of maintaining a load rule for each month.
-
An application manager maintains drill through report definitions for different business use cases. The application manager implements variables in the underlying Datasource that Smart View users pull from in their drill through operations. As a result, the application manager has fewer drill through report definitions to maintain and debug.
Set a Default Parameter in a Datasource
Set a default parameter in a Datasource if you want to enable the use of variables in the queries Essbase generates when it works with data stored outside the cube.
To set the default parameter,
-
Obtain or create a connection to the external source of data (for example, create a connection to Oracle Database).
-
You can use a global connection, if one already exists in the Sources page of the Essbase web interface, OR,
-
You can create an application level connection:
-
-
Create a Datasource over the connection you will use to access Oracle Database.
Again, note that you can define a Datasource globally if it should be available to all applications, or you can define it at the application level.
-
In the General step, for Connection, select the Oracle Database connection you created.
-
For Name, give a name to the Datasource.
-
For the Query, provide a query (this example uses SQL). To make it a parameterized query, you must include a filter condition (WHERE clause) that maps a relational column in your source to a placeholder. You indicate the position of the variable by using a placeholder, ?, in the query syntax. The placeholder is for a parameter you will pass in a later step.
select * from SB_DT where DIMENSION_YEAR=?
For example, assume your relational database has the following table, named SB_DT. The table has DIMENSION_YEAR column with months as values:
To use a variable for the selection of month values from the DIMENSION_YEAR column, apply the following filter syntax in the query:
where DIMENSION_YEAR=?
-
Click Next.
-
In the Columns step, apply the appropriate data type that Essbase should associate with each column from your relational source data.
For example, set the numeric columns to type Double, and leave the alphanumeric columns as type String.
-
Click Next.
-
In the Parameters step, Param1 is created – this parameter exists because you used a ? in the query on the General step.
Leave Use Variables unchecked, double-click the text field under Value, and type in a default value for the runtime parameter. The purpose of this default value is for Essbase to use as a fallback in case the parameter has an invalid context at runtime. This step is important if you intend to use runtime parameters as part of drill through report definitions.
You can also rename Param1 to a name that is meaningful for your use case. For example, you can rename it to param_G_month to indicate that the parameter uses a global variable for the current month, or you can rename it to param_<appName>_month to indicate that the parameter uses an application-level variable for the current month. Customizing the parameter names can be helpful when debugging parameters using Essbase server log files.
If you want to customize the parameter to reference a substitution variable, then you do not have to provide a default value. See Use Substitution Variables in a Datasource instead of this topic.
-
Click Next.
-
In the Preview, notice that the default parameter has been applied to your query. As a result, the preview is populated only with external source records in which the value of DIMENSION_YEAR column is Jan.
Although the preview only displayed values with the default parameter applied, later, when you implement runtime parameters for drill through report definition, you will have access to more external data than what was visible in the preview.
-
Click Create to create the Datasource based on this query of your external source data. The Datasource is enabled for implementation of runtime parameters.
-
Use Substitution Variables in a Datasource
The following workflow illustrates how to create an Essbase Datasource from a query of external source data, using a substitution variable defined in Essbase. The substitution variable adds more flexibility to how you design the query that pulls from your source data.
In this example, you will use a substitution variable in Essbase to declare the current month. Instead of updating Datasources monthly to pull in data for the current month, you can leave the Datasources alone, and only update the substitution variable you defined.
-
Create a global or application level substitution variable.
-
Obtain or create a connection to the external source of data (for example, create a connection to Oracle Database).
-
You can use a global connection, if one already exists in the Sources page of the Essbase web interface, OR,
-
You can create an application level connection:
-
-
Create a Datasource over the connection you will use to access Oracle Database.
Again, note that you can define a Datasource globally if it should be available to all applications, or you can define it at the application level.
-
In the General step, for Connection, select the Oracle Database connection you created.
-
For Name, give a name to the Datasource.
-
For the Query, provide a query (this example uses SQL). To make it a parameterized query, you must include a filter condition (WHERE clause) that maps a relational column in your source to a placeholder. You indicate the position of the variable by using a placeholder,
?
, in the query syntax. The placeholder is for a parameter you will pass in a later step.select * from SB_DT where DIMENSION_YEAR=?
For example, assume your relational database has the following table, named SB_DT. The table has DIMENSION_YEAR column with months as values:
To use a variable for the selection of month values from the DIMENSION_YEAR column, apply the following filter syntax in the query:
where DIMENSION_YEAR=?
-
Click Next.
-
In the Columns step, apply the appropriate data type that Essbase should associate with each column from your relational source data.
For example, set the numeric columns to type Double, and leave the alphanumeric columns as type String.
-
Click Next.
-
In the Parameters step, Param1 is created – this parameter exists because you used a
?
in the query on the General step. To customize Param1 to reference a substitution variable, click Use Variables, and select a substitution variable from the Value drop-down list.If you are creating a Datasource within an application, both global and application-level substitution variables are available to select. The application-level variables are prefixed with the application name. If you are creating a global Datasource, only global substitution variables are available to select.
You can rename Param1 to a name that is meaningful for your use case. For example, you can rename it to param_G_month to indicate that the parameter uses a global variable for the current month, or you can rename it to param_<appName>_month to indicate that the parameter uses an application-level variable for the current month. Customizing the parameter names can be helpful when debugging parameters using Essbase server log files.
-
Click Next.
-
In the Preview, notice that the substitution variable is applied to your query. As a result, the preview is populated only with external source records in which the value of DIMENSION_YEAR column is Aug.
-
Click Create to create a Datasource based on this query of your external source data.
-