脚本一则:linux shell中调用sqlplus 提取库数据,并生成文件格式数据输出 [******@BSSP-GATEWAY1 ~]$ more #!/bin/sh CHONGYIN_LOG=/home/oracle/ echo >> $CHONGYIN_LOG chmod 666 $CHONGYIN_LOG echo Script $0 >> $CHONGYIN_LOG echo ==== started on `date` ==== >> $CHONGYIN_LOG echo >> $CHONGYIN_LOG sqlplus -S "race/******@actdb" <<contents >/dev/null set echo off set feedback off set linesize 3000 set pagesize 0 set sqlprompt '' set trimspool on set numf '' spool /runway/ftp/wanluochongyin/chongyin_1423758_`date +"%Y-%m-%d"`.txt select ||','||||','||||','|| to_char((NEW_TIME(DATE'1970-01-01' + ,'PST','GMT') ),'yyyy-mm-dd hh24:mi:ss') from subscribecontent_t s where (=1 or =2) and ='1423758' union select ||','||||','|| to_char((NEW_TIME(DATE'1970-01-01' + ,'PST','GMT') ),'yyyy-mm-dd hh24:mi:ss')