我正在使用Hortonworks Sandbox 2.2 VM,并且在针对oracle运行Sqoop时遇到问题。我正在执行命令,如:
sqoop list-tables --connect jdbc:oracle:thin:@mydbhost.com:1521/sid --username user --password password
它执行,但没有任何反应:
Warning: /usr/hdp/2.2.4.2-2/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
15/05/29 15:55:58 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5.2.2.4.2-2
15/05/29 15:55:58 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
15/05/29 15:55:58 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.
15/05/29 15:55:58 INFO manager.SqlManager: Using default fetchSize of 1000
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.2.4.2-2/hadoop/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.2.4.2-2/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.2.4.2-2/hive/lib/hive-jdbc-0.14.0.2.2.4.2-2-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
15/05/29 15:55:59 INFO manager.OracleManager: Time zone has been set to GMT
如果我指定--driver oracle.jdbc.OracleDriver作为参数,那么list-tables命令工作正常,但导入失败并显示错误“ORA-00933:SQL命令未正确结束”。我在几个地方读到指定--driver参数不是正确的方法,但是当我没有指定它时,我无法得到任何工作。
我在这里做错了什么?
答案 0 :(得分:0)
尝试以下步骤 1.将ojdbc6.jar放在$ SQOOP_HOME / lib中 2.删除了--driver选项 3.引用所有参数
答案 1 :(得分:0)
除了@gopikrishna_BD anwser之外,Oracle db还通过defalut以大写形式存储表名。因此,在执行sqoop导入时,请以大写形式提供表名。您还应该以大写形式提供数据库名称。
这个article将帮助您了解有关Sqoop with Oracle的更多信息。