linux下db2、oracle、hive过程调用数据的导入导出

db2:

db2 connect to database user username using pwd

db2 "CALL schema.procedure('入参',?,?)" > albert.log;

db2 load client from /table.del of del modified by anyorder CODEPAGE=1208 coldel0x01  insert into tablename nonrecoverable CPU_PARALLELISM 1 DISK_PARALLELISM 1 lock with force;

db2 "export to /table.del OF del MODIFIED BY COLDEL0X01 CODEPAGE =1208 NOCHARDEL DECPLUSBLANK STRIPLZEROS select trim(char(TIMEST)),trim(char(LD_DAY_USER)) from tablename with ur"

####db2编码格式多用1208、1386,0X01为分隔符,/table.del入库出库的文件名称路径位置这里是根目录。

db2 commits
db2 terminate

 

oracle:

sqlplus username/userpwd@tnsdatabase< execute schema.procedure('入参',?,?);
exit;
!

oracle导入参考“将hive中的某张表的数据导入oracle的某张表中”https://blog.csdn.net/Albert0510/article/details/81206329

oracle导出参考https://www.cnblogs.com/huacw/p/3888807.html

 

Hive:

hive导入:先将导入文件上传到hdfs文件系统,然后通过load入库

hdfs dfs -put UPARAM.TD_LLB_PRODUCT.del /user/appuser_asjf/data

  load data inpath '/user/appuser_asjf/data/UPARAM.TD_LLB_PRODUCT.del' into table UPARAM.TD_LLB_PRODUCT PARTITION(stat_cycle='20190228');
hive导出:https://blog.csdn.net/Albert0510/article/details/81206329

 

你可能感兴趣的:(db2—hive数据迁移)