fexp是TD卸载数据的一个脚本,文件具体内容如下:

.LOGTABLE PLOG.m4dw_qizha_test;
.LOGON IP/USER,pwd;
.BEGIN EXPORT SESSIONS 10;
.EXPORT OUTFILE  FILENAME format text mode record;

SELECT cast(TXN_DTE as char(8)),cast('||' as char(2)),
       cast(TXN_SMY_IDN_NBR as char(4)),cast('||' as char(2)),
       cast(ACT_IDN_SKY as char(16)),cast('||' as char(2)),
       cast(PTG_CRY_CDE as char(3)),cast('||' as char(2)),
       cast(JF_TXN_AMT as char(20)),cast('||' as char(2)),
       cast(DF_TXN_AMT as char(20)),cast('||' as char(2)),
       cast(TXN_DES_TXT as char(43)),cast('||' as char(2)),
       cast(HE_SUANM_MA as char(4)),cast('||' as char(2)),
       cast(CNL_IDN as char(25)),cast('||' as char(2)),
       cast(TXN_PFE_TXN_CDE as char(4)),cast('||' as char(2)),
       cast(CH_ZH_BS as char(4)),cast('||' as char(2)),
       cast(ITL_BCH_IDN as char(20)),cast('||' as char(2)),
       cast(BCH_NME as char(70)),cast('||' as char(2)),
       cast(CSR_IDN_SKY as char(20))
  from m4dw.TABLE_NAME;
.END EXPORT;            
.LOGOFF;

 需要注意的是,数据卸载下来时如果要转型需要转换为char型,不支持转换为varchar

使用方法:fexpexport.log