Oracle_11g中解决被锁定的scott用户的方法

来源:互联网 发布:mysql 金额有逗号排序 编辑:程序博客网 时间:2024/05/21 14:46
Oracle 11g中修改被锁定的用户:scott

在安装完Oracle10g和创建完oracle数据库之后,想用数据库自带的用户scott登录,看看连接是否成功。

在cmd命令中,用“sqlplus  scott/ tiger”登录时,老是提示如下信息: ERROR:ORA-28000:账户已被锁定。

在cmd命令提示符中可直接登录oracle,输入如下命令:

sqlplus / as sysdba;

接着执行如下命令:

SQL> alter user scott account unlock;

显示用户已更改,这样就完成解锁的操作。

接下来,你还可以重新给scott这个用户设定密码

修改scott的登录密码:

SQL> alter user scott identified by grace;

显示用户已更改,(grace为新的密码)

这样就OK了,测试一下scott/grace能否成功登录

SQL> conn scott/grace

显示已连接。

初学Oracle 数据库的小总结:

在cmd命令中输入sqlplus可以连接数据库,其格式为:

sqlplus 用户名/密码  

如:sqlplus scott/tiger;

在SQL Plus 中输入conn可以连接数据库,其格式为:

SQL> conn 用户名/密码 

如:conn scott/tiger;

在SQL Plus修改普通用户密码,其格式为:

aler user 用户名 identified by 密码

如:alter user scott identified by grace;

Oracle中给用户加锁与解锁的代码:

SQL> alter user 用户名 account lock;(加锁)

SQL> alter user 用户名 account unlock;(解锁)

1 0
原创粉丝点击