Salesforce

How to terminate a database remote server process from a script?

« Go Back

Information

 
TitleHow to terminate a database remote server process from a script?
URL NameHow-to-terminate-a-database-remote-server-process-from-a-script
Article Number000180011
EnvironmentProduct: Progress
Version: 9.1E
Product: OpenEdge
Version: 10.x, 11.x
OS: All Supported Operating Systems
Question/Problem Description
How to terminate a database remote server process from a script?
Is it possible to trim _mprosrv and _sqlsrv2 processes without using the PROMON utility in interactive mode?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
Terminating any process using a kill / taskill command is not recommended. Specifically for remote Server Processes, it does not guarantee that there will be no users connected to the server process at the time the PID is killed which will result in a DBDOWN if that session was holding latches in shared memory at the time.

Unlike the KILL / taskill command, PROMON verifies that no users are currently connected to the process prior to terminating it.
  • Since Progress 9.1E and later, a _mprosrv (ABL remote server process) can be terminated using PROMON. 
  • Since OpenEdge 10.1C and later, the capability to terminate a _sqlsrv2 (SQL remote server process) was added to PROMON.
Never-the-less, caution should be exercised prior to terminating a remote server process to ensure that there are no users currently connected to the process being terminated, and no exclusive locks or latches are being held by the remote server process itself (for example remote servers cleaning up after disconnected clients).

Login Brokers (primary or secondary) cannot be terminated with this functionality. The Login Broker is the Broker that the client/server connection initially connects to with -S port that the Login Broker was started with _mprosrv, as opposed to the remote Server the client communicates with (on the -minport -maxport range) once connection is established which can be terminated with this PROMON utility.

In interactive mode the following PROMON menu actions terminate a remote server: 

R&D > 4: Administrative Functions > 7. Server Options > 7. Terminate a server > [server number] 

To script terminating a remote server process, use PROMON in non-interactive mode by providing and input file to the command.
Create a file, (trimsrv.txt) with the following entries, replacing the [server number] placeholder with the number of the remote server to terminate:

R&D
4
7
7
[server number]
(carriage return after [server number])


Add the following command to your script: 
promon dbname -NL < trimsrv.txt 

To correlate the server number to be terminated with the process id, refer to Article How to terminate a remote server process?   
Workaround
Notes

 
Keyword Phrase
Last Modified Date11/20/2020 7:09 AM

Powered by