解锁oracel数据库scott账户

第一种情况:

以system账户+自己安装时设置的密码,登录SQL Plus,
然后使用命令“alter user scott account unlock;”来解锁。
解完以后,使用下面的命令来查看:“select username,account_status from dba_users;”,
可以看到scott账户已经解锁,但是状态还是“expired”(密码过期)的意思。
再输入这样的命令“alter user scott identified by tiger;”,就给其赋了一个新的口令。
退出,以scott/tiger登录即可。

第二种情况:

用Windows的控制台(程序|运行,输入cmd打开)。在命令行下,输入sqlplus/nolog,回车,出现SQL>命令提示符,然后按下面的顺序输入命令:
SQL>conn/as sysdba
SQL>alter user scott account unlock;
SQL>disconnect
SQL>conn scott/tiger@oral;
这时会提示密码已经过期,请输入新的口令。然后输入两次新定义的口令分别回车确认即为scott账户赋予了新的口令。打开SQL Plus,再以scott账户就可以登录了。

猜你喜欢

转载自blog.csdn.net/qq_40685457/article/details/83545177