基本的shell文件结构如下:
sqlplus user/password <<!
exec proc_name;
exit
!
Demo
procedure name: sp_ems_hasten_count(v_oper_date in varchar2)
.sh file : execpro.sh
[oracle@localhost tmp]$ cat -v execpro.sh
sqlplus post_kf/post_kf << !
exec sp_ems_hasten_count('20090415');
exit
!
select count(1) from ems_hasten_count;
COUNT(1) |
---|
0
|
[oracle@localhost tmp]$ ./execpro.sh
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 4月 27 13:33:28 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
select count(1) from ems_hasten_count;
COUNT(1) |
---|
18531
|