ORA-01017: invalid username/password; logon denied

Try to connect to 12c standby database , then get “ORA-01017” error.

$ sqlplus sys/password@TESTDBSTY as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 15 18:07:54 2019

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

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

After investigation, found the listener is running by 11R2 binary, instead of 12cR1 binary.

Restart the listener in 12cR1 ORACLE_HOME, then everything is fine.

Always run listener by using the highest version of all ORACLE_HOME.

“ORA-01017: invalid username/password; logon denied” While Data Guard Switchover

Data Guard switchover failed with “ORA-01017” error :

DGMGRL> connect /
Connected as SYSDG.

DGMGRL> switchover to STDBYDB;
Performing switchover NOW, please wait...
Operation requires a connection to instance "STDBYDB2" on database "STDBYDB"
Connecting to instance "STDBYDB2"...
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

RESOLUTION

Logon as SYS, then switchover will be successful.

DGMGRL> connect SYS
Connected as SYSDG.
DGMGRL> switchover to STDBYDB;

Performing switchover NOW, please wait...

Operation requires a connection to instance "STDBYDB2" on database "STDBYDB"

Connecting to instance "STDBYDB2"...

Connected as SYSDBA.

New primary database "STDBYDB" is opening...

Oracle Clusterware is restarting database "PRIMDB" ...

Switchover succeeded, new primary is "STDBYDB"

How to Copy ASM Password File From Primary to Standby

It is a prerequisite for both primary and secondary databases have same copy of password file, and stored in ASM diskgroup preferred

From 12.1.0.2 on, since primary database password file is stored in ASM, so it needs to be manually copied onto standby database ASM for dataguard configuration. Otherwise the below errors will occur:

*** 2017-09-06 14:34:29.216
OCISessionBegin failed. Error -1
.. Detailed OCI error val is 1017 and errmsg is 'ORA-01017: invalid username/password; logon denied
'
ORA-01017: invalid username/password; logon denied
OCI_DBVER attribute value retrieval failed error=1017

*** 2017-09-06 14:34:30.323
OCISessionBegin failed. Error -1
.. Detailed OCI error val is 1017 and errmsg is 'ORA-01017: invalid username/password; logon denied
'
*** 2017-09-06 14:34:30.323737 4929 krsh.c
Error 1017 received logging on to the standby

Subscribe to get access

Read more of this content when you subscribe today.