views:

1124

answers:

1

I've been wondering this for a while but since it hasn't come up much I've left it in the 'mysterious wizardy' column.

It seems to me that there is some sort of relationship between a connection identifier like ABC and ABC.DEFG and I don't quite get what it is.

For example, a machine I was setting up just now I was having problems with using the identfier ED2 even though in my tnsnames file I clearly had

EDC2 = (....)

This was copied and pasted from another computer which worked just fine. However, doing tnsping EDC2 would fail to resolve until I changed it to say

EDC2.WORLD = (...)

at which point resolving to EDC2 started working. What is going on here?

+7  A: 

The TNS alias in the tnsnames.ora file interacts with the parameter

NAMES.DEFAULT_DOMAIN

in the sqlnet.ora file. If NAMES.DEFAULT_DOMAIN is set to WORLD, for example, then when you try to connect to an alias without a domain, the sqlnet.ora file tells Oracle to automatically append the domain before doing the lookup in the tnsnames.ora file. If you try to connect to an alias with a domain, NAMES.DEFAULT_DOMAIN is ignored.

My general preference/ suggestion is to set NAMES.DEFAULT_DOMAIN to WORLD in the sqlnet.ora and specify EDC2.WORLD in the tnsnames.ora file. That way, both the connect identifier EDC2 and EDC2.WORLD will work-- the former gets changed to the latter because of the DEFAULT_DOMAIN parameter.

Justin Cave