One of the reasons for getting this error might be that the sqlnet.ora does not contain the proper settings like in this particular case:
[[email protected] admin]$ cat sqlnet.ora [[email protected] admin]$
As you can see there is nothing set in sqlnet.ora. Therefor when I was trying to reinstate a former PRIMARY as STANDBY, I was seeing in alert log of the reinstated database this:
Fatal NI connect error 12514, connecting to: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=1521)))(CONNECT_DATA=(ORACLE_SID=db)(INSTANCE_NAME=db)(CID=(PROGRAM=oracle)(HOST=xxxxxx)(USER=oracle)))) VERSION INFORMATION: TNS for Linux: Version 220.127.116.11.0 - Production TCP/IP NT Protocol Adapter for Linux: Version 18.104.22.168.0 - Production Version 22.214.171.124.0 Time: 12-APR-2020 06:49:28 Tracing not turned on. Tns error struct: ns main err code: 12564 TNS-12564: TNS:connection refused ns secondary err code: 0 nt main err code: 0 nt secondary err code: 0 nt OS err code: 0
In order to fix this, I have set this in SQLNET.ORA the following:
NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT, HOSTNAME)
And the reinstate worked like a charm.