5 Configuring Data Access for Oracle Real-Time Decisions

JDBC data sources are used by Oracle RTD to access outside data. Data sources are application-server specific, and are used to identify new JDBC data sources that are to be used as suppliers in Inline Services. These data sources can be RDBMS databases, as well as ODBC identified data sources. For information about supported versions for enterprise data sources, see the documents referred to in Section 1.3, "System Requirements and Certification."

This chapter contains the following topics:

5.1 Creating Additional JDBC Data Sources in WebLogic

If you are running Real-Time Decision Server on WebLogic, follow the steps in this section to configure JDBC data sources so that your Inline Services can access outside data.

This section contains the following topics:

5.1.1 Setting the Path to JDBC Jar Files for Your Data Source

To set the path to JDBC jar files for your data source, you may need to add paths to the Classpath for your Managed Server, if your data source database is different from the Oracle RTD database, and you have not previously edited the Classpath.

  1. If the enterprise data source you want to add is a Teradata data source, copy the files terajdbc4.jar, and tdgssconfig.jar to a directory of your choice, <teradata_jar_files_directory>. You can download these files from the Teradata Web site at http://www.teradata.com. Make sure that the JDBC driver files you download are compatible with the database version you are using.

  2. Log in to the Administration Console for your Oracle RTD domain.

    http://weblogic_host:port/console.

  3. Navigate the path:

    Environment > Servers > managed_server_name > Configuration > Server Start tab.

  4. Add the appropriate path or paths to ClassPath, including Windows or Linux/Unix separators between entries. Do not include spaces between your entries.

    • For Teradata

      <teradata_jar_files_directory>\terajdbc4.jar

      <teradata_jar_files_directory>\tdgssconfig.jar

  5. Save.

  6. Restart the WebLogic Managed Server.

5.1.2 Creating a Data Source in WebLogic

You can use the WebLogic Server Administration Console to create a data source in WebLogic. Before you begin, ensure that WebLogic is started.

To create a data source in WebLogic:

  1. Access the WebLogic Server Administration Console for the WebLogic domain in which Oracle RTD is deployed at the URL http://weblogic_host:port/console. At the login prompt, enter the administrator user name and password.

  2. In the tree on the left, expand Services, then expand JDBC and choose Data Sources.

  3. Click New. You may need to click Lock & Edit first to enable the New button.

  4. On the JDBC Data Source Properties page, follow these steps:

    1. For Name, provide a descriptive name for the data source (for example, db_name_DS).

    2. For JNDI Name, enter the same value you provided for Name. This value will appear in Decision Studio when you perform an Import in a data source object.

    3. Set the Database Type.

      For Oracle databases, select Oracle.

      For SQL Server databases, select MS SQL Server.

      For DB2 databases, select DB2.

      For other databases, select Other.

      Click Next.

    4. Set the Database Driver.

      For Oracle databases, select Oracle's Driver (Thin) for Service connections; Versions:9.0.1,9.2.0,10,11.

      For SQL Server databases, select Oracle's MS SQL Server Driver (Type 4) Versions:7.0, 2000, 2005, 2008.

      For DB2 databases, select Oracle's DB2 Driver (Type 4) Versions:7.X,8.X,9.X.

      For other databases, select Other.

    5. Click Next.

  5. On the Transaction Options page, deselect Supports Global Transactions, then click Next.

  6. On the Connection Properties page, follow these steps:

    1. For Database Name, enter the name of your database. If you are adding an Oracle BI EE data source, enter any non-empty string; the value does not matter because this property is not used for Oracle BI EE.

    2. For Host Name, enter the name of the computer hosting the database server. If you are adding an Oracle BI EE data source, enter the name of the computer hosting Oracle BI EE.

    3. For Port, enter the port number on the database server used to connect to the database (such as 1433 for SQL Server, 1521 for Oracle Database, 50000 for DB2, or 9703 for Oracle BI EE).

    4. For Database User Name, enter the name of the database run-time user. If you are adding an Oracle BI EE data source, enter the name of an Oracle BI EE user.

    5. For Password, enter the password of the database run-time user. If you are adding an Oracle BI EE data source, enter the password of the Oracle BI EE user. Then, click Next.

  7. On the Test Database Connection page, for Driver Class Name, for Oracle, SQL Server and DB2 databases, accept all default settings. For other databases, enter the full package name of the JDBC driver class used to create the physical database connections in the connection pool (note that this driver class must be in the classpath of any server to which it is deployed):

    • Teradata: com.teradata.jdbc.TeraDriver

    • Oracle BI EE: oracle.bi.jdbc.AnaJdbcDriver

  8. For URL, for Oracle, SQL Server and DB2 databases, accept all default settings. For other databases, enter the URL of the database to which you want to connect. The format of the URL varies by data source type:

    • Teradata: jdbc:teradata://server_name/db_name/param1,param2,...

      Note:

      If db_name is missing, the current login user's default database is used. For example, with default database RTD11G, jdbc:teradata://64.181.232.117/TMODE=ANSI,CHARSET=ASCII executes as jdbc:teradata://64.181.232.117/RTD11G/TMODE=ANSI,CHARSET=ASCII
    • Oracle BI EE: jdbc:oraclebi://server_name:9703/user=bi_user_name;password=bi_password;catalog=catalog_name;

      The catalog name is optional.

  9. In the Properties field, for Oracle, SQL Server and DB2 databases, accept all default settings. For other databases, enter properties and their values required by the JDBC driver. The properties you need to provide vary by data source type:

    • For Teradata, enter the property username=db_user_name

    • For Oracle BI EE, there are no required properties. Leave the Properties field blank.

  10. Scroll to the bottom of the page. For Test Table, enter the name of an existing table in the database.

    Note:

    Do not test the connection if you are adding an Oracle BI EE or Siebel Analytics Server data source. Instead, skip to Step 12.
  11. Click Test Configuration. If the test fails, go back and check your settings. If the test succeeds, click Next.

  12. Select the server where you want the changes to be made available (for example, RTD_Server). You must perform this step before completing the data source configuration.

  13. Click Finish.

  14. Click Activate Changes.

