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

关于Oracle 10g scott用户解锁的方法

2010-08-30 22:59 507 查看
在安装完Oracle10g之后,想打开sql*plus来学习,然后按照书上的步骤用scott用户来连接数据库,可输了好几次都提示一个错误。

error: the account is locked

然后上网查了一下之后发现这个用户被锁定了,至于它为什么被锁定,可能是下面几个原因。

1.尝试多次登录未成功.(可能密码不正确)

2.此用户被管理员手工锁定.

3.用户密码到期.未按时修改密码.等等...

这个用户肯定是登陆不了了,然后我用system这个用户登录,可是登了半天都没有进去,又去网上查,网上面大都是关于 oracle
9i的用户和密码,后来我记得在安装的时候就提示输入了,用那个试了一下就连接上了,所以在oracle
10g的system这个用户的密码不是默认的,而是安装的时候自己设定的。

拿system登录进去之后,执行下面的命令:

SQL> alter user scott account unlock;

用户已更改。

这样就完成解锁的操作。接下来,你还可以重新给scott这个用户设定密码

修改scott的登录密码

SQL> alter user scott identified by pan;

用户已更改。

ok了,你再拿scott 和 pan来登录就可以了!

SQL> conn scott/pan

已连接.

新装完Oracle10g后,用system/password可以正常登录,而使用scott/tiger用户却不能登录:

conn scott/tiger

error:oracle10g the account is locked

oracle10g the password has expired

原因:默认Oracle10g的scott不能登陆。被禁用
了。

解决方法:

首先确认已经安装oracle 数据库和客户端

.在客户端DOS下执行如下语句:

注意提示符号

c:/sqlplus /nolog

sqlp/ conn sys/system@oracle10 as
sysdba // sys为当前的oracle 用户 system 为该用户密码 oracle10 为SID

# alter user soctt
account lock; // 把 scott用户锁定

# alter user scott account unlock;
//把scott用户解锁

# alter user scott identified by scott //修改scott用户密码为
scott,scott用户默认密码为 tiger

1 Dos下输入C:/sqlplus /nolog

2 以DBA的身份登录

conn sys/password as sysdba;


3 解锁

alter user scott account unlock;


4
弹出一个修改密码的对话框,修改密码

conn scott/tiger

SQL> conn sys/sys as sysdba;

Connected.

SQL> alter
user scott account unlock;

User altered.

SQL> commit;

Commit
complete.

SQL> conn scott/tiger//请输入新密码,并确认后OK

Password
changed

Connected.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: