Configuring Oracle as backend database for Hue

You can configure Oracle as the backend database for Hue after you have downloaded, distributed, activated the Oracle Instant Client parcel either using Oracle Service Name or SID.

  1. Log into Cloudera Manager as an Administrator.
  2. Go to Clusters > Hue service > Configuration > Category > Database.
    All the database configurations for Hue are displayed.
  3. Select Oracle as the Hue Database Type.
  4. Specify the host on which you have installed the Oracle database in the Hue Database Hostname field.
  5. Enter 1521 in the Hue Database Port field.
  6. Enter user name and password in Hue Database Username and Hue Database Password fields.
  7. Specify the database name in the Hue Database Name field.
    If you are using Oracle Service Name instead of SID, then specify the database name in the following format:
    [***HUE-DB-HOST***]:1521/[***SERVICE-NAME***]
    You can also configure additional parameters by entering the following in the Hue Database Name field:
    (DESCRIPTION=(LOAD_BALANCE=off)(FAILOVER=on)(CONNECT_TIMEOUT=5)(TRANSPORT_CONNECT_TIMEOUT=3)(RETRY_COUNT=3)(ADDRESS=(PROTOCOL=TCP)(HOST=[***HUE-DB-HOST***])(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=[***SERVICE-NAME***])))
  8. Go to Clusters > Hue service > Configuration > Hue Service Environment Advanced Configuration Snippet (Safety Valve) and add the following parameters:
    Key: LD_LIBRARY_PATH
    Value: /opt/cloudera/parcels/ORACLE_INSTANT_CLIENT/[***INSTANT-CLIENT-WITH-VERSION***]
    Key: ORACLE_HOME
    Value: /opt/cloudera/parcels/ORACLE_INSTANT_CLIENT/[***INSTANT-CLIENT-WITH-VERSION***]
    For example: /opt/cloudera/parcels/ORACLE_INSTANT_CLIENT/instantclient_12_2
    You can obtain the value of the Instant Client version by running the following command from the Cloudera Manager server terminal /opt/cloudera/parcels/ directory:
    ls -al ORACLE_INSTANT_CLIENT/
    If you have manually set the values for LD_LIBRARY_PATH and ORACLE_HOME, then specify those.
  9. Add support for a multi-threaded environment by adding the following lines in the Hue Service Environment Advanced Configuration Snippet (Safety Valve) field under the [desktop] section:
    [desktop]
    [[database]]
    options={"threaded":true}
    A multi-threaded environment is recommended for using the Oracle database.
    If you are using Oracle Service Name instead of SID, then add the following line under the [desktop] section in the Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini field:
    [desktop]
    [[database]]
    port=0
  10. Click Save Changes and restart the Hue service.
If the database setup is successful and Hue starts without errors, then you should be able to log into the Hue web interface and view the database/tables.