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

 

在安装完Oracle10g以后,想打开sql*plus来学习,而后按照书上的步骤用scott用户来链接数据库,可输了好几回都提示一个错误。 html

error: the account is lockedlinux

而后上网查了一下以后发现这个用户被锁定了,至于它为何被锁定,多是下面几个缘由。sql

1.尝试屡次登陆未成功.(可能密码不正确)数据库

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

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

这个用户确定是登录不了了,而后我用system这个用户登陆,但是登了半天都没有进去,又去网上查,网上面大都是关于 oracle 9i的用户和密码,后来我记得在安装的时候就提示输入了,用那个试了一下就链接上了,因此在oracle 10g的system这个用户的密码不是默认的,而是安装的时候本身设定的。学习

拿system登陆进去以后,执行下面的命令:spa

SQL> alter user scott account unlock;htm

用户已更改。ci

这样就完成解锁的操做。接下来,你还能够从新给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.

 

转载自:http://www.oklinux.cn/html/sql/other/20081104/64141.html