连接oracle数据库报错ORA-01017、重置用户的密码

报01017错误,因为太久没用忘了这个用户密码。。。

 

 

环境变量如上,不知道是不是必须的    呃。。

 

打开cmd

 

Microsoft Windows [版本 10.0.16299.64]
(c) 2017 Microsoft Corporation。保留所有权利。

C:\WINDOWS\system32>echo %ORACLE_SID%                              >>>查看ORACLE_SID环境变量值
ORCL

C:\WINDOWS\system32>sqlplus /nolog                                              >>>登录sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on 星期二 1月 9 09:51:19 2018

Copyright (c) 1982, 2010, Oracle. All rights reserved.

SQL> conn sys/oracle @orcl as sysdba
已连接。
SQL> conn sys/oracle as sysdba                                                        >>>登录sys系统用户
已连接。
SQL> show user                        >>>显示当前登录用户名
USER 为 "SYS"

SQL> conn scott/tiger                        >>>尝试连接scott用户
ERROR:
ORA-28000: the account is locked                              >>>报错原因:scott默认是锁的,需解锁


警告: 您不再连接到 ORACLE。
SQL> conn sys/oracle as sysdba                   >>>重新登录sys系统用户
已连接。
SQL> alter user scott account unlock;                >>>解锁scott用户

用户已更改。

SQL> alter user scott identified by tiger;                  >>>修改scott用户的密码为tiger

用户已更改。

SQL> conn scott/tiger                                    >>>用新密码连接scott用户
已连接。                              >>>连接成功
SQL> show user  
USER 为 "SCOTT"


SQL> select * from all_users;                  >>>查询所有用户

USERNAME USER_ID CREATED
------------------------------ ---------- --------------
MALL              89    08-9月 -17
ZHOUMO               87    05-8月 -17
CHEN             86    02-8月 -17
chen             85      02-8月 -17
SCOTT           84    30-3月 -10
OWBSYS_AUDIT     83    30-3月 -10
...                                        >>>后面的就不复制出来了
...

已选择36行。

SQL> alter user CHEN identified by abc123;                                  >>>修改CHEN用户的密码为abc123

用户已更改。                                                                                   >>>修改成功

SQL> conn CHEN/abc123                                                              >>>用新密码连接CHEN用户
已连接。                                                                                          >>>连接成功
SQL> show user
USER 为 "CHEN"

 

 

连接成功

 

就是记录一下小问题。。

posted @ 2018-01-09 11:08  chen-27  阅读(867)  评论(0编辑  收藏  举报