我有一个脚本,我想维护作为一个单一的文件,但我希望呼应命令输入到sqlplus而不使用PROMPT <sql>
或@script.sql
可以这样做吗?回声sqlplus命令不使用提示或脚本
当前脚本:
$ cat test.sh
#!/bin/bash
LOG=/home/oracle/output.log
sqlplus hr/hr <<EOF > $LOG
set echo on
select 1 from dual;
QUIT
EOF`
电流输出:
$ cat output.log
SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 1 15:01:12 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> SQL>
1
----------
1
我想要什么:
$ cat output.log
SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 1 15:02:02 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> SQL> SQL> select 1 from dual;
1
----------
1
尝试:在 – MaxU
设置项试过了,它并不能工作。 –
你特别想要横幅 - 所以假脱机不是一个选项?并且不允许创建临时脚本? –