通过 Hortonworks Sandbox 上的 sqoop 连接到 Oracle
Connect to Oracle via sqoop on Hortonworks Sandbox
我目前正在使用 Hortonworks Sandbox(在他们的网站上下载),我想 运行 sqoop 连接到我的 Oracle 数据库并检索信息。
我已经完成的步骤:
- 安装 sqoop -> 确定
- Ping 我的数据库服务器 -> 确定
- 下载 Oracle 驱动程序 ojdbc6.jar -> 确定
- 将 Oracle 驱动程序 ojdbc6.jar 放入 /usr/lib/sqoop/lib -> OK
- 运行
sqoop import --connect "jdbc:oracle:thin:readonly/readonly@//unixatd:1521:P1AX" --table DUAL
-> 确定
我收到以下消息:
15/06/16 04:25:01 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5.2.2.4.2-2
15/06/16 04:25:01 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
15/06/16 04:25:01 INFO manager.SqlManager: Using default fetchSize of 1000
15/06/16 04:25:01 INFO tool.CodeGenTool: Beginning code generation
15/06/16 04:25:01 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.driver.oracledriver
java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.driver.oracledriver
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:848)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:736)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:759)
at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:269)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:240)
at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:226)
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295)
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1773)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1578)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:601)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
从那里开始,我只是不知道下一步该做什么。
如果你能给我一些我可以检查的信息,那就太好了。
我目前正在使用 Hortonworks Sandbox(在他们的网站上下载),我想 运行 sqoop 连接到我的 Oracle 数据库并检索信息。
我已经完成的步骤:
- 安装 sqoop -> 确定
- Ping 我的数据库服务器 -> 确定
- 下载 Oracle 驱动程序 ojdbc6.jar -> 确定
- 将 Oracle 驱动程序 ojdbc6.jar 放入 /usr/lib/sqoop/lib -> OK
- 运行
sqoop import --connect "jdbc:oracle:thin:readonly/readonly@//unixatd:1521:P1AX" --table DUAL
-> 确定
我收到以下消息:
15/06/16 04:25:01 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5.2.2.4.2-2
15/06/16 04:25:01 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
15/06/16 04:25:01 INFO manager.SqlManager: Using default fetchSize of 1000
15/06/16 04:25:01 INFO tool.CodeGenTool: Beginning code generation
15/06/16 04:25:01 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.driver.oracledriver
java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.driver.oracledriver
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:848)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:736)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:759)
at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:269)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:240)
at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:226)
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295)
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1773)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1578)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:601)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
从那里开始,我只是不知道下一步该做什么。 如果你能给我一些我可以检查的信息,那就太好了。