Oracle sys 用户与 ORACLE_SID 的数据库连接无法正常工作。 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>
看起来此连接正在使用操作系统身份验证。因为如果我为 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 sys 用户与 ORACLE_SID 的数据库连接正在工作。
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