本地登录出现ORA-01017的两种可能情况:

情况1:参数设置不正确

除了sys用户,其他普通用户均登录失败:

$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Aug 24 13:44:52 2022
Version 19.9.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0
SQL> create user test identified by oracle;
User TEST created.
SQL> grant connect,resource to test;
Grant succeeded.
SQL> conn test/oracle
Connected.
SQL> exit;

$ sqlplus / as sysdba
SQL> alter system set sec_case_sensitive_logon =false;
System altered.
SQL> conn test/oracle
ERROR:
ORA-01017: invalid username/password; logon denied <<<<<<<<<<<<<<<<<<<<<
SQL> conn / as sysdba
Connected.

The SEC_CASE_SENSITIVE_LOGON parameter is deprecated in 18C. It is retained for backward compatibility only.

For Oracle E-Business Suite Release 12.1 (as well as 12.2), ensure that the ​​sqlnet_ifile.ora​​ file has the line SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8 (if the initialization parameter SEC_CASE_SENSITIVE_LOGON is set to FALSE) or SQLNET.ALLOWED_LOGON_VERSION_SERVER = 10 (if SEC_CASE_SENSITIVE_LOGON is set to TRUE).

However starting with Oracle Database 19, ensure that the ​sqlnet_ifile.ora​ file has the line SQLNET.ALLOWED_LOGON_VERSION_SERVER=10 (for both TRUE or FALSE values of SEC_CASE_SENSITIVE_LOGON).

客户端版本和访问的oracle服务端的版本不一致

连接时报:ORA-28040: No matching authentication protocol,需要修改sqlnet.ora文件:

$cat $ORACLE_HOME/network/admin/sqlnet.ora
# oracle setting
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8

修改后再次登录时,即使用户名密码都正确均会报ORA-01017: invalid username/password;需要再次修改密码。修改后可以查看dba_users.password_versions的版本变化。

Patch 12964564:R12.FND.B - Enabling the Oracle Database 11g Case-Sensitive Password Feature for Oracle E-Business Suite Release 12.1.1+ (Doc ID 1581584.1)