TNS-12545: Connect failed because target host or object does not exist

TNS-12545: Connect failed because target host or object does not exist

Error
Getting error while starting the listener in Oracle database server.

C:\windows\system32>lsnrctl start

LSNRCTL for 64-bit Windows: Version 18.0.0.0.0 - Production on 01-APR-2020 09:35:35

Copyright (c) 1991, 2018, Oracle. All rights reserved.

Starting tnslsnr: please wait...

TNSLSNR for 64-bit Windows: Version 18.0.0.0.0 - Production
System parameter file is C:\Oracle\dbhomeXE\network\admin\listener.ora
Log messages written to C:\Oracle\dbhomeXE\log\diag\tnslsnr\IXC1-LT8TBDWT2\listener\alert\log.xml
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
64-bit Windows Error: 1001: Unknown error

Listener failed to start. See the error message(s) above...

Cause:
Hostname is not correct in listener file

Solution
Following are possible reasons:
1. Listener.ora file have wrong entry of hostname.
2. In operating system hosts file need to correct.
3. Check hostname is resolved by ping command.

1. Edit the Listener.ora file and correct the hostname entry

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = RAC1.oracle.com)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

2. Check the hosts file and make entry in it.

Locations:
Windows: C:\Windows\System32\drivers\etc\hosts
Linux: /etc/hosts

add entry:
10.0.0.1 RAC1.oracle.com RAC1

3. Check ping command that name is resolved with IPaddress otherwise check domain settings.

ping rac1

Leave a Reply

Fill in your details below or click an icon to log in:

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.