SQL*Plus Command -- host

语法:HO[ST] [command]

功能:在SQL*Plus中执行操作系统命令。

如果单独执行host命令,则会进入操作系统提示符界面,这时可以多次执行操作系统命令,再次执行exit命令则会退回到SQL*Plus界面。

与host命令有同样功能的符号为$(windows环境)、!(unix环境)。

SQL> host  date
Thu Aug 15 17:39:45 CST 2019

SQL> !  who
root     pts/0        2019-08-15 17:13 (1.1.1.1)

SQL> host
[oracle@17:40:34]$ date
Thu Aug 15 17:40:42 CST 2019
[oracle@17:40:42]$ exit
exit

SQL>

Usage
In some operating systems, you can use a character in place of HOST such as "$" in
Windows or "!" in UNIX, or you may not have access to the HOST command. See the
platform-specific Oracle documentation provided for your operating system or ask your
DBA for more information.
On some platforms, an _RC substitution variable may be created with a HOST return
value that is operation system dependent. It is recommended that you do not use the
_RC substitution variable in scripts as it is not portable.
SQL*Plus removes the SQLTERMINATOR (a semicolon by default) before the HOST
command is issued. A workaround for this is to add another SQLTERMINATOR. See 
SET SQLT[ERMINATOR] {; | c | ON | OFF} for more information.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值