sqlplus命令行的管理员登陆

 

前段时间写了一个重启数据库的批处理,因为是从我本机测试的,本机的用户名和密码是sys/sys,结果把它移植到服务器后忘记修改登陆用户名和密码了,没想到在执行重启数据库的时候竟然也成功了,从日志上看的很清楚。经过确认,在服务器上执行的批处理里面用户名和密码确实没有修改,于是,我做了以下这些测试,最终的结果是:

    当用Windows的管理员帐户登陆系统后登陆数据库,只要加上 as sysdba,不管用什么用户名和密码登陆,都正确,因为这时系统已经忽略了/ 两边的用户名和密码,默认就是sys用户。

C:\Documents and Settings\Administrator>sqlplus sys/sys as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:52:43 2007

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"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\Documents and Settings\Administrator>sqlplus sys/chj as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:53:00 2007

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"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\Documents and Settings\Administrator>cd\

C:\>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:53:17 2007

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"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>sqlplus system/sys

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:53:38 2007

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> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>sqlplus system/chj

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:53:44 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

请输入用户名:  system/sys as sysdba

连接到:
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"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>sqlplus system/kkkkkkkkkk as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:54:30 2007

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> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>sqlplus cppi/cppi

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:54:58 2007

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 为 "CPPI"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>sqlplus cppi/zsm as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:55:16 2007

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"
SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>sqlplus hello/kkk as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 6月 7 19:56:05 2007

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"
SQL>

posted @ 2009-09-14 14:18  senzjx  阅读(13555)  评论(0编辑  收藏  举报