您的位置:首页 > 数据库 > Oracle

在Oracle 11g中给scott用户解锁

2011-06-03 11:35 423 查看
转载自:http://blog.csdn.net/manction/archive/2009/09/08/4529968.aspx

 

 安装完 Oracle11g 之后,想打开自带的 SQL Plus 来学习,然后按照提示用 sys 用户来连接数据库,可输了好几次都提示一个错误。
    error: the account is locked
    后来在研究所学习的兰平兄弟告诉我说学习 Oracle 一般 scott 用户(默认密码为tiger)登录,尝试了一下发现还是提示同样的错误。兰平说这个用户被锁定了,解锁代码他一时也记不起来,于是我上网查询了一下相关资料。至于 scott 用户为什么被锁定,可能是下面几个原因。
    1. 尝试多次登录未成功(可能密码不正确);
    2. 此用户被管理员手工锁定;
    3. 用户密码到期、未按时修改密码,等等。
    看来 scott 这个用户肯定是登陆不了了,然后我用尝试着用 system 这个用户登录,我记得在安装 Oracle 11g 的时候曾提示输入密码,然后我自己输了一个,结果我用自己原先设定的密码试了一下果然连接上了。可见来在 oracle 11g 的 system 这个用户的密码并不是默认的,而是安装的时候自己设定的。
    用 system 登录进去之后,执行下面的命令:
    SQL> alter user scott account unlock;
    用户已更改。
    这样就完成解锁的操作。接下来,你还可以重新给 scott 这个用户设定密码。
    修改scott的登录密码:
    SQL> alter user scott identified by tiger;
    用户已更改。
    大功告成,此时你再拿 scott 和 tiger 来登录就可以了!
    SQL> conn scott/tiger
    已连接。
    学习 Oracle 数据库的几点经验:
    1. 在Dos命令下输入 sqlplus 可以打开 Oracle 自带的 SQL Plus 并出现登录提示,而输入 sqlplus/nolog 则打开 SQL Plus 后不出现登陆提示;
    2. 在 SQL Plus 中输入 conn 可以连接数据库,其中的一种格式为:
    SQL> conn 用户名/密码 如: conn scott/tiger
    3. Oracle 中给用户加锁与解锁的代码:
    SQL> alter user 用户名 account lock; (加锁)
    SQL> alter user 用户名 account unlock; (解锁)
    希望以上代码对初学 Oracle 的朋友有所帮助。

 

Oracle 10g 默认安装带来的用户名/密码


Username
Password
Description
See Also
CTXSYS
CTXSYS
The Oracle Text account
Oracle Text Reference
DBSNMP
DBSNMP
The account used by the Management Agent component of Oracle Enterprise Manager to monitor and manage the database
Oracle Enterprise Manager Grid Control Installation and Basic Configuration
LBACSYS
LBACSYS
The Oracle Label Security administrator account
Oracle Label Security Administrator's Guide
MDDATA
MDDATA
The schema used by Oracle Spatial for storing Geocoder and router data
Oracle Spatial User's Guide and Reference
MDSYS
MDSYS
The Oracle Spatial and Oracle interMedia Locator administrator account
Oracle Spatial User's Guide and Reference
DMSYS
DMSYS
The Oracle Data Mining account.
Oracle Data Mining Administrator's Guide
Oracle Data Mining Concepts
OLAPSYS
MANAGER
The account used to create OLAP metadata structures. It owns the OLAP Catalog (CWMLite).
Oracle OLAP Application Developer's Guide
ORDPLUGINS
ORDPLUGINS
The Oracle interMedia user. Plug-ins supplied by Oracle and third party format plug-ins are installed in this schema.
Oracle interMedia User's Guide
ORDSYS
ORDSYS
The Oracle interMedia administrator account
Oracle interMedia User's Guide
OUTLN
OUTLN
The account that supports plan stability. Plan stability enables you to maintain the same execution plans for the same SQL statements. OUTLN acts as a role to centrally manage metadata associated with stored outlines.
Oracle Database Performance Tuning Guide
SI_INFORMTN_SCHEMA
SI_INFORMTN_SCHEMA
The account that stores the information views for the SQL/MM Still Image Standard
Oracle interMedia User's Guide
SYS
CHANGE_ON_INSTALL
The account used to perform database administration tasks
Oracle Database Administrator's Guide
SYSMAN
CHANGE_ON_INSTALL
The account used to perform Oracle Enterprise Manager database administration tasks. Note that SYS and SYSTEM can also perform these tasks.
Oracle Enterprise Manager Grid Control Installation and Basic Configuration
SYSTEM
MANAGER
Another account used to perform database administration tasks.
Oracle Database Administrator's Guide
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息