用sqoop 把oracle表迁移到hive 上怎么处理字段类型不一样
2个回答
2015-12-10 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517196
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
[Steps]
1. Install oracle 11g for 32bit on a windows 32bit vm (windows server 2003)
see <在Windows Server 2003 32bit 中安装Oracle 11g 32bit>: http://blog.csdn.net/mozart_cai/article/details/8596352
2. Configure local listener(本地监听服务) in oracle Net Manager, add a listener
see <通过Net Manager 配置Oracle 11g本地监听服务(listener service)>: http://blog.csdn.net/mozart_cai/article/details/8596504
3. Load Oracle table to Hive table via Sqoop
In Oracle SQL Plus, check all tables owned by current user
SQL> select unique tname from col;
We choose table "DEPT" to migrate.
In cluster node
$ hive
$ show tables;
$ quit;
$ sqoop import --connect jdbc:oracle:thin:@IPAddressOfNodeInstallOracle:1521:orcl --username SCOTT --password 123456 --table DEPT -m 1 --hive-import --hive-table "HIVETEST"
NOTICE: IPAddressOfNodeInstallOracle is for windows run oracle(ex: 172.16.3.4); username and password are configured in oracle;tablename and username should be upper case
$ show tables;
$ select * from hivetest;
1. Install oracle 11g for 32bit on a windows 32bit vm (windows server 2003)
see <在Windows Server 2003 32bit 中安装Oracle 11g 32bit>: http://blog.csdn.net/mozart_cai/article/details/8596352
2. Configure local listener(本地监听服务) in oracle Net Manager, add a listener
see <通过Net Manager 配置Oracle 11g本地监听服务(listener service)>: http://blog.csdn.net/mozart_cai/article/details/8596504
3. Load Oracle table to Hive table via Sqoop
In Oracle SQL Plus, check all tables owned by current user
SQL> select unique tname from col;
We choose table "DEPT" to migrate.
In cluster node
$ hive
$ show tables;
$ quit;
$ sqoop import --connect jdbc:oracle:thin:@IPAddressOfNodeInstallOracle:1521:orcl --username SCOTT --password 123456 --table DEPT -m 1 --hive-import --hive-table "HIVETEST"
NOTICE: IPAddressOfNodeInstallOracle is for windows run oracle(ex: 172.16.3.4); username and password are configured in oracle;tablename and username should be upper case
$ show tables;
$ select * from hivetest;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询