sql>show user;查看當前用戶
sql>show parameter instance_name;查看當前數據庫實例
例如:
sqlplus登錄:用sys用戶登錄(密碼是123456)
conn[ect]:切換到sbgl用戶(密碼是sbgl)
C:\Windows\system32>sqlplus sys/123456@orcl as sysdba SQL*Plus: Release 11.2.0.1.0 Production on 星期五 2月 2 14:32:34 2018 Copyright (c) 1982, 2010, Oracle. All rights reserved. 連接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show user USER 為 "SYS" SQL> conn sbgl/sbgl@orcl 已連接。 SQL> show user USER 為 "SBGL" SQL> show parameter instance_name; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ instance_name string orcl
另一種:
C:\Windows\system32>sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on 星期五 2月 2 15:29:55 2018 Copyright (c) 1982, 2010, Oracle. All rights reserved. SQL> show user; USER 為 "" SQL> conn sbgl/sbgl@orcl as sysdba 已連接。 SQL> show user USER 為 "SYS" SQL> show parameter instance_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ instance_name string orcl