Administering Ambari
Also available as:
PDF
loading table of contents...

Using Hive with Oracle

Before using Hive with a new or existing Oracle database; obtain the appropriate driver and .jar files, and create a Hive user with sufficient permissions.

Determine the appropriate Oracle database version and obtain the release drivers and .jar file.
Table 1. Oracle Datbase Version Information
Oracle Database Version Drivers File
Oracle Database 11g Oracle Database 11g Release 2 drivers ojdbc6.jar
Oracle Database 12c Oracle Database 12c Release 1 drivers ojdbc7.jar
  1. On the Ambari Server host, stage the appropriate JDBC driver file for later deployment.
    1. Download the Oracle JDBC (OJDBC) driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
    2. Make sure the .jar file has the appropriate permissions.
      chmod 644 ojdbc7.jar
    3. Add the path to the downloaded .jar file.
      ambari-server setup --jdbc-db=oracle --jdbc-driver=/path/to/downloaded/ojdbc7.jar
  2. Create a user for Hive and grant it permissions.
    using the Oracle database admin utility:
    # sqlplus sys/root as sysdba
    CREATE USER [HIVE_USER] IDENTIFIED BY [HIVE_PASSWORD];
    GRANT SELECT_CATALOG_ROLE TO [HIVE_USER];
    GRANT CONNECT, RESOURCE TO [HIVE_USER];
    QUIT;
    Where [HIVE_USER] is the Hive user name and [HIVE_PASSWORD] is the Hive user password.