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:
-
Clients connect to
your-cman-host
on port 1522.
-
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:
-
Verify CMAN is installed (
ls $ORACLE_HOME/bin/cmctl
).
-
Configure
cman.ora
with the CMAN listener and rules.
-
Start CMAN (
cmctl start
).
-
Update
tnsnames.ora
to route traffic through CMAN.
-
Test the connection (
tnsping
and sqlplus
).
-
(Optional) Enable multiplexing to optimize connections.
-
(Optional) Enable logging for debugging.
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:
- Connection multiplexing
- Access control
- Source routing
- Multiprotocol Support
- 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
- run the (CMAN) Connection Manager,
- Oracle Net Manager or
- CMAN utility (line commands).
Here is what a typical cman.ora file looks like:
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.
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.
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))
)