Sqoop and the misleading Oracle errors

I ran into a misleading error from the Oracle JDBC driver while using Sqoop. The configuration was Sqoop 1.4.6 using ojdbc7.jar and connecting to Oracle. JDK 8 support was a must.I wasn’t sure of the Oracle version number so I used the most current JDBC driver version. The command:

sqoop list-tables --connect oracle.jdbc.driver:@oracle_host_name:1521:oracle_SID --username xxx --password

would fail with an odd error.

ERROR manager.SqlManager: Error reading database metadata: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-01882: timezone region not found

Adding the following options for setting any timezone properties, prior to –connect, did not help.
-Duser.timezone="EST" -Doracle.session.TimeZone='America/New York'

The next variable to consider was the database driver. I downloaded a different version of the driver that is for 11G. I then removed the options for the timezone properties and ran the test agin. Success! It was all about the Oracle version AND the driver.

Backward compatibility for the Oracle JDBC driver seems to be a bit overrated ¯\_(ツ)_/¯

Oracle 11g R2: ojdbc6.jar – Supports JDK 6, 7, and 8 (JDK 8 support is kinda recent)
Oracle 12c R1: ojdbc7.jar – Supports JDK 7 and 8

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>