sp_listener

Description

Dynamically starts and stops Adaptive Server listeners on any given port on a per-server basis.

Considerations for process mode

When executed in process mode, sp_listener dynamically starts and stops Adaptive Server listeners on any given port on a per-engine basis.

Syntax

For threaded mode, the syntax is:

sp_listener “command”, “server_name | network

Or:

sp_listener “command”, ‘[protocol:]machine:port:”CN=common_name”’

For process mode, the syntax is:

sp_listener “command”, “server_name | network”, engine | remaining

Or:

sp_listener “command”, ‘[protocol:]machine:port:”CN=common_name”’, engine

Parameters

command

can be any of:

  • start – starts a listener on the specified ports on each of the specified servers.

  • stop – terminates the specified listeners.

  • suspend – prevents the listener from accepting any more connections.

  • resume – instructs suspended listeners to resume listening.

  • status – report on the state of the listeners specified by the parameters. The state is one of: active, stopped, or suspended.

  • help – displays the sp_listener syntax.

server_name | network

is the name of the Adaptive Server, as specified in the interfaces file, or the name of the network.

engine

(Used only in process mode) specifies the number of the engine affected by this command. engine can be a single-engine number in quotes (“2”), a list (“3,5,6”), a range (“2 – 5”), or mix of all (“2,3 – 5,7”).

NoteWindows NT ignores the engine parameter.

remaining

specifies that the command is to take effect on all engines on which it can be meaningfully applied (that is, where the listener is in a state in which the command is can take effect).

protocol

the type of protocol; one of: tcp, tli, ssltcp, ssltli, winsock, sslnlwnsck, sslwinsock.

machine:port

the machine name and port number (as specified in the interfaces file) to which the listener connects.

CN=common_name

specifies a common name for the SSL certificate.

Use CN=common_name only if you specify ssltcp as the protocol. Adaptive Server validates the common_name you specify against the common_name in the SSL certificate. If you do not include CN=common_name, Adaptive Server uses server_name to validate against the common name in the SSL certificate. If you include a fully qualified domain name in the certificate, it must match CN=common_name.

Examples

Example 1

Start listeners for each master entry in the interfaces file corresponding to server orion:

sp_listener "start", "orion"

Example 2

Create TCP listeners for port number 4226:

sp_listener "start", "goldie:4226"

Example 3

Create listeners for all master entries in the interfaces file for server orion:

sp_listener "start", "orion", "remaining"

Example 4

Start TCP listeners on port 4226 on machine goldie for all engines not already listening to this port:

sp_listener "start", "goldie:4226", "remaining"

Example 5

Stop the listener on port number 4226:

sp_listener "stop", "tcp:goldie:4226"

Example 6

Stop all listeners on port number 4226. Because this command includes the remaining parameter, it will not fail if some engines are not listening to the port:

sp_listener "stop", "tcp:goldie:4226", "remaining"

Example 7

Suspend NT Winsock listener on port 4226:

sp_listener "suspend", "winsock:clouds:4226"

Example 8

Resume all active listeners on port number 4226:

sp_listener "resume", "tcp:goldie:4226", "remaining"

Example 9

Specify the common name ase1.big server 1.com:

sp_listener 'start','ssltcp:blade1:17251:
"CN=ase1.big server 1.com"','0'

Usage

Permissions

The permission checks for sp_listener differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be a user with manage server privilege.

Granular permissions disabled

With granular permissions disabled, you must be a user with sa_role.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

For limitations related to IPV6 in sp_listener, see “Specifying a common name” in “Confidentiality of Data,” in the Security Administration Guide.