参数一为传过来的事实表名称,用于构建查询sql
参数二为指定导出文件格式
参数三为数据集名称,用于定义文件名
#!/bin/bash
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"factName=$1
format=$2
cubeName=$3
OUT_DIR='/data/evap/download/data'
OUT_FILENAME=${cubeName}'.'${format}
GCCLI=/disp_app/gcluster/server/bin/gbase
gbase_node=134.160.36.230
db_username='evap_db'
db_con_user='evap'
db_con_pwd='Of0#QY'
FIELDS='|'
ESCAPED_BY=''
LINES='\r\n'
if [ -f "${OUT_DIR}/${OUT_FILENAME}" ]; then
rm -rf ${OUT_DIR}/${OUT_FILENAME}
fi
export GCLUSTER_BASE=/disp_app/gcluster
export GCLUSTER_HOME=${GCLUSTER_BASE}/server
export GCLUSTER_SID=gcluster
export