Oracle Connection Manager Control Utility

cmctl使用方法类型lsnrctl

CMCTL> command

cmctl [command] [argument1 . . . argumentN] [-c instance_name]

cmctl @input_file

If an Oracle Connection Manager instance name is not provided, then the default instance name is assumed. The default name is cman_hostname.

Instances are defined in the cman.ora file.

注:交互模式不能使用instance选项,因此在进入交互模式时要先指定instance name

CMCTL> administer [-c] instance_name

(一)启/关/停gateway

To start Oracle Connection Manager.

cmctl STARTUP [-c instance_name]

To shut down specific gateway processes or the entire Oracle Connection Manager instance.

cmctl SHUTDOWN [gateways gateway] [normal | abort] [-c instance_name]

normal: To reject new connections and terminate after existing connections close. This is the default.

abort: To shut down Oracle Connection Manager immediately, and close all open connections.

cmctl RELOAD [-c instance_name]

The SET RELOAD command restores configurations set in cman.ora, and override the SET command.

To specify which gateway processes will no longer accept new client connections.

cmctl SUSPEND GATEWAY [gateway_process_id] [-c instance_name]

To resume gateway processes that have been suspended.

cmctl RESUME GATEWAYS [gateway_process_id] [cman_name]

gateway_process_id: One or more gateway processes to reopen. Separate multiple gateway processes using a space between the process identifiers.

Issuing RESUME GATEWAYS without an argument reopens all gateway processes that have been closed.

  • 查看gateway状态

cmctl HELP [command] [-c instance_name]

cmctl SHOW GATEWAYS [gateway] [-c instance_name]

cmctl SHOW SERVICES [-c instance_name]

cmctl SHOW STATUS

cmctl SHOW VERSION [-c instance_name]

  • 连接控制

查看连接

cmctl SHOW CONNECTIONS [information] [in state] [gt time] [from source]

[to destination] [for service] [using gateway_process_id]

[connect_identifier_list] [-c instance_name]

information: Specify one of the following values to display information about connections. Information categories include connection identifier, source, destination, service, current state, total idle time, and total elapsed time.

count: The total number of connections that meet the criteria specified by the other qualifiers. This is the default.

detail: All information about connections specified by the other qualifiers.

Examples

CMCTL> SHOW CONNECTIONS gt 1:30:00 from 192.0.2.32/24 to host1

关闭连接

$ cmctl CLOSE CONNECTIONS [in state] [gt [hh:mm:]ss ] [from source] [to destination]

[for service] [using gateway_process_id] [connect_identifier_list][-c cman_name]

state: One of the following values to specify the connection state:

idle: Connections that are inactive in the established state.

connecting: Connections that are in the process of connecting.

established: Connections that are connected and are transferring data.

terminating: Connections that are disconnecting.

If no state is specified, then CLOSE CONNECTIONS defaults to all possible states.

source: The source address. Use one of the following formats to specify the source address:

from IP, from hostname, from subnet

destination: The destination address:

from IP, from hostname, from subnet

service: The service name. Use the service_name parameter to specify the service, such as sales.us.example.com.

gateway_process_id:

The gateway process identifier is a number. Use this number to specify connections that are proxied by the gateway process indicated. To determine the gateway process identifier, use the Oracle Connection Manager control utility show gateways command.

connect_identifier_list: The connection identifiers. Use a space between multiple connection identifiers in a list.

Usage Notes:

Because the CLOSE CONNECTIONS command terminates connections, it might generate error messages on both client and server sides.

The IDLE state qualifier always requires a time qualifier.

Issuing CLOSE CONNECTIONS without an argument closes all connections.

Examples

The following example shuts down connections in any state. The elapsed time of the connection must be greater than 1 hour and 30 minutes. The connection source is the specified subnet, and the destination is the specified host name.

CMCTL> CLOSE CONNECTIONS gt 1:30:00 from 192.0.2.32/24 to host1

