Network Config   «Prev  Next»

Lesson 7Using the Connection Manager Control Utility (CMCTL)
Objective Use CMCTL to start and control Oracle Connection Manager.

Using Connection Manager Control Utility (CMCTL)

The "Connection Manager Control Utility (CMCTL)" is still used in Oracle 19c to 1) start, 2) stop, and 3) control Oracle Connection Manager. This utility remains relevant for managing Oracle Connection Manager[1] in environments where it is deployed to enable connection multiplexing, firewall support, and network traffic control.
Steps to Use CMCTL in Oracle 19c:
1. Set Up the Environment Before running CMCTL, ensure that the Oracle environment variables are correctly set. You may need to configure the following:
  • ORACLE_HOME: Path to your Oracle installation directory.
  • TNS_ADMIN: Directory containing the cman.ora file.

Example (Linux):
export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin

Example (Windows Command Prompt):
set ORACLE_HOME=C:\app\oracle\product\19c\dbhome_1
set PATH=%ORACLE_HOME%\bin;%PATH%
set TNS_ADMIN=%ORACLE_HOME%\network\admin

2. Start CMCTL
From the command prompt or terminal, run the CMCTL utility:
cmctl

This launches the utility in interactive mode.
3. Connect to Oracle Connection Manager
To manage Oracle Connection Manager, you must connect to it. Use the `admin` command with the appropriate credentials.
Example:
cmctl> admin cman_password

Replace `cman_password` with the password for the Connection Manager administrator.
4. Perform Operations You can now perform various operations with CMCTL:
  • Start Connection Manager:
    cmctl> start
    
  • Stop Connection Manager:
    cmctl> stop
    
  • Show Status:
    cmctl> show status
    
  • Reload Configuration:
    cmctl> reload
        
  • Help:
    cmctl> help
    



5. Exit CMCTL To exit the utility, type:
cmctl> exit

Note on Configuration
Ensure the `cman.ora` file is properly configured in the `$TNS_ADMIN` directory. This file defines the rules, profiles, and settings for Oracle Connection Manager.

By following these steps, you can effectively use CMCTL to manage Oracle Connection Manager in Oracle 19c.


Purpose of issuing CMCTL commands

CMCTL commands in Oracle are used to manage the Oracle Connection Manager. This is a utility that sits between clients and database servers, acting as a lightweight, secure gateway. It can improve performance, scalability, and security in various network configurations.
The following section describes what CMCTL commands allow you to do:
  1. Start and Stop the Connection Manager:
    • STARTUP: Starts the Connection Manager.
    • SHUTDOWN: Stops the Connection Manager gracefully.
  2. Configuration:
    • SET: Allows you to modify Connection Manager parameters dynamically (e.g., logging level, tracing options). These changes are temporary and don't persist after a restart.
    • SAVE_PASSWD: This is an exception to the temporary nature of SET commands. It allows you to change and save the Connection Manager's password.
  3. Monitoring and Troubleshooting:
    • SHOW: Displays various information about the Connection Manager's status, including:
      • SHOW STATUS: Overall health and statistics.
      • SHOW RULES: Routing rules configured for connections.
      • SHOW GATEWAYS: Information about active gateway processes.
      • SHOW CONNECTIONS: Details about current client connections (if connection statistics are enabled).
    • SET EVENT: Enables or disables event logging for debugging.
    • SET LOG_LEVEL: Controls the verbosity of log messages.
  4. Gateway Management:
    • SHOW GATEWAYS: Lists active gateway processes.
    • RESUME GATEWAYS: Restarts any suspended gateway processes.
  5. Connection Control:
    • ACCEPT_CONNECTIONS ON | OFF: Dynamically enables or disables the Connection Manager's ability to accept new client connections.

Why use CMCTL?
  • Centralized Administration: Manage multiple Connection Managers from a single point.
  • Dynamic Configuration: Adjust parameters without restarting the Connection Manager.
  • Troubleshooting: Diagnose connection problems and gather performance data.
  • Security: Control access to the database server and protect sensitive information.

How to use CMCTL: You can use CMCTL in two ways:
  • Interactive Mode: Type cmctl at the command prompt, and then enter commands one by one.
  • Batch Mode: Create a text file with a sequence of CMCTL commands and run it using cmctl @filename.

If you have a specific task in mind or want to know more about a particular command, provide more details, and I'll do my best to assist you.


CMCTL utility for managing Connection Manager

  1. Oracle 11g includes the CMCTL utility for managing Connection Manager. The utility provides improved functionality and a more modernized interface compared to Oracle 8.
  2. To invoke CMCTL, open a terminal and enter the cmctl command. This will start the CMCTL program.
  3. Once inside the CMCTL prompt, you can issue commands to start, stop, monitor, and manage the Connection Manager processes.

Example: Starting CMCTL in Oracle 11g
$ cmctl

CMCTL for Linux: Version 11.2.0.4.0 - Production on 25-MAR-2024 15:23:40

Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.

CMCTL>

Example: Viewing Help in Oracle 11g
CMCTL> help

CMCTL for Linux: Version 11.2.0.4.0 - Production on 25-MAR-2024 15:26:51

Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.

CMCTL usage: [cmctl] <command> <process_name> [argument]
  where <command> is one of the following:
    * start   - Start the specified process_name
    * stop    - Stop the specified process_name
    * status  - Get status of the specified process_name
    * stats   - Get statistics of the specified process_name
    * version - Display version of the CMCTL program
    * exit    - Quit the CMCTL program

  process_name is one of:
    * cman - Target both the Connection Manager and Admin processes
    * cm   - Target only the Connection Manager process
    * adm  - Target only the Connection Manager Admin process

Notes for Oracle 11g:
  1. The cmctl help command now provides a more structured output, showing clearly defined commands and their descriptions.
  2. You can use these commands to control the Connection Manager's behavior and monitor its performance in real-time.

Example: Checking Connection Manager Status
CMCTL> status cman

CMCTL for Linux: Version 11.2.0.4.0 - Production on 25-MAR-2024 15:28:01

Connection Manager Status:
  Status: Running
  Connections: 24 active, 50 maximum
  Uptime: 2 days, 5 hours, 12 minutes

CMCTL>

Key Enhancements in Oracle 11g CMCTL:
  • Improved output clarity and formatting.
  • Enhanced monitoring with uptime and active connection statistics.
  • Better process management with targeted commands for specific components (cman, cm, or adm).

This update aligns with Oracle 11g's enhanced usability and functionality while maintaining continuity for users familiar with earlier versions.
In the next lesson, you will learn the commands that are used to start and stop the Connection Manager.

[1]Oracle Connection Manager: Oracle Connection Manager (CMAN) is a proxy server that sits between clients and database servers, forwarding client connection requests to the appropriate database. It enhances security by filtering connections based on pre-defined rules, such as IP address or protocol. CMAN also improves performance by routing connections efficiently and can facilitate connections between clients and databases using different network protocols.

SEMrush Software