ORA-01017: invalid username/password; logon denied 无法使用密码登录oracle centos linux redhat

登录报错

[oracle@centos-7_3 dbs]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 29 20:59:41 2019

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

SQL> conn / as sysdba
Connected.
SQL> 
SQL> alter user sys identified by oracle789;

User altered.

sys用户修改密码成功,修改后的密码为oracle789

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@centos-7_3 dbs]$ 
[oracle@centos-7_3 dbs]$ sqlplus sys/oracle789@localhost:1521/ora81 as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 29 21:01:06 2019

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

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: ^C^C
[oracle@centos-7_3 dbs]$ 

sys用户用密码登录报错,实际上密码是对的;这里报错ORA-01017: invalid username/password; logon denied


[oracle@centos-7_3 dbs]$ pwd
/oracle/app/oracle/product/11.2.0/dbhome_1/dbs

oracle 11g r2 的版本 必须在 $ORACLE_HOME/dbs目录下 ,可以 通过cd $ORACLE_HOME/dbs 进入该目录


[oracle@centos-7_3 dbs]$ ll | grep orapw
-rw-r-----. 1 oracle oinstall 5120 Aug  7 19:35 orapworcl
-rw-r-----. 1 oracle oinstall 1536 Aug  5 23:59 orapwsrsttest
[oracle@centos-7_3 dbs]$ 
[oracle@centos-7_3 dbs]$ ps -ef | grep pmon
oracle    2251     1  0 13:53 ?        00:00:02 ora_pmon_ora81
oracle    6339  2631  0 21:03 pts/2    00:00:00 grep --color=auto pmon
[oracle@centos-7_3 dbs]$ 

grep pmon 查到oracle sid 为 ora81;

[oracle@centos-7_3 dbs]$ orapwd file=orapwora81 entries=30

Enter password for SYS: 
[oracle@centos-7_3 dbs]$ ll | grep orapw
-rw-r-----. 1 oracle oinstall 5120 Aug 29 21:04 orapwora81
-rw-r-----. 1 oracle oinstall 5120 Aug  7 19:35 orapworcl
-rw-r-----. 1 oracle oinstall 1536 Aug  5 23:59 orapwsrsttest
[oracle@centos-7_3 dbs]$ 

file=orapwora81, 格式为 orapw+ oracle sid;

[oracle@centos-7_3 dbs]$ sqlplus sys/oracle789@localhost:1521/ora81 as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 29 21:05:18 2019

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 
SQL> show user; 
USER is "SYS"
SQL> 

排查发现,oracle 实例对应的密码文件不存在,导致 通过密码登录失败。不只是sys 用户,这种情况下任何用户都无法通过密码登录。
我们手动创建正确的密码文件后,使用密码成功登录oracle !
Aug.29, 2019

网上浏览了十几个网页都解决不了我的问题,于是花费精力写下这篇博文,希望能够帮到需要的人。

如果觉得文章不错,不妨给个打赏,写作不易,各位的支持,能激发和鼓励我更大的写作热情。谢谢!

在这里插入图片描述

发布了13 篇原创文章 · 获赞 0 · 访问量 3042

猜你喜欢

转载自blog.csdn.net/Alan1921/article/details/100146505