Network Admin   «Prev  Next»
Lesson 4Add Oracle8i Net features to the tnsnames.ora file
ObjectiveModify the tnsnames.ora file.

Add Oracle Network Features to tnsnames.ora File

Many database instances share a common database. A new feature in Oracle8i allows a single service name to have several database instances defined.
When connecting, Oracle will automatically fall back to the second host if the first host is not accepting connections. The connection attempts can be set to connect in the sequence of the addresses or randomly among the host names defined in the tnsnames.ora file. Because a single service name can now define multiple database instances, the INSTANCE_NAME parameter is required to uniquely define the specified instance. This feature also requires you to implement client load balancing if you are setting up an OPS.
Be aware that client load balancing and connection load balancing are very different concepts. Client load balancing is the specification of multiple instances in an OPS service name. Connection load balancing refers to balancing incoming connections between MTS dispatchers on a single instance.
This lesson describes several of the new parameters you see in the tnsnames.ora file. Look at the following MouseOver for a description of four new parameters. The image is a picture of the tnsnames.ora file, showing the placement of the four parameters.
  1. The ADDRESS_LIST parameter allows multiple addresses to be specified for a single TNS service name. For a multi-threaded server, each ADDRESS is another listener for the same node. For Oracle Parallel server, each ADDRESS is another database node.
  2. The SOURCE_ROUTE is typically used to enable Oracle Connection Manager features. When set to YES or ON, it means that all the addresses listed must be connected by the Connection Manager before the client can do anything on the databases. This might be useful for distributed systems where committing transactions might cross multiple databases.
  3. When LOAD_BALANCE is set to ON, connection load balancing is in force. Connection load balancing will be examined in a later module.
  4. When the FAILOVER parameter is ON, transparent application failove is in force. This allows Oracle8<i>i</i> to re-connect to another server if the current connection fails. This is discussed in a later module
TEST1=
 (DESCRIPTION =
  (ADDRESS_LIST = 
  (SOURCE_ROUTE = OFF)
  (LOAD_BALANCE = ON ) 
  (FAILOVER = ON)
  (ADDRESS = (PROTOCOL = TCP)(HOST =monet)(PORT =1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST =cezanne)(PORT =1521))
 )
 (CONNECT_DATA=
  (SERVICE_NAME = test1) 
 ) 
)
The ADDRESS_LIST parameter allows multiple addresses to be specified for a single TNS service name. For a multi-threaded server, each ADDRESS is another listener for the same node. For Oracle Parallel server, each ADDRESS is another database node
Oracle Net Services tnsnames.ora-file
The concept of adding multiple addresses to a TNS service entry originated with OPS, where multiple instances could service the same database. This concept has been extended for all Oracle8i database instances that have multiple listeners.
Warning! Manually editing the tnsnames.ora file may cause the Net Assistant to fail, especially in earlier releases of OEM. Oracle claims that they have fixed this issue, but be cautious! Most experienced DBA's do not use the GUI tool because they know the proper syntax.
As we know, Oracle8i has provided a new SERVICE_NAME parameter that allows the specification of multiple addresses for a single service. The address list might look like the following if the service were named MICKEY and there were listeners on port 152 and port 1526:

(ADDRESS_LIST =
 (SOURCE_ROUTE = OFF)
 (LOAD_BALANCE = ON)
 (FAILOVER = ON)
 (ADDRESS = (PROTOCOL = TCP)
 (HOST = MOUSE)
 (PORT = 1521))
 (ADDRESS = (PROTOCOL = TCP)
 (HOST = MOUSE)
 (PORT = 1526))
)
(CONNECT_DATA =
(SERVICE_NAME = MICKEY)
)

The next lesson shows how to start a Net listener service with Enterprise Manager.

Add Net Features - Exercise

Click the Exercise link below to practice making a tnsnames.ora entry for multiple addresses.
Add Net Features - Exercise