The general format of LKE commands is:
command [-qualifier[=qualifier-value]]
LKE accepts command and qualifier abbreviations. The section describing each command provides the minimal abbreviation that can be used for that command, and the command qualifiers, if any. FIS recommends the use of a minimum of four characters for key words in scripts to ensure new keywords do not conflict with older scripts.
Use the CLEAR command to remove active
LOCKs.
![]() | Caution |
|---|---|
FIS recommends restricting the use of the LKE CLEAR facility to debugging environments; removing LOCKs in a production environment typically violates application design assumptions and can cause aberrant process behavior. GT.M automatically removes abandoned LOCKs so it is typically safer to MUPIP STOP a process that is inappropriately hanging on to a LOCK. |
The format of the CLEAR command is:
C[LEAR] [-qualifier...]
The optional qualifiers are:
-A[LL] -L[OCK] -[NO]C[RIT] -[NO]EXACT -[NO]I[NTERACTIVE] -O[UTPUT]="file-name" -P[ID]=pid -R[EGION]=region-name
By default, CLEAR operates interactively
(-INTERACTIVE).
Qualifiers for CLEAR
-A[LL]
Specifies all current LOCKs.
-ALL removes all current LOCKs.
If used,
CLEARand-REGIONqualifier,-ALLremoves all LOCKs in that region.Issue a
CLEAR - ALLonly when there are no active GT.M processes using LOCKs, or when you can predict the effect on the application.By default,
CLEAR -ALLoperates interactively (-INTERACTIVE).
-[NO]C[RIT]
Allows LKE CLEAR to work even if another process is
holding a critical section.
![]() | Caution |
|---|---|
This can damage current LOCKs and the LOCK mechanism. It is intended for use only under the direction of FIS. |
By default LKE operates in CRIT mode and ensures a consistent view of LOCKs by using the database critical section(s).
-[NO]EXACT
Limits the CLEAR command to the exact resource name specified
with -LOCK=resource_name. NOEXACT (the default) treats the specified resource name as a prefix and works not only on it, but also on any of its descendants, since their existence effectively LOCK their parent tree.
-L[OCK]=""resource_name""Unless used with -EXACT, specifies the leading prefix for an implicit wild card search of all locks that start with the resource_name.
The
resource_nameis enclosed in two double quotation marks ("" ""). Because M resource names are formatted the same as global nodes with punctuation characters, in this context they are usually enclosed in sets of double quotation marks with string subscripts enclosed in sets of two double quotations.When used with CLEAR, -LOCK removes the locks that start with
resource_name.When used with SHOW,-LOCK provides a precise way to examine the specified lock.
-[NO]I[NTERACTIVE]
Interactively clears one LOCK at a time. LKE displays each
current LOCK with the PID of the owner process and
prompts for verification that the LOCK should be cleared. LKE retains
the LOCK for any response other than
Y[ES].
By default,
CLEARoperates interactively (-INTERACTIVE).To avoid holding a lock resource too long, LKE skips to the next matching LOCK if there is no operator response for several seconds.
-NOINTERACTIVEforces the action to take place without user confirmation of each change. Using-NOINTERACTIVEprevents the LKE operator from controlling the LOCK subsystem for potentially long periods of time when many locks are held. To do this, it limits the amount of time it waits for each response.
-O[UTPUT]="file-name"Directs the reporting of all specified LOCKs to a file.
If you specify an existing file, LKE creates a new version and overwrites that file.
If
file-namehas permission issues,OUTPUTreports the cause of the error.The
-OUTPUTqualifier is compatible with all other qualifiers.By default,
CLEARsends output messages tostdout.
-P[ID]=pid
Specifies the process identification number that holds a LOCK on a resource name.
LKE interprets
pidas a decimal number.PID clears LOCKs held by the process with the specified process identification number.
Provides a means for directing
CLEARto LOCKs held by a process that is behaving abnormally.The
-PIDqualifier is compatible with all other qualifiers.
-R[EGION]=region-nameregion-namespecifies the region that
holds the locked resource names.
REGIONclearsLOCKsmapped by the current global directory to a region specified by the region-name.The
-REGIONqualifier is compatible with all other qualifiers.By default,
CLEAR -REGION=operates interactively (-INTERACTIVE).
Example:
LKE>CLEAR -ALL
This command clears all current LOCKs.
Example:
LKE>clear -pid=2325 -interactive
This command presents all LOCKs held by the process with
PID equal to 2325. You can choose whether or not to
clear each LOCK.
LKE>clear -reg=areg -interactive
This command produces an output like the following:
AREG ^a Owned by PID= 2083 which is an existing process Clear lock ?
Type Yes or
Y in response to the prompt.
LKE responds with an informational message:
%GTM-S-LCKGONE, Lock removed : ^a
Type Yes or
N or No or N
until all LOCKs are displayed and acted upon.
LKE> clear -pid=4208 -nointeractive
This command clears the lock held by a process with PID 4208. This command produces an output like the following:
DEFAULT Lock removed : ^A
Note that -NOINTERACTIVE forced the action
without asking for a confirmation.
Example:
LKE>clear -lock="^a("b")
Clear lock ? y
Lock removed : ^a("b")
LKE>This command clears lock ^a("b") in the default
region.
Example:
LKE>clear -lock="^a" -nointeractive
This command clears all the locks that start with "^a" in the
default region. -NOINTERACTIVE qualifier instructs LKE
to clear these locks without further user intervention.
Example:
LKE>clear -lock="^a" -exact -nointeractive
This command clears lock ^a in the default
region. -NOINTERACTIVE instructs LKE to clear
lock ^a without further user intervention.
Example:
LKE>CLEAR -PID=4109 -LOCK=""^A"" Clear lock ? Y Lock removed : ^A LKE>
This command clears LOCK ^A held by process
with PID 4109.
Use the SHOW command to get status of the LOCK
mechanism and the LOCK database. The format of the SHOW command is:
SH[OW] [-qualifier...]
The optional qualifiers are:
-A[LL] -L[OCK] -[NO]C[RIT] -O[UTPUT]="file-name" -P[ID]=pid -R[EGION]=region-name -W[AIT]
By default,
SHOWdisplays-A[LL].The
SHOWcommand reports active LOCKs. Information includes the LOCK resource name and the process identification (PID) of the LOCK owner.LKE SHOW displays lock space usage with a message in the form of: "%GTM-I-LOCKSPACEUSE, Estimated free lock space: xxx% of pppp pages." If the lock space is full, it also displays a LOCKSPACEFULL error.
A LOCK command which finds no room in LOCK_SPACE to queue a waiting LOCK, does a slow poll waiting for LOCK_SPACE to become available. If LOCK does not acquire the ownership of the named resource with the specified timeout, it returns control to the application with $TEST=0. If timeout is not specified, the LOCK command continues to do a slow poll till the space becomes available.
LOCK commands which find no available lock space send a LOCKSPACEFULL message to the operator log. To prevent flooding the operator log, GT.M suppresses further such messages until the lock space usage drops below 75% full.
The results of a
SHOWmay be immediately "outdated" byM LOCKactivity.If the LOCK is owned by a GT.CM server on behalf of a client GT.M process, then
LKE SHOWdisplays the clientNODENAME(limited to the first 15 characters) and clientPID. The clientPID (CLNTPID)is a decimal value in UNIX.![[Note]](../common/images/note.jpg)
Note GT.CM is an RPC-like way of remotely accessing a GT.M database.
-ALL
Specifies all current LOCKs.
-ALLdisplays all current LOCKs in all regions and information about the state of processes owning these LOCKs.The
-ALLqualifier is compatible with all other qualifiers.When
-ALLis combined with-PIDor-REGION,the most restrictive qualifier prevails.SHOW -ALLand-WAITdisplays both-ALLand-WAITinformation.
-L[OCK]=resource_nameresource_name specifies a single
lock.
The
resource_nameis enclosed in double quotation marks ("" ""). Because M resource names are formatted the same as global nodes with punctuation characters, in this context they are usually enclosed in sets of double quotation marks with string subscripts enclosed in sets of two double quotations.When used with the
CLEARcommand, theLOCKqualifier removes the specified lock.When used with the
SHOWcommand, theLOCKqualifier provides a precise way to examine the specified lock and any descendant LOCKed resources.
-[NO]C[RIT]
Allows the SHOW command to work even if another
process is holding a critical section.
By default LKE operates in
CRITmode and ensures a consistent view of LOCKs by using the database critical section(s).Use
NOCRITwithSHOWonly when normal operation is unsuccessful, asNOCRITmay cause LKE to report incomplete or inconsistent information.
-O[UTPUT]="file-name"Directs the reporting of all specified LOCKs to a file.
If you specify an existing file, LKE creates a new version and overwrites that file.
The
-OUTPUTqualifier is compatible with all other qualifiers.By default, the
SHOWcommand send output messages to stdout.
-P[ID]=pidSpecifies the process identification number that holds a LOCK on a resource name.
LKE interprets
pidas a decimal number.PIDdisplays all LOCKs owned by the specified process identification number.The
-PIDqualifier is compatible with all other qualifiers; the most restrictive of the qualifiers prevails.By default,
SHOWdisplays the LOCKs for all PIDs.
-R[EGION]=region-nameSpecifies the region that holds the locked resource names.
The
REGIONqualifier displays LOCKs of that specified region.The
REGIONqualifier is compatible with all other qualifiers; the most restrictive of the qualifiers prevails.By default,
SHOWdisplays the LOCKs for all regions.
-W[AIT]
Displays the LOCK resource name and the process state information of all processes waiting for the LOCK to be granted.
SHOW -WAITdoes not display the owner of the LOCK.SHOW -ALL -WAITdisplays both-ALLand -WAITinformation.When a process abandons a "wait" request, that request may continue to appear in
LKE SHOW -WAITdisplays. This appearance is harmless, and is automatically eliminated if the GT.M lock management requires the space which it occupies.
Use the following procedure to display all LOCKs active in the database(s) defined by the current global directory.
LKE> SHOW -ALL -WAIT
This produces an output like the following:
No locks were found in DEFAULT AREG ^a Owned by PID=2080 which is an existing process BREG ^b(2) Owned by PID= 2089 which is a nonexistent process No locks were found in CREG
Example:
LKE>SHOW -ALL
This command displays all LOCKs mapped to all regions of the current global directory. It produces an output like the following:
DEFAULT ^A Owned by PID= 5052 which is an existing process ^B Owned by PID= 5052 which is an existing process %GTM-I-LOCKSPACEUSE, Estimated free lock space: 99% of 40 pages
Example:
LKE>show -lock="^a"(""b"")"This command shows lock ^a("b") in the default
region.
Example:
LKE>SHOW -CRIT
This command displays all the applicable locks held by a process that is holding a critical section.
Example:
LKE>show -all -output="abc.lk"
This command create a new file called abc.lk that contains the
output of the SHOW -ALL command.
Example:
LKE>show -pid=4109
This command displays all locks held by process with PID 4109 and the total lock space usage.
Example:
LKE>show -region=DEFAULT -lock=""^A""
This command displays the lock on ^A in the
region DEFAULT. It produces an output like the
following:
DEFAULT ^A Owned by PID= 5052 which is an existing process %GTM-I-LOCKSPACEUSE, Estimated free lock space: 99% of 40 pages
The HELP command explains LKE commands. The format
of the HELP command is:
H[ELP] [options...]
Enter the LKE command for which you want information at the
Topic prompt(s) and then press RETURN or
CTRL-Z to return to the LKE prompt.
Example:
LKE> HELP SHOW
This command displays help for the SHOW
command.
Use the SPAWN command to create a sub-process for
access to the shell without terminating the current LKE environment.
Use the SPAWN command to suspend a session and issue
shell commands such as ls or
printenv.
The format of the SPAWN command is:
SP[AWN]
The SPAWN command has no qualifiers.
Example:
LKE>spawn
This command creates a sub-process for access to the current
shell without terminating the current LKE environment. Type
exit to return to LKE.


![[Caution]](../common/images/caution.jpg)
