oracle/hive数据互导
2016-07-18 00:00
274 查看
Oracle -> hive
1.导出数据
sqluldr2.bin safe=yes user=ods/123456@TESTDB query="SELECT code,name,sex,test,department,month_id,day_id from ods.student where month_id='201509' and day_id='02'; " log="/home/hadoop/pu_test/student_20150902.log" field=0x01 ncharset="CHINESE_CHINA.ZHS16GBK" charset="UTF8" file="/home/hadoop/pu_test/student_20150902.txt"
2.导入数据
hive -e "use ods;load data local inpath '/home/hadoop/pu_test/student_20150902.txt' overwrite into table ODS.student partition (monthid='201509',dayid='02') ;"
Hive -> oracle
1.导出数据
hive -e "select * from student" >> local/student.txt
2.编写控制文件
Insert.ctl:
load data
infile 'd:\zzz\student.txt'
append into table student
fields terminated by ','
(code,name,sex,test,department)
3.导入数据
sqlldr psbc/psbc control=/opt/impora/ Insert.ctl direct=true parallel=true
1.导出数据
sqluldr2.bin safe=yes user=ods/123456@TESTDB query="SELECT code,name,sex,test,department,month_id,day_id from ods.student where month_id='201509' and day_id='02'; " log="/home/hadoop/pu_test/student_20150902.log" field=0x01 ncharset="CHINESE_CHINA.ZHS16GBK" charset="UTF8" file="/home/hadoop/pu_test/student_20150902.txt"
2.导入数据
hive -e "use ods;load data local inpath '/home/hadoop/pu_test/student_20150902.txt' overwrite into table ODS.student partition (monthid='201509',dayid='02') ;"
Hive -> oracle
1.导出数据
hive -e "select * from student" >> local/student.txt
2.编写控制文件
Insert.ctl:
load data
infile 'd:\zzz\student.txt'
append into table student
fields terminated by ','
(code,name,sex,test,department)
3.导入数据
sqlldr psbc/psbc control=/opt/impora/ Insert.ctl direct=true parallel=true
相关文章推荐
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- Oracle Containers for J2EE远程安全漏洞(CVE-2014-0413)
- 分享Hive的一份胶片资料
- Oracle 10g R2不能使用EM的问题
- 表空间操作
- PreparedStatement中in子句的处理
- VMware下RedHat4.8_64位安装Oracle 10g RAC--简略脚本
- oracle sql日期比较
- 基于 Red Hat 的发行版 Oracle Linux 正式发布Oracle Linux 7.1
- Hadoop生态上几个技术的关系与区别:hive、pig、hbase 关系与区别
- OS block size和Oracle block size,查找OS Blocksize的方法
- oracle中创建数据库和表空间的几点总结
- 数据库自动备份脚本
- oracle的nvl函数的使用介绍
- 解决oracle用户连接失败的解决方法
- oracle的一些tips技巧
- Oracle 下的开发日积月累
- Oracle存储过程之数据库中获取数据实例
- Windows下ORACLE 10g完全卸载的方法分析