ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【DBA脚本】显示当前用户名

【DBA脚本】显示当前用户名

原创 Linux操作系统 作者:chicheng_cn421 时间:2011-12-17 21:58:38 0 删除 编辑


SQLPLUS是DBA们最常使用的工具,我们这篇来看一下如何查看当前用户名,这个是一个sqlplus命令。

SQL> show user
----------------------
例子1:
C:\>sqlplus scott/tiger@chic

SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 12月 17 22:01:48 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> show user
USER 为 "SCOTT"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

例子2:
C:\>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 12月 17 22:02:35 2011

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


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> show user
USER 为 "SYS"                          ---这个地方我们看到,当使用OS认证方式时,连接用户为SYS用户
SQL>
SQL>
----------------------

以上。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20335819/viewspace-713506/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-05

  • 博文量
    261
  • 访问量
    417489