TNS-12564: TNS:connection refused while reinstating a failed database

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:

[oracle@server admin]$ cat sqlnet.ora 
[oracle@server 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 19.0.0.0.0 - Production
	TCP/IP NT Protocol Adapter for Linux: Version 19.0.0.0.0 - Production
  Version 19.3.0.0.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.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.