Using Hive with Oracle
To set up Oracle for use with Hive:
On the Ambari Server host, stage the appropriate JDBC driver file for later deployment.
Download the Oracle JDBC (OJDBC) driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
For Oracle Database 11g: select
Oracle Database 11g Release 2 drivers > ojdbc6.jar
.For Oracle Database 12c: select
Oracle Database 12c Release 1 drivers > ojdbc7.jar
.Make sure the .jar file has the appropriate permissions. For example:
chmod 644 ojdbc7.jar
Execute the following command, adding the path to the downloaded .jar file:
ambari-server setup --jdbc-db=oracle --jdbc-driver=/path/to/downloaded/ojdbc7.jar
Create a user for Hive and grant it permissions.
Using the Oracle database admin utility:
# sqlplus sys/root as sysdba
CREATE USER <HIVEUSER> IDENTIFIED BY <HIVEPASSWORD>;
GRANT SELECT_CATALOG_ROLE TO <HIVEUSER>;
GRANT CONNECT, RESOURCE TO <HIVEUSER>;
QUIT;
Where <HIVEUSER> is the Hive user name and <HIVEPASSWORD> is the Hive user password.