用sqoop 把oracle表迁移到hive 上怎么处理字段类型不一样
1个回答
2016-12-29 · 知道合伙人互联网行家
关注
展开全部
[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;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询