环境:CentOS 6.3, hive-0.9.0-cdh4.1.2, Oracle database 11g
1. 首先将ojdbc.jar文件拷贝到/u01/cloudera/parcels/CDH/lib/sqoop/lib目录下
2. 启动命令:
sqoop export –connect jdbc:oracle:thin:@xxx:1521:biprod –username sqoop_user –password sqoop_user –table OS_ZHIXIN_CHG –export-dir /tmp/zhixin_chg/20140911/20140911charge.zhixin2.log
执行语句:sqoop import –connect jdbc:oracle:thin:@m1-ite-erp-bidev01.m1:8521:biprod –username ahmt –password haddmt –table FCT_PROX_HMT –hive-import -m 1
导数的时候出错: ERROR tool.ImportTool: Imported Failed: Attempted to generate class with no columns!
经排查,问题出在 –username ahmt 这个选项, 需要把用户名大写, –username AHMT, 同时注意表名也要大写