error manager.sqlmanager:执行语句时出错:java.sql.sqlexception:指定的oracle url无效

bnlyeluc  于 2021-06-03  发布在  Sqoop
关注(0)|答案(1)|浏览(991)

当我尝试使用以下语法将数据从oracle导入hdfs时:

./sqoop import --connect jdbc:oracle:thin://@XX.XX.XX.XX:1521:orcl --username orcluser -P --table TABLE --target-dir /datadir -m 1

然后我得到:

18/12/04 16:24:26 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
18/12/04 16:24:26 INFO manager.SqlManager: Using default fetchSize of 1000
18/12/04 16:24:27 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
    at org.apache.sqoop.manager.OracleManager.listTables(OracleManager.java:769)
    at org.apache.sqoop.tool.ListTablesTool.run(ListTablesTool.java:49)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

我已经检查了sqoop lib文件夹中的防火墙和ojdbc8.jar oracle连接器。ping ipadress也很管用。谢谢任何能帮我解决问题的人。我试过我能做的任何事,但什么好事都没发生。

6qqygrtg

6qqygrtg1#

您得到的错误表明没有与oracle数据库建立连接。很可能是因为运行sqoop客户机的计算机无法解析数据库主机名,或者--connect url的格式不正确。请从连接url字符串中删除“//”。

./sqoop import --connect jdbc:oracle:thin:@XX.XX.XX.XX:1521:orcl --username orcluser -P --table TABLE --target-dir /datadir -m 1

相关问题