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

本文记录了一次Oracle数据库登录失败的问题排查过程,详细解释了由于密码文件缺失导致的登录错误ORA-01017,并提供了创建正确密码文件以解决问题的方法。

登录报错

[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

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

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

在这里插入图片描述欢迎关注公号,定期分享数据库的知识,点点滴滴,大家一起进步!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值