5.1.3 Adding the New Data Source to Oracle Real-Time Decisions

After you create a data source in WebLogic, you must add the new data source to Oracle Real-Time Decisions. To do this, you must add a resource reference to the web.xml file within the ws.war and rtis.war archives, as follows:

  1. Log into the WebLogic Server Administration Console for the WebLogic domain in which Oracle RTD is deployed at the URL http://weblogic_host:port/console.

  2. In the tree to the left under Domain Structure, navigate to Deployments.

  3. Select OracleRTD under Deployments.

  4. Select Stop -> Force Stop Now.

  5. Go to the directory <Oracle_BI_directory>/bifoundation/jee, and open the rtd.ear file.

  6. Open the rtis.war archive and extract WEB_INF/web.xml, then open web.xml for editing. Scroll to the bottom of the file. Copy the section for the definition of the resource reference of SDDS_RTIS and paste it after the existing section. In the copied section, replace the string SDDS with the JNDI name you entered in Step 4 of Section 5.1.2. For example:

    <resource-ref id="jndi_name_RTIS">
      <res-ref-name>jndi_name</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>
    

    Save the changes and close the file, then re-archive the file back in rtis.war.

  7. Open the ws.war archive and extract WEB_INF/web.xml, then open web.xml for editing. Scroll to the bottom of the file. Copy the section for the definition of the resource reference for SDDS_WS and paste it after the existing section. In the copied section, replace the string SDDS with the JNDI name you entered in Step 4 of Section 5.1.2. For example:

    <resource-ref id="jndi_name_WS">
      <res-ref-name>jndi_name</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>
    

    Save the changes and close the file, then re-archive the file back in ws.war.

  8. Return to the Administration Console.

  9. In the tree to the left under Domain Structure, navigate to Deployments.

  10. Click Lock & Edit, then select the checkbox next to OracleRTD under Deployments.

  11. Select Update, and select the RTD.ear file that you have just modified.

  12. Restart OracleRTD by selecting Start -> Servicing all requests.

5.2 Testing a New Enterprise Data Source

After you add a new enterprise data source, follow the steps in this section to ensure the data source is configured properly. Before you begin, ensure that Oracle RTD is started.

To test a new enterprise data source:

  1. Start Decision Studio by running eclipse.exe in RTD_HOME\eclipse. Then, create a new Inline Service, or open an existing Inline Service. See the Decision Studio Help for more information about how to do this.

  2. Expand the Service Metadata folder, then right-click Data Sources and select New SQL Data Source.

  3. For Display Label, enter a name for the data source you want to test, then click OK.

  4. Click Import. Then, select the data source you want to test from the JDBC Data Source drop-down list. The list of Tables and Views is updated with tables and view names from that data source.

  5. Select a particular table or view, then click Finish in the Import dialog box. The list of available columns appears in the Output table in the Data Source editor.

  6. Write some basic code to ensure that the actual rows are retrieved from the tables at run time.

If you were not able to complete any of the preceding steps, check your data source configuration settings and try again.