背景:常用加载与导出语句,与其他数据库基本无差,mark下
脚本里的sql执行
`cat /opt/script/gbase/gbase.txt` -Dstg_noas -vvv -f</opt/script/temp/test.sql
用户密码通常写在gbase.txt中
加载:
load data infile 'ftp://user:pwd@ip/dir/*.gz'
into table table_name
FIELDS TERMINATED BY '|' ENCLOSED BY '"'
autofill
LINES TERMINATED BY '\n';
导出:
select * from table_name
into outfile '/opt/script/temp/1111.txt'
FIELDS TERMINATED BY '\t'