Using Hive with Oracle

Before setting up Hive with an existing Oracle database, obtain the appropriate drivers and .jar files, create an hive user with sufficient permissions, and load the hive database schema.

Determine the appropriate Oracle database version and obtain the release drivers and .jar file.

Oracle Database VersionDriversFile
Oracle Database 19cOracle Database 19c driversojdbc11.jar

Steps:

  1. Install the appropriate JDBC .jar file on the Oracle host.

    1. Download the Oracle JDBC (OJDBC) driver from JDBC and UCP Downloads page .

      1. For Oracle Database 19C: select Oracle Database 23ai (23.8.0.25.04) JDBC Driver > ojdbc11.jar.
    2. Copy the .jar file to the Java share directory.

Bash
Copy

Make sure the .jar file has the appropriate permissions. For example:

Bash
Copy
  1. Create the Hive databases using the Oracle database administrator. You can use the following series of commands to create a hive user and grant permissions using SQL*Plus.

ORCLPDB1 refers to the Pluggable Database (PDB) within the multi-tenant Oracle Container Database (CDB) named ORCLCDB, introduced in Oracle 12c. Any operations, such as creating or dropping tablespaces, within this context, apply specifically to the ORCLPDB1 PDB.

Bash
Copy
  1. Set the jdbc/driver/path based on the location of the Oracle JDBC driver .jar file. This command must be run on the server where Ambari server is installed: ambari-server setup --jdbc-db={database-type} --jdbc-driver={/jdbc/driver/path}.
Bash
Copy
  1. Start the Hive installation.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated