shell调用存储过程

#!/bin/bash

. $HOME/.bash_profile

export logpath=/echnweb/logs/market/pushsession/

 

echo "***************************begin*******************************">>${logpath}/push_session_remove.`date '+%Y%m%d'`

 

sqlplus -s echnmarket/echnmarket@publicdb << !  >>${logpath}/push_session_remove.`date '+%Y%m%d'`

set serverout on

declare

begin

    dbms_output.put_line(' ');

    dbms_output.put_line(to_char(sysdate,'HH24:MI:SS')||'change refresh begin.....');

    Proc_push_session_remove;

    dbms_output.put_line(to_char(sysdate,'HH24:MI:SS')||'change refresh end.....');

    exception when others then

    dbms_output.put_line(to_char(sysdate,'HH24:MI:SS')||'change all refresh faile : SQLCODE '|| SQLCODE||' SQLERRM:'||SQLERRM); 

 

end;

/

exit

!

echo "*******************************end***************************">>${logpath}/push_session_remove.`date '+%Y%m%d'`

 

你可能感兴趣的:(shell)