RelationalDBDesign RelationalDBDesign

Managing Users  «Prev  Next»
Lesson 10 The default domain
Objective Check your default domain.

Oracle Net default domain

Oracle Net can use a multi-level naming convention for database servers that is not unlike that used on the internet. Your entry for COIN in the tnsnames.ora file probably starts out like this: COIN.WORLD =
The ".WORLD" is significant. It represents the Oracle Net domain of the entry. When you connect to the COIN service, you can specify this domain explicitly by using "" as your service name, or you can rely on the Oracle Net default domain and just use "COIN." The default domain is defined in a file named sqlnet.ora, which is found in the same directory as the tnsnames.ora file. The line in the sqlnet.ora file that defines the default domain looks like this:
names.default_domain = world
In the example above, the default domain of "world" matches the domain of "world" in "". Consequently, you may simply refer to the service as "coin". However, let's consider what would happen if your default domain entry looked like this (someone would have to have changed it for it to look like this):
names.default_domain = notworld

Now the domains do not match. The default domain is "notworld", and if you tried to connect to a service named "coin", Oracle Net would append ".notworld" onto the end and try to connect you to "coin.notworld". Since "coin.notworld" does not exist in your tnsnames.ora file, you would get an error like that shown in this example:

C:\>tnsping coin
TNS Ping Utility for 32-bit Windows:
Version - Production on 16-MAY-99
(c) Copyright 1997 Oracle Corporation.
All rights reserved.
TNS-03505: Failed to resolve name

Diagnosing domain mismatches

Default domain mismatches like this are very easy to diagnose. All you have to do is to tnsping the server and specify the fully qualified service name when you do. For example:

TNS Ping Utility for 32-bit Windows:
Version - Production on 16-MAY-99
(c) Copyright 1997 Oracle Corporation.
All rights reserved.
Attempting to contact (ADDRESS=(PROTOCOL=TCP)
OK (170 msec)
If you can tnsping successfully using a fully qualified service name (e.g. ""), but not when you depend on the default domain (e.g. "coin"), then you have an issue with the default domain. You can change the default domain if you like, by editing the sqlnet.ora file, or you can decide to always use the fully qualified service name.