首页 > Linux操作系统 > Linux操作系统 > 【DBA脚本】显示当前用户名
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/ ,如需转载,请注明出处,否则将追究法律责任。