所以我几天前使用sqoop将数据从oracle数据库导入hadoop集群。
今天当我尝试进行sqoop导入时,出现以下错误:
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.SqlManager.makeConnection(SqlManager.java:727)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:615)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:638)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:237)
at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:221)
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:283)
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1268)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1080)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
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)
No encryption was performed by peer.
由于某种原因,司机不能正常工作。
我尝试告诉sqoop驱动程序在import命令中使用-libjars选项。这没用。
也许我的驱动程序文件已损坏?
此致 P上。
答案 0 :(得分:0)
您使用了错误的oracle驱动程序类。使用Oracle驱动程序类“oracle.jdbc.driver.OracleDriver”。或者,您也可以在sqoop_home / lib中复制oracle jdbc驱动程序。
答案 1 :(得分:0)
这是软件更新的问题。驱动程序的位置被移动了。它的工作正常。
答案 2 :(得分:0)
尝试以下参数
--driver oracle.jdbc.driver.OracleDriver