带有 sys 作为 sysdba 的 Oracle sqlplus 失败并出现 ORA-01017:无效 username/password;登录被拒绝

Oracle sqlplus with sys as sysdba is failing with ORA-01017: invalid username/password; logon denied

与 ORACLE_SID 的 Oracle sys 用户数据库连接不工作。 dev 是我的 ORACLE_SID .

 sqlplus sys/manager@dev  as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 25 01:25:33 2021

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

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

但没有 ORACLE_SID 连接正常

sqlplus sys/manager  as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 25 01:34:05 2021

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>

看起来此连接正在使用 OS 身份验证。因为如果我为 sys 用户提供了错误的密码,仍然可以连接。

为什么 ORACLE_SID sys 用户连接无法正常工作?

有什么帮助吗?

在我的数据库中 sec_case_sensitive_logon 参数设置为 false。

SQL> show parameter sec_case_sensitive_logon

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
sec_case_sensitive_logon             boolean     FALSE

根本原因如下:

remote_login_passwordfile 参数设置为 EXCLUSIVE

SQL> show parameter remote_login_passwordfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

REMOTE_LOGIN_PASSWORDFILE 指定 Oracle 是否检查密码文件。

我的密码文件丢失了。

已创建密码文件

orapwd file=$ORACLE_HOME/dbs/orapw<sid> password=<password> force=y ignorecase=n

反弹数据库。

然后与 ORACLE_SID 的 Oracle sys 用户数据库连接正常。

sqlplus sys/manager@dev  as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 25 03:35:47 2021

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options