Network Admin   «Prev  Next»

Lesson 2 Using Connection Manager
Objective Configure and run the Connection Manager.

Configure and run the "Connection Manager" in Oracle 19c

Oracle Connection Manager (CMAN) is a proxy server that enables network traffic filtering, multiplexing, and load balancing between clients and database servers.
1. Install and Configure Oracle Connection Manager
Oracle Connection Manager comes bundled with Oracle Database and needs to be configured using the CMAN.ORA file.
Step 1: Verify CMAN Installation
On Oracle 19c, CMAN is typically installed in the Oracle Home directory.
To check if CMAN is installed:
cd $ORACLE_HOME/bin
ls cmctl

If `cmctl` exists, CMAN is installed.
2. Configure CMAN in `cman.ora`
Edit or create the `cman.ora` file located at:
$ORACLE_HOME/network/admin/cman.ora

Example Configuration (`cman.ora`):
CMAN =
  (CONFIGURATION=
    (ADDRESS=(PROTOCOL=TCP)(HOST=your-cman-host)(PORT=1522))
    (RULE_LIST=
      (RULE=
        (SRC=192.168.1.*)
        (DST=*)
        (SRV=*)
        (ACT=ACCEPT))
    )
    (PARAMETER_LIST=
      (MAX_CONNECTIONS=5000)
      (IDLE_TIMEOUT=300)
      (LOG_LEVEL=1)
      (TRACING=YES)
    )
  )

Key Parameters:
  • ADDRESS: Defines the listener for CMAN on port 1522.
  • RULE_LIST: Controls client access:
    • (SRC=192.168.1.*): Accepts connections from 192.168.1.x subnet.
    • (DST=*): Allows connections to any destination.
    • (SRV=*): Permits all services.
    • (ACT=ACCEPT): Accepts the connections.
  • MAX_CONNECTIONS=5000: Limits concurrent connections.
  • IDLE_TIMEOUT=300: Disconnects idle connections after 5 minutes.
  • LOG_LEVEL=1: Enables basic logging.
  • TRACING=YES: Enables debugging logs.

3. Start the Oracle Connection Manager
Once the configuration is in place, start CMAN using the `cmctl` utility.
Start CMAN
$ORACLE_HOME/bin/cmctl start

Check CMAN Status
$ORACLE_HOME/bin/cmctl status

Stop CMAN
$ORACLE_HOME/bin/cmctl stop

4. Configure Clients to Use CMAN
The client’s `tnsnames.ora` file must be updated to route connections through CMAN.
Example `tnsnames.ora` for CMAN Routing
MYDB_CMAN =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST=your-cman-host)(PORT=1522))
    (ADDRESS=(PROTOCOL=TCP)(HOST=your-db-host)(PORT=1521))
    (CONNECT_DATA=
      (SERVICE_NAME=ORCLDB))
  )

How This Works:
  1. Clients connect to your-cman-host on port 1522.
  2. CMAN forwards the connection to the actual database host on port 1521.

5. Verify Connection through CMAN
Use `tnsping` to test the connection:
tnsping MYDB_CMAN
Or connect with `sqlplus`:
sqlplus user/password@MYDB_CMAN

6. Enable Multiplexing (Optional)
To enable multiplexing, modify `cman.ora`:
(PARAMETER_LIST=
  (MULTIPLEX=ON)
  (MIN_RELAYS=2)
  (MAX_RELAYS=5)
)

  • MULTIPLEX=ON: Enables connection multiplexing.
  • MIN_RELAYS=2: Keeps at least 2 relays active.
  • MAX_RELAYS=5: Limits active relays to 5.

Restart CMAN:
$ORACLE_HOME/bin/cmctl stop
$ORACLE_HOME/bin/cmctl start

7. Enable Logging and Debugging (Optional)
To enable debugging logs, modify `cman.ora`:
(LOG_DIRECTORY=/opt/oracle/logs)
(LOG_LEVEL=3)

Logs will be stored in `/opt/oracle/logs`.
Restart CMAN to apply changes:
$ORACLE_HOME/bin/cmctl stop
$ORACLE_HOME/bin/cmctl start

Summary of Steps:
  1. Verify CMAN is installed (ls $ORACLE_HOME/bin/cmctl).
  2. Configure cman.ora with the CMAN listener and rules.
  3. Start CMAN (cmctl start).
  4. Update tnsnames.ora to route traffic through CMAN.
  5. Test the connection (tnsping and sqlplus).
  6. (Optional) Enable multiplexing to optimize connections.
  7. (Optional) Enable logging for debugging.

Connection Manager Overview

Oracle Connection Manager is a multipurpose networking solution that offers increased scalability, multiprotocol connectivity and secure network access control. It offers the following features to Oracle network:
  1. Connection multiplexing
  2. Access control
  3. Source routing
  4. Multiprotocol Support
  5. Firewall Proxy Support
Oracle Connection Manager enables large numbers of users to connect to a single server by acting as a connection concentrator to funnel multiple client database sessions across a single network connection. This is done through multiplexed network connections, a networking feature included with Oracle Net. Oracle Connection Manager reduces operating system resource requirements by minimizing the number of network connections made to a server. Network bottlenecks are thus avoided and system scalability significantly increases so that thousands of users can now access a single database.
To configure Connection Manager
  1. run the (CMAN) Connection Manager,
  2. Oracle Net Manager or
  3. CMAN utility (line commands).

  • Configuring the Connection Manager
    Oracle Connection Manager[1] is automatically installed when you install Oracle Enterprise Edition.
    Its default configuration listens for TCP/IP connections on port 1630.
    It also listens for administration commands (issued from Oracle Net Manager or CMAN) on the TCP/IP port 1830. If you need to change these defaults (for example, if you must assign the Connection Manager to a different port), you must create a cman.ora file and locate it in the same directory as the tnsnames.ora file. An example of the cman.ora file (including good documentation of the parameters) is provided in the
    ORACLE_HOME\Network\Admin\Sample directory.
    

