Network Admin   «Prev  Next»

Lesson 3 Oracle Net multiplexing
Objective Configure Oracle Net for multiplexing.

Oracle Net Multiplexing Configuration

Multiplexing[1] was a feature introduced in Oracle8i. Multiplexing is also called connection concentration, which means that it requires that you have a Multi-Threaded Server (such as Oracle Shared Server) and that you configure Oracle Net and the Connection Manager to handle multiplexing.
  • Configuring the Oracle Database Server
    In addition to setting up the usual MTS parameters, you must add this parameter anywhere in your init.ora file:
    MULTIPLEX=YES
    

    This tells the server to allow multiplexed connections from the Connection Manager.
  • Configuring the Connection Manager
    Use the standard configuration for the Connection Manager, as described in the previous lesson. All the default settings are valid.
    The following parameters may require adjustments to support the kind of environment you have at your site:
    1. MAXIMUM_RELAYS:This parameter can range from 1 to 2048. It specifies the maximum number of concurrent connections that can be handled by the Connection Manager. The default value is 128.
    2. ANSWER_TIMEOUT: This parameter can range from zero to any number of seconds. The default value is zero. This parameter determines the number of seconds to wait before Connection Manager ends an attempt to make a handshake contact with an incoming connection.
    3. AUTHENTICATION_LEVEL: This parameter tells the Connection Manager about security. A zero (the default) tells the Connection Manager to accept any request coming into its port. A number 1 tells the Connection Manager to only accept (SNS) Secure Network Services requests. SNS is one of the Oracle Advanced Security (OAS) options.

  • If you need values other than the default values, you must create a cman.ora file and specify the values of these parameters.
    • Configuring Oracle Net
      You will need to configure two addresses for the database:
      1. one for the Connection Manager and
      2. one for the Oracle Net listener.

      This requires modifying the tnsnames.ora file. The following diagram explains the components of the file that you need.

tnsnames.ora file for Multiplexing consists of 1) source 2) and two ports in Oracle 19c

In "Oracle 19c", the TNSNAMES.ORA file for Multiplexing typically includes the following:
Example: Multiplexing in `tnsnames.ora` for Oracle 19c
MULTIPLEX_CONNECT =
  (DESCRIPTION =
    (SOURCE_ROUTE = YES)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = primary-server.example.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = primary-server.example.com)(PORT = 1630))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCLDB)
    )
  )

Explanation of the Components:
  1. SOURCE_ROUTE=YES: This ensures that both addresses are attempted sequentially.
  2. Two ADDRESS Entries:
    • PORT = 1521: The default listener port.
    • PORT = 1630: A secondary listener port for multiplexing.
  3. CONNECT_DATA with SERVICE_NAME: Ensures the correct service (e.g., ORCLDB) is targeted.

How This Works in Oracle 19c
  • Multiplexing allows clients to use multiple listener ports on the same server.
  • If one port is busy or overloaded, the client can attempt the next port in sequence.
  • This helps in load balancing and improves failover capabilities.
tnsnames.ora file for Multiplexing consisting of 1) source 2) and two ports
tnsnames.ora file for Multiplexing consisting of 1) source 2) and two ports
houseopets=
  (description=
    (source_route=yes)
    (address=
      (protocol=tcp)
      (host=atlanta.houseopets.com)
      (port=1630))
    (address=
      (protocol=tcp)
      (host=atlanta.houseopets.com)
      (port=1521))
    (connect_data=
      (service_name=houseopets.com)))

(source_route=yes) Tell the listener to start with the first address (which is the Connection Manager address) when connecting to the database.
(port=1630) This is the address of the Connection Manager. It uses the default port number (1630).
(port=1521) This is the address of the Net Listener. It will not be used unless the Connection Manger is shut down.

Once you have configured the Net listener and the Connection Manager, you must start up the Connection Manager and the listener. After that, your listener will route all transactions through the Connection Manager.

Configuring tnsnames.ora file for Multiplexing

Configuring the tnsnames.ora File During Installation

