Support Questions

Find answers, ask questions, and share your expertise

Who agreed with this topic

Use sqoop to import Oracle table to HFDS. Oracle JDBC jar is not installed to $SQOOP_HOME/lib

avatar
New Contributor

I want to run sqoop to import Oracle to HDFS. Our default CDH deployment does not have Oracle JDBC driver. So I downloaded the driver and saved  to my home directory on CDH proxy server. I tried to run sqoop using --libjars to use the driver, but it was not working. Can you advise how to get this working?

 

sqoop import  --libjars <my dir>/ojdbc6.jar --connect jdbc:oracle:thin:@//<host>:8526/<SID> --table pstobj2 --username <username> --password <pass> --target-dir <dir path>/table_name
13/09/12 16:42:38 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
13/09/12 16:42:38 INFO manager.SqlManager: Using default fetchSize of 1000
13/09/12 16:42:38 INFO tool.CodeGenTool: Beginning code generation
13/09/12 16:42:38 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.OracleDriver
java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.OracleDriver
        at org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:275)
        at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:525)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:548)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:191)
        at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:175)
        at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:262)
        at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1236)
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1061)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

 

Who agreed with this topic