The service name for a database must be exactly the same as the global database name defined by the system administrator. SQL*Net limits the total length of a global database name to 64 characters. Of these, up to eight are the DB_NAME as defined by the database administrator, and the remainder show the service's place in the domain hierarchy (DB_DOMAIN). The name part of the service name can be longer than eight characters only if the DBA changes the name of the database with a RENAME GLOBAL_NAME parameter. The total global database name, or service name, must remain at or below 64 characters. See "Global Naming Issues" in Chapter 2 of Oracle7 Server Distributed Systems, Volume I for more information on creating a global database name.
The service name for an Interchange is the name of the Interchange or its Connection Manager component. Typically, the Interchange and the Connection Manager are referred to by the same name.
Note: If you specify a TCP/IP address prefixed with a "0", it is assumed to be an octal number, not a decimal number. For example, 39.223.72.44 is a decimal number, but 039.223.72.44 is an octal number.
(CONNECT_DATA= (SID=V7PROD) )
CONNECT_DATA is a protocol independent keyword indicating that application-specific data will be supplied at connect time, and SID specifies the Oracle System ID of the database server. You must specify the SID in the CONNECT DATA section of the connect descriptor.
With this release of SQL*Net, the CONNECT_DATA section must also include the global database name of the database. In most instances the global database name is the same as the service name. However, if you have a replicated database, you may have assigned a single service name that maps to more than one database name.
There is no CONNECT_DATA section in the connect descriptor of an Interchange.
Figure A - 2. SQL*Net Connect Descriptor
The following TNSNAMES.ORA entry maps the service name NY_FIN to the connect descriptor:
NY_FIN.FIN.HQ.ACME = (DESCRIPTION= (ADDRESS= (COMMUNITY=DECCOM.FIN.HQ.ACME) (PROTOCOL=DECNET) (NODE=NY_VAX.FIN.HQ.ACME) (OBJECT=LSNR) ) (CONNECT_DATA= (SID=DB1) (GLOBAL_NAME=NY_FIN.FIN.HQ.ACME) ) )
A user who wished to access the database would use NY_FIN to identify the appropriate connect descriptor. For example:
SQLPLUS SCOTT/TIGER@NY_FIN
This example assumes that NY_FIN is in the user's default domain. If it is not, the whole service name (NY_FIN.FIN.HQ.ACME) would need to be used.
A local TNSNAMES.ORA file does not replace the system file, but exists in addition to it. For example, if a developer creates a database which is not generally accessible to other users, he might want to create a private TNSNAMES.ORA file with a simple service name mapped to its connect descriptor. By creating his own TNSNAMES.ORA file, the developer can have the convenience of using a service name without having to go through the system administrator.
Note: For more specific information about the name, location, and use of the TNSNAMES.ORA file on your operating system, refer to your Oracle operating system-specific manual.
Note: The administrator does not need to add or change any parameters in the database parameter file for dedicated servers.
MTS_MULTIPLE_LISTENERS=TRUE
Note: Unless MTS_MULTIPLE_LISTENERS=TRUE is included, listener load balancing is not enabled.
If there is a single listener for each multi-threaded server, each address of the single listener is listed on a separate line, as follows:
MTS_LISTENER_ADDRESS= address
MTS_LISTENER_ADDRESS= address
[MTS_LISTENER_ADDRESS= address]
...
If multiple listeners are enabled, each listener must be on a separate line. If a listener has multiple addresses, each one is listed within an address list, as follows:
MTS_LISTENER_ADDRESS=(ADDRESS_LIST=(ADDRESS=(address) (ADDRESS=(address)))
MTS_LISTENER_ADDRESS=(ADDRESS_LIST=(ADDRESS=(address) (ADDRESS=(address)))
Note: If you decide to change back so that each dispatcher registers with only one listener, you must remove the ADDRESS_LIST keyword and place alternative addresses for the same listener on separate lines:
MTS_LISTENER_ADDRESS=address MTS_LISTENER_ADDRESS=address
service_name = (DESCRIPTION_LIST= (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=address) (ADDRESS=address)) (CONNECT_DATA=(SID=sid) (GLOBAL_NAME=global_dbname))) (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=address) (ADDRESS=address)) (CONNECT_DATA=(SID=sid) (GLOBAL_NAME=global_dbname))) [(CONNECT_DATA =(SID=sid)(GLOBAL_NAME=global_dbname))])
The global name is a concatenation of the db_name and the db_domain from the INIT.ORA file.
Note: The old format for TNSNAMES.ORA entries continues to work only for those databases that have only one listener.
emp=(DESCRIPTION_LIST= (DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(COMMUNITY=DECCOM.WORLD)(PROTOCOL=DECNET) (NODE=NY_VAX)(OBJECT=LSNR)) (ADDRESS=(COMMUNITY=TCPCOM.WORLD)(PROTOCOL=TCP) (HOST=NY_VAX)(PORT=1526)))) (DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(COMMUNITY=DECCOM.WORLD)(PROTOCOL=DECNET) (NODE=NY_SEQ)(OBJECT=LSNR)) (ADDRESS=(COMMUNITY=TCPCOM.WORLD)(PROTOCOL=TCP) (HOST=NY_SEQ)(PORT=1526)))) (CONNECT_DATA=(SID=db1)(GLOBAL_NAME=emp.world)))
In this example, there are two listeners for the database, on two different nodes, each listening on two different protocols. This example matches the example illustrated in Figure 2 - 4.
If there are replicated databases that are equivalent, create a service name that maps to more than one SID and global database name. For example, the following portion of a TNSNAMES.ORA file is for a replicated server with two listeners. The example matches that shown in Figure 2 - 5.
TNSNAMES.ORA Example for Equivalent Databases
twinemp=(DESCRIPTION_LIST= (DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(COMMUNITY=DECCOM.WORLD) (PROTOCOL=DECNET) (NODE=NY_VAX)(OBJECT=LSNR)) (ADDRESS=(COMMUNITY=TCPCOM.WORLD) (PROTOCOL=TCP) (HOST=NY_VAX)(PORT=1526))) (CONNECT_DATA=(SID=db1)(GLOBAL_NAME=emp.world))) (DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(COMMUNITY=DECCOM.WORLD) (PROTOCOL=DECNET)(NODE=NY_SEQ) (OBJECT=LSNR)) (ADDRESS=(COMMUNITY=TCPCOM.WORLD) (PROTOCOL=TCP)(HOST=NY_SEQ) (PORT=1526))) (CONNECT_DATA=(SID=db2)(GLOBAL_NAME=hr.world))))