Thursday, May 26, 2005

Watch out...

Behold the two entries in a tnsnames.ora file:

FRANK.CS.NL =
(description =
(address=(protocol=BEQ)(PROGRAM = ORACLE)
(ARGV0=oracleDB920)
(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))'))
(CONNECT_DATA =(SID=DB920)
)
)

FRANKIE.CS.NL =
(DESCRIPTION=
(ADDRESS = (PROTOCOL = BEQ)(PROGRAM=oracle)
(ARGV0=oracledb920)
(ARGS='(DESCRIPTION=(LOCAL=yes)(ADDRESS=(PROTOCOL=BEQ)))'))
(CONNECT_DATA=(SID=db920)
)
)
Seems pretty straightforward, not? Yet, one entry works, and the other does not:
C:\>tnsping frank

TNS Ping Utility for 32-bit Windows: Version 9.2.0.4.0 - Production on 26-MAY-20 05 10:18:45

Copyright (c) 1997 Oracle Corporation. All rights reserved.

Used parameter files:
D:\oracle\ora92\network\ADMIN\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (description = (address=(protocol=BEQ)(PROGRAM = ORACLE) (
ARGV0=oracleDB920) (ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')) (
CONNECT_DATA =(SID=DB920)))
TNS-12560: TNS:protocol adapter error

C:\>tnsping frankie

TNS Ping Utility for 32-bit Windows: Version 9.2.0.4.0 - Production on 26-MAY-2005 10:20:52

Copyright (c) 1997 Oracle Corporation. All rights reserved.

Used parameter files:
D:\oracle\ora92\network\ADMIN\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS = (PROTOCOL = BEQ)(PROGRAM=oracle)
(ARGV0=oracledb920) (ARGS='(DESCRIPTION=(LOCAL=yes)(ADDRESS=(PROTOCOL=BEQ)))'))
(CONNECT_DATA=(SID=db920)))
OK (30 msec)
This is Windows/2000.

4 comments:

Frank said...

Surprisingly, the executable mentioned after program =, is case sensitive. The FRANK entry does not work, as it has ORACLE, the FRANKIE entry does, as it has oracle (in lower case!)
As far as I have tested, that pasrt is the only thing messing this up on Windows.

Niall said...

Hi Frank

whitespace in the wrong place can bugger up tnsnames entries as well (and what's the apostrophe doing in there - is that normal).

Frank said...

I know - and have yet to find out why spaces disappear... For now, I'll use some   in it.
The apostrophe? What apostrophe? The one following ARGS=? - yes that belongs there.

Frank said...

Got the spaces thing out of the way - use <pre space="preserve">