命令行配合sqlplus管理Oracle
不多说,直接上代码:
首先准备一个简单的SQL文件:
[ora11g@mailserver ~]$ cat query.sql
select &1 from &2; exit
开始调用:
[ora11g@mailserver ~]$ sqlplus -S / as sysdba @query.sql "sysdate" "dual"
old 1: select &1 from &2 new 1: select sysdate from dual
SYSDATE ------------------- 2010-05-07 11:10:54 Elapsed: 00:00:00.00