Here is what a typical cman.ora file looks like:

Example of cman.ora file

cman = (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=)
      (PORT=1630)
      (QUEUESIZE=32))
       )
cman_admin = (ADDRESS=(PROTOCOL=tcp)
   (HOST=)
   (PORT=1830))
cman_profile = (parameter_list=
                (MAXIMUM_RELAYS=1024)
                (LOG_LEVEL=1)
                (TRACING=no)
                (RELAY_STATISTICS=yes)
                (SHOW_TNS_INFO=yes)
                (USE_ASYNC_CALL=yes)
                (AUTHENTICATION_LEVEL=0)
                (REMOTE_ADMIN=FALSE)
              )

We will discuss the parameters needed for features such as multiplexing later in this module.

Running the Connection Manager

You should use the CMAN utility to run the Connection Manager. You can view the status of the Connection Manager, start the service, and stop the service using this utility. Follow along with the SlideShow to see how to start, show status, and stop the Connection Manager.

Running Oracle Connection Manager

1) Begin by opening an operating system session.
1) Begin by opening an operating system session

2) Issue the status command to see what the Connection Manager is currently doing
2) Issue the status command to see what the Connection Manager is currently doing

3) Issue the start cman command to start up the CMAN and ADMIN processes. The CMAN process is the one that actually runs the Connection Manager and the ADMIN process is the one that accepts commands to modify or monitor the Connection Manager
3) Issue the start cman command to start up the CMAN and ADMIN processes. The CMAN process is the one that actually runs the Connection Manager and the ADMIN process is the one that accepts commands to modify or monitor the Connection Manager

4) The setting will only take effect until the Connection Manager is shut down.
4) The setting will only take effect until the Connection Manager is shut down.

5) Issue the shutdown command to stop the Connection Manager
5) Issue the shutdown command to stop the Connection Manager

The Connection Manager can help you streamline the handling of multiple connections into your database. The following section discusses more about starting and stopping the Connection Manager.

Start and stop the Connection Manager

Run the following commands from the MS-DOS prompt:
C:>cmctl  
CMCTL>status 
CMCTL>start 
CMCTL>show all 
CMCTL>shutdown 

Oracle Connection Manager Configuration File (CMAN.ORA)

The Connection Manager configuration file (CMAN.ORA) contains the parameters that specify preferences for using Oracle Connection Manager.
cman = (address_list=
(address = (protocol=tcp)(host=anyhost)(port=1610))
(address = (protocol=tcp)(host=anyhost)(port=1620))
)
cman_profile = (parameter_list=
(maximum_relays=512)
(log_level=1)
(tracing=yes)
(trace_directory=/oracle/network/trace)
(relay_statistics=yes)
(show_tns_info=yes)
(use_async_call=yes)
(authentication_level=0)
)
# the following specifies a rule for single access control #
cman_rules = (rule_list=
(rule=(src=spcstn)(dst=x)(srv=x)(act=accept))
)

CMCTL (Connection Manager Control Utility) commands still valid in Oracle 19c

The CMCTL (Connection Manager Control Utility) commands are still valid in Oracle 19c, but there have been enhancements and some changes in behavior. Changes in CMCTL for Oracle 19c:
  1. Commands are still available:
    • The following commands remain supported in Oracle 19c:
              C:> cmctl
              CMCTL> status
              CMCTL> start
              CMCTL> show all
              CMCTL> shutdown
              
    • These commands are used to start, stop, and check the status of the Oracle Connection Manager.
  2. Enhanced Security Model:
    • CMCTL now requires authentication using the -user flag to specify an administrative user.
      Example:
              cmctl -user admin
              
    • This change aligns with tightened security policies in newer Oracle versions.
  3. Changes in Configuration Files (cman.ora):
    • The format and parameters in cman.ora have been enhanced in Oracle 19c.
    • New features added:
      • Traffic Director Mode (CMAN-TDM)
      • Multiplexing improvements
      • IP rate limiting
      • Better logging and tracing options
  4. New Way to Start CMAN in Oracle 19c:
    • The modern approach to starting Oracle Connection Manager in 19c is:
              cmctl start
              
    • To check the status:
              cmctl status
              
    • To shut down CMAN:
              cmctl shutdown
              
  5. Deprecation of CMAN with Oracle RAC:
    • CMAN in Traffic Director Mode (TDM) is recommended for load balancing.
    • Older static configurations are less favored, but they still work.

Conclusion:
  • CMCTL commands from Oracle 8i still work in Oracle 19c with minor security enhancements.
  • Authentication is now required when starting CMCTL.
  • Configuration files (cman.ora) have been improved.
  • Traffic Director Mode (CMAN-TDM) is recommended for better performance.

The next lesson covers multiplexing.
[1] Connection Manager: A service that can be run along with Net8 to control multiple connections going to a Multi-Threaded Server.

SEMrush Software 2 SEMrush Banner 2