clicksor ad

Thursday, February 09, 2006

Error while connecting to RAC database (TNS-12545)

C:\Documents and Settings\Administrator>sqlplus system@sun

SQL*Plus: Release 9.2.0.1.0 - Production on Tue Sep 20 11:09:37 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Enter password:
ERROR:
ORA-12545: Connect failed because target host or object does not exist


Enter user-name:


SQLNET.ORA entry


Fatal NI connect error 12545, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=icai2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)(CID=(PROGRAM=C:\Program Files\Quest Software\TOAD\TOAD.exe)(HOST=DBAPC)(USER=Administrator))))

VERSION INFORMATION:
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 9.2.0.1.0 - Production
Time: 21-AUG-2005 14:46:20
Tracing not turned on.
Tns error struct:
nr err code: 0
ns main err code: 12545
TNS-12545: Connect failed because target host or object does not exist
ns secondary err code: 12560
nt main err code: 515
TNS-00515: Connect failed because target host or object does not exist
nt secondary err code: 1001
nt OS err code: 0


TNSNAMES ENTRY
SUN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.0.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.0.2)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ici.world)
)
)


Because of this problem you can only use separate TNSnames for both instances(servers)

sun1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ici11)
)
)

sun2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.0.2)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ici12)
)
)


What is the solution ?
Open the file "hosts" in editor and add the lines shown in bold at the end

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
10.1.0.1 ici1
10.1.0.2 ici2

No comments: