SQL*Plus: Release 11.1.0.6.0 - Production on Mon Dec 26 14:21:01 2016 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Release 11.1.0.6.0 - Production
在shell中与sqlplus交互时,这些提示信息每每会破坏数据格式。web
好比用spool导出数据的时候,不但愿显示这些提示信息。sql
好在sqlplus提供了一个静默选项,关闭全部提示信息。shell
-S[ILENT]apache
Suppresses all SQL*Plus information and prompt messages, including the command prompt, the echoing of commands, and the banner normally displayed when you start SQL*Plus. If you omit username or password, SQL*Plus prompts for them, but the prompts are not visible! Use SILENT to invoke SQL*Plus within another program so that the use of SQL*Plus is invisible to the user.bash
SILENT is a useful mode for creating reports for the web using the USQLPLS -MARKUP command inside a CGI script or operating system script. The SQL*Plus banner and prompts are suppressed and do not appear in reports created using the SILENT option.app
翻译:ide
静默选项 (-S)spa
sqlplus -S user/passwd@tns
此选项用来抑制全部SQL*Plus信息和提示信息,包含命令行提示(SQL>),命令回显信息(至关于echo off),和一般在你登录时显示的提示信息。若是你登录时省略了用户名和密码,SQL*Plus会有提示,可是在静默模式下,提示信息是看不见的。在其余程序里用静默模式调用 SQL*Plus,这个用户是看不到SQL*Plus的使用状况的。命令行
静默模式是一个很是有用的模式,例如在CGI脚本或者shell脚本里,用SQLPLUS 的MARKUP命令选项来建立基于web的报告。 SQL*Plus的欢迎信息和提示信息被移除,就不会显示在用静默选项建立的报告里了。翻译
补充:
When SQL*Plus starts, and after CONNECT commands, the site profile
(e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile
(e.g. login.sql in the working directory) are run. The files may
contain SQL*Plus commands.
当 SQL*Plus启动的时候,在connect命令以后,系统配置文件(例如:e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql)和用户配置文件(例如:工做目录下的login.sql)会自动运行。这些文件里可能会包含一些命令。