oracle 鏈接數據庫以及查看當前用戶、當前數據庫實例

sql>show user;查看當前用戶sql

sql>show parameter instance_name;查看當前數據庫實例數據庫

 

 

例如:spa

sqlplus登陸:用sys用戶登陸(密碼是123456)code

conn[ect]:切換到sbgl用戶(密碼是sbgl)blog

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

 

 

另外一種:string

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
相關文章
相關標籤/搜索