The following example shuts down those connections proxied by gateway process 0 that have been in the idle state more than 30 minutes:

CMCTL> CLOSE idle CONNECTIONS gt 30:00 using 0

参数设置

查看参数

cmctl SHOW [-c instance_name]

cmctl SHOW ALL [-c instance_name]

To combine and display output from the SHOW PARAMETERS and SHOW RULES commands.

cmctl SHOW DEFAULTS [-c instance_name]

To display default parameter settings.

cmctl SHOW EVENTS [-c instance_name]

cmctl SHOW PARAMETERS [-c instance_name]

To display current parameter settings for an instance.

Several configuration parameters can be dynamically modified using the SET command. Therefore, the information that SHOW PARAMETERS displays might be different from what appears in the cman.ora file.

cmctl SHOW RULES [-c instance_name]

To display the access control list currently used by the instance.

设置参数

cmctl set     --查看可设置参数

  1. To indicate whether the client must use Oracle Database security to authenticate.

cmctl SET ASO_AUTHENTICATION_FILTER {on | off (default)}[-c instance_name]

  1. To specify whether gateway processes collect connection statistics.

cmctl SET CONNECTION_STATISTICS {yes | no(默认)}[-c instance_name]

If SET CONNECTION_STATISTICS is set to yes, then you can obtain statistics by issuing the show connections command.

  1. To log information for a particular event.

cmctl SET EVENT event_group [-c instance_name]

event_group: Specify one of the following event groups:

init_and_term: Initialization and termination event group.

memory_ops: Memory operations event group.

conn_hdlg: Connection handling event group.

proc_mgmt: Process management event group.

reg_and_load: Registration and load update event group.

wake_up: Events related to Connection Manager Administration (CMADMIN) wakeup queue event group.

timer: Gateway timeouts event group.

cmd_proc: Command processing event group.

relay: Events associated with connection control blocks event group.

The SET EVENT command accepts only one argument. To log multiple events, you must issue the command for each event separately.

  1. To specify the amount of time a client can be idle without transmitting data. 

时间单位秒,默认为0即disable this feature

cmctl SET IDLE_TIMEOUT [time] [-c instance_name]

  1. To specify the maximum amount of time the Oracle Connection Manager listener waits for a valid connection request from the client before timing out.

cmctl SET INBOUND_CONNECT_TIMEOUT [time] [-c instance_name]

  1. 目录与文件

cmctl SET LOG_DIRECTORY [directory_path] [-c instance_name]

只用于未开启ADR时,默认为ORACLE_HOME/log

cmctl SET LOG_LEVEL [level] [-c instance_name]

level: Specify one of the following log levels:

off: No logging.

user: User log information.

admin: Administrative log information

support: Oracle Support Services log information. This is the default.

Specify off to capture the minimum amount of log information. Specify support to capture the maximum amount.

cmctl SET TRACE_DIRECTORY [directory_path] [-c instance_name]

This command works only if Automatic Diagnostic Repository (ADR) is not enabled. The default is for ADR to be enabled. The default path is ORACLE_HOME/network/trace.

cmctl SET TRACE_LEVEL [level] [-c instance_name]

level: off|user|admin|support

  1. To specify the maximum amount of time the Oracle Connection Manager instance waits for a valid connection with the server before timing out.

cmctl SET OUTBOUND_CONNECT_TIMEOUT [time] [-c instance_name]

time: The outbound connect timeout in seconds. The default is 0.

  1. To specify the maximum amount of time for a session of Oracle Connection Manager.

cmctl SET SESSION_TIMEOUT [time] [-c instance_name]

time: The session timeout in seconds. The default is 0 (zero), which disables this feature.

密码设置

cmctl SET PASSWORD

This command does not save the password to cman.ora. As a result the password is valid only for the current session. To save the password after you have set it, run the save_passwd command.

To save the current password to the cman.ora file

cmctl SAVE_PASSWD [-c instance_name]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值