当前位置:   article > 正文

sh调取sqoop脚本每天增量跑数据 从hadoop到关系型数据库_sqoop一天增量

sqoop一天增量

sh中调取sqoop每天增量懂啊关系型数据库中,看看吧



#!/bin/bash

source ~/.bashrc
set -x

DAY=`date  -d "$1 days ago" +%y-%m-%d`
DAYI=`date -d "$1 days ago" +%Y%m%d`
APPHOME="/opt/pig_home/bshare_etl/hdetl/app/pv_placement/"
PROG=`basename $0`
MAIL="dba@i-click.com"
EXPORT="/shortdata/pv_placement/15-10-01"
USER="xmo_summarizer"
PWD="YCt452uz"
URL="jdbc:postgresql://10.1.1.230:5432/xmo_dw"


sqoop eval --connect ${URL} --username ${USER} --password ${PWD} -e "delete from bshare_placement where date_i=${DAY}"

sqoop export --connect ${URL} --username ${USER} --password ${PWD} --export-dir ${EXPORT} --table bshare_placement --fields-terminated-by '\001' --input-null-non-string '\\N' --input-null-string '\\N' --columns date_i,adx,city,province,placement_id,pv -- --schema xmo_dw


#sqoop export --connect 'jdbc:postgresql://10.1.1.230:5432/xmo_dw' --username 'mo_summarizer' --password 'YCt452uz' --export-dir '/shortdata/pv_placement/15-10-01' --table bshare_placement --fields-terminated-by '\001' --input-null-non-string '\\N' --input-null-string '\\N' --columns date_i,adx,city,province,placement_id,pv -- --schema xmo_dw
sqoop list-databases --connect "jdbc:postgresql://10.1.1.230:5432/xmo_dw" --username 'xmo_summarizer' --password 'YCt452uz'


声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号