我们知道,sqlplus中使用@或者@@可以直接脚本中的sql语句,但一般情况下执行本地脚本。实际上sqlplus也可以通过http执行远程服务器上的脚本。
C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 16 00:06:37 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
@>conn ning/ning@10g
Connected.
NING@10g>@http://10.0.12.102/test.sql
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
NING@10g>conn ning/ning@11g
Connected.
NING@11g>@http://10.0.12.102/test.sql
BANNER
---------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 16 00:06:37 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
@>conn ning/ning@10g
Connected.
NING@10g>@http://10.0.12.102/test.sql
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
NING@10g>conn ning/ning@11g
Connected.
NING@11g>@http://10.0.12.102/test.sql
BANNER
---------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
有了这个特性,我们就可以将一些常用的脚本集中存放在一台server上,并且开启http服务,就可以在网络中的任何机器上调用这些脚本来方便我们的工作了。
