【问题标题】:Not to display SQLPLUS prompt不显示 SQLPLUS 提示
【发布时间】:2020-03-22 16:12:01
【问题描述】:

我正在尝试使用 bash 脚本连接 sqlplus。当我执行下面的脚本时,会显示 SQLPLUS 横幅。

脚本下方:

$ORACLE_HOME/bin/sqlplus "/ as sysdba" <<EOF
  set echo off
  set heading off
  spool bind.txt
  select * from DBMS_LOCK_ALLOCATED where name = '$uservar';
  spool off
  exit
EOF

脚本的输出

oracle@DMOTA01:~/script> ./before_bind.sh

SQL*Plus: Release 11.2.0.3.0 Production on Wed Nov 27 11:54:01 2019

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL>   2    3    4  Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@DMOTA01:~/script>

我不想显示“SQL*Plus:Release 11.............真正的应用程序测试选项”行。我该怎么做?

【问题讨论】:

    标签: linux bash oracle sqlplus display


    【解决方案1】:

    你需要将-S添加到sqlplus来切换静音模式:

    $ORACLE_HOME/bin/sqlplus -S "/ as sysdba" <<EOF
      set echo off
      set heading off
      spool bind.txt
      select * from DBMS_LOCK_ALLOCATED where name = '$uservar';
      spool off
      exit
    EOF
    

    【讨论】:

      猜你喜欢
      • 2014-05-12
      • 2021-05-19
      • 1970-01-01
      • 2016-05-02
      • 1970-01-01
      • 2016-09-05
      • 2011-04-06
      • 2019-07-14
      相关资源
      最近更新 更多