前两天在ITPUB上看到一个帖子,提到如何用最快的方法以SYSDBA登陆数据库。



有人给出的方法是sqlplus直接回车,然后在提示用户名时输入/ as sysdba:

[oracle@yans1 ~]$ sqlplus


SQL*Plus: Release10.2.0.3.0 - Production on星期六8月8 22:01:47 2009


Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.


Enter user-name: / as sysdba


Connected to:


Oracle Database10gEnterprise Edition Release10.2.0.3.0 - 64bit Production


With the Partitioning, OLAP and Data Mining options


SQL>


其实在10g中,sqlplus做了改进,可以在sqlplus后面直接加上/ as sysdba,而不需要双引号或单引号:

[oracle@yans1 ~]$ sqlplus / as sysdba


SQL*Plus: Release10.2.0.3.0 - Production on星期六8月8 22:05:14 2009


Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.



Connected to:


Oracle Database10gEnterprise Edition Release10.2.0.3.0 - 64bit Production


With the Partitioning, OLAP and Data Mining options


SQL>


在9i中,sqlplus还没有这个功能,必须在/ as sysdba两边加上引号。

bash-2.03$ sqlplus / as sysdba


Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]


where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]


     <logon>  ::= <username>[/<password>][@<connect_string>] | / | /NOLOG


     <start>  ::= @<URI>|<filename>[.<ext>] [<parameter> ...]


       "-H" displays the SQL*Plus version banner and usage syntax


       "-V" displays the SQL*Plus version banner


       "-L" attempts log on just once


       "-M <o>" uses HTML markup options <o>


       "-R <n>" uses restricted mode <n>


       "-S" uses silent mode


bash-2.03$ sqlplus "/ as sysdba"


SQL*Plus: Release9.2.0.4.0 - Production on星期六8月8 22:25:16 2009


Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.



Connected to:


Oracle9i Enterprise Edition Release9.2.0.4.0 - 64bit Production


With the Partitioning, OLAP and Oracle Data Mining options


JServer Release 9.2.0.4.0 - Production


SQL>


从这种小的变化也可以看出,对于Oracle最基础的sqlplus工具而言,也在不断的提高易用性。



oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html