Oracle Net Configuration Assistant enables you to configure network service names for clients. Oracle Universal Installer launches Oracle Net Configuration Assistant after software installation. The configuration varies depending on the installation mode.
  1. Administrator or runtime installation: Oracle Net Configuration Assistant prompts you to configure network service names in the tnsnames.ora file to connect to an Oracle Database service.
  2. Custom installation: Oracle Net Configuration Assistant prompts you to select naming methods to use. If local is selected, then Oracle Net Configuration Assistant prompts you to configure network service names in the tnsnames.ora file to connect to an Oracle Database service.
  • Nomenclature for the Listener
    The nomenclature for the Listener remains largely the same across Oracle versions, including 8, 11g R2, and 19c. The core concept and name persist. Here's a breakdown and clarification:
    • LISTENER: This is the primary name and it remains consistent. You'll still configure and manage something called the "Listener." It's the process that listens for incoming client connection requests.
    • listener.ora: This is the configuration file for the Listener. The filename itself doesn't change. The contents of listener.ora will have version-specific parameters and settings, but the file itself is still named listener.ora.
    • LSNRCTL: This is the Listener Control utility. You use lsnrctl (pronounced "listener control") to start, stop, check the status of, and otherwise manage the Listener. This utility name is consistent across all mentioned versions. lsnrctl start, lsnrctl status, lsnrctl stop are all common commands.
    • Default Listener Name: While you can name your Listener anything you want (and it's common to have multiple Listeners in more complex environments), the default Listener name is, and has historically been, simply LISTENER (all caps). If you don't explicitly specify a name during configuration, Oracle will often default to this. This default name is consistent across versions.
    • Oracle Net Listener (or Oracle Net Services Listener): Sometimes you might see it referred to more formally as the "Oracle Net Listener" or "Oracle Net Services Listener". This is just a more descriptive name, referring to the fact that the Listener is part of Oracle's networking layer (Oracle Net Services). It's not a different name for the Listener process, just a more complete description.
    • Local Listener versus Grid Infrastructure Listener: In Real Application Clusters (RAC) environments, you'll encounter a slightly more nuanced situation. You'll still have "Listeners," but you have two main types:
      • Local Listener: This runs on each node of the RAC cluster and typically handles connections to instances on that specific node. The name may follow the default 'LISTENER', but you may name it something different.
      • SCAN Listener (Single Client Access Name): This is a cluster-wide concept. The SCAN provides a single name for clients to connect to the entire RAC cluster, regardless of which specific node they need to reach. The SCAN Listener(s) (there are usually three for redundancy) handle these connections and redirect them to the appropriate Local Listener. The SCAN Listener will have its own name defined in the cluster. The config files are typically managed by the grid infrastructure.

In Summary The fundamental name "LISTENER" doesn't change between Oracle 8, 11g R2, and 19c. The utility `lsnrctl` and the configuration file `listener.ora` are also consistent. The key differences are in the *configuration options* available within `listener.ora` and the presence of SCAN Listeners in RAC environments. The main point of confusion would arise if you consider RAC, and the two type of listeners (SCAN vs Local). However, even the *Local* Listener is still, conceptually and practically a listener that follows the naming of `LISTENER`.
The following section discusses connection pooling.

Configure Oracle Net for Multiplexing

The tnsnames.ora file that configures the Network Services listener to use Connect Manager and multiplexing should look something like this:
#E:\ORACLE\ORA81\NETWORK\ADMIN\TNSNAMES.ORA 
  Configuration File:E:\Oracle\Ora81\NETWORK\ADMIN\
     tnsnames.ora
# Generated by Oracle Network Services Assistant
PETS_ATLANTA =
  (DESCRIPTION =
    (SOURCE_ROUTE=YES)
    (ADDRESS_LIST =
      (ADDRESS = 
       (PROTOCOL = TCP)
       (HOST = ATLANTA.EPETS.COM)
       (PORT = 1630))
      (ADDRESS = 
      (PROTOCOL = TCP)
       (HOST = ATLANTA.EPETS.COM)
       (PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = HOUSEOPETS)
    )
  ) 

The next lesson covers connection pooling.

[1]Multiplexing: Combining several individual transmissions and sending them across a single connection to and from a database.

SEMrush Software 3 SEMrush Banner 3