SQLplus参数
每个人! 我想知道这条线的作用:
sqlplus -s /nolog <<EOF
有什么想法吗? 感谢您的帮助!
everyone!
I want to know what this line does:
sqlplus -s /nolog <<EOF
Any ideas?
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据您在评论中提供的信息:
启动启用静默模式的
sqlplus
实例(我相信,它不会将任何输出发送到控制台screen),并且没有显式提供登录(因此是/nolog
),并且它从EOF
此处文档中包含的字符串(可能包含登录凭据)获取输入。此处是 Oracle 关于
sqlplus
的文档的快速概述。From the information that you provided in the comments:
Fires up an instance of
sqlplus
with silent mode enabled (which, I believe, doesn't send out any output to the console screen), and without a login explicitly provided (hence the/nolog
), and it's taking input from the string contained in theEOF
heredoc (which probably contains login credentials).Here is a quick overview of Oracle's documentation on
sqlplus
.从此处:
-s
静默选项:它抑制 SQL*Plus 标语、命令提示符和命令回显的输出。/nolog
启动 SQL*Plus 但不登录(连接)用户/会话。所以看起来启动 SQL*PLUS 时无需登录用户/会话(nolog 选项)并且不显示信息(silent 选项)。
From HERE:
-s
The silent option: it suppreses the output of the SQL*Plus banner, the command prompt and the echoing of commands./nolog
Starts SQL*Plus but does not log on (connect) a user/session.So it seems that starts SQL*PLUS without logging on a user/session (nolog option) and don't display info (silent option).
完整摘录可能应该是:
这类似于运行 sqlplus -s user/pwd@database @script.sql ,其中 script.sql 包含 sql、plsql 内容和退出命令。
<<
语法是heredoc的shell运算符,这意味着如果找到${variables},则所有后续行都将进行变量扩展,并且第一行以ABCDE
开头(在行的最开始,没有空格,没有制表符)结束输入。The full excerpt should probably be:
Which is similar to running
sqlplus -s user/pwd@database @script.sql
wherescript.sql
contains the sql, plsql stuff and the exit command. The<<
syntax is shell operator for heredoc, which means all following lines are variable-expanded if ${variables} are found, and the first line beginning withABCDE
(at the very beginning of the line, no spaces, no tabs) ends the input.