linux 後臺執行sql指令碼

xulongxc發表於2014-07-03

cat tmp_xf_fb.sh
#!/bin/sh

export ORACLE_SID=newcrm
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2
export PATH=$HOME/bin:$ORACLE_HOME/bin:/sbin:/bin:/usr/sbin:$PATH
export ORACLE_TERM=xterm
export NLS_LANG="AMERICAN_AMERICA.zhs16gbk"
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export LD_ASSUME_KERNEL=2.4.19 
#. /home/oracle/.bashrc

date
$ORACLE_HOME/bin/sqlplus -S fbadmin/fbadmin < @/home/oracle/worksh/tmp_xf_fb.sql $1
exit;
EOF
date

------------------

[oracle@crmtest worksh]$ nohup ./tmp_xf_fb.sh 0 &
[1] 10683
[oracle@crmtest worksh]$ nohup: appending output to `nohup.out'

[oracle@crmtest worksh]$ jobs
[1]+ Running                 nohup ./tmp_xf_fb.sh 0 &
[oracle@crmtest worksh]$ jobs
[1]+ Done                    nohup ./tmp_xf_fb.sh 0

------nohup.out

Wed Sep 24 10:12:59 CST 2008
old   1: call fbadmin.SP_FEEDBACK_ALLSUM_DB1(&1)
new   1: call fbadmin.SP_FEEDBACK_ALLSUM_DB1(0)

Call completed.

Wed Sep 24 10:13:07 CST 2008

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29440247/viewspace-1208338/,如需轉載,請註明出處,否則將追究法律責任。

相關文章