(转)Oracle sqlplus/as sysdba命令详解

在命令窗口输入“sqlplus / as sysdba”后回车,即可连接到Oracle

 
例如
 
C:\>sqlplus / as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 4月 17 10:05:34 2012
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
  www.2cto.com  
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL>
 
那么到底此命令到底执行了什么操作,不妨登录后输入“select user from dual;”查看,可看到如下结果:
 
C:\>sqlplus / as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 4月 17 10:11:11 2012
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
连接到:
 
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
  www.2cto.com  
SQL> select user from dual;
 
USER
------------------------------
SYS
 
SQL>
 
很明显我们刚刚是以SYS用户登录的
 
这就说明此处省略了用户名及密码
 
我们再以“sqlplus sys/****(sys用户的密码) / as sysdba”的方式登录,此时不论用户名或密码是否在 系统中存在都可正常登录,登录的用户还是“SYS”,命令操作如下:
 
C:\>sqlplus sss/sss as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 4月 17 10:21:12 2012
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
  www.2cto.com  
SQL> select user from dual;
 
USER
------------------------------
SYS
 
SQL>
 
命令详解:以sqlplus / as sysdba方式登录时,采用的是操作系统验证的方式,所以用户名/密码输与不输入是一样的。

 

你可能感兴趣的:(oracle)