_Userlock VST:
- The _UserLock result set is much smaller than a _Lock query because it limits the number of locks per user instead of a scan of the entire lock table.
- _UserLock reports the first 512 lock entries for a particular user with "one request" to the lock subsystem
- _UserLock provides a snapshot per user per _user-lock record and not a changing picture as each _lock is per lock.
- The following restriction applies: if a single user has more than 512 locks, they will be missing in the _userlock array.
11.6.0 (Enhancement PSC00329196)_UserLock VST:
- In previous versions, the _UserLock VST reports the first 512 lock entries for a particular user
- The total number of locks held by this user and the lock type break down was included which makes it easier to identify which user or users are using excessive resources on the system.
- The following fields were added to _UserLock to provide the same information as:
PROMON > R&D > 3. Other Displays > 7. Total Locks per User
_UserLock-Total, _UserLock-Total-Record, _UserLock-Total-Table, _UserLock-Total-Purge, _UserLock-Total-RecGet, _UserLock-Total-Partition, _UserLock-Total-SHR, _UserLock-Total-EXCL, _UserLock-Total-IS, _UserLock-Total-SIX, _UserLock-Total-IX
- The _UserLock VST was also enhanced to be updated the same way the _lock vst avoids latching on the _LKT latch while traversing the lock table to avoid contention with the rest of the production environment. This will improve performance of the _UserLock query while avoiding the impact on the rest of the system.
Below is a sample program that could be used to display the information in the
_UserLock table. It is not the only way to display the information in this table. This example:
- Lists users that have 500 locks held
- Prevents the _UserLock arrays with 512 elements from fitting on the screen which would otherwise result in error 3307:
<segment-name> has exceeded its limit of <segment-size> bytes, in <file-name> at line # <line-number>. (3307)
DEFINE FRAME z WITH WIDTH-CHARS 120 12 DOWN.
FOR EACH _UserLock WHERE _UserLock-Usr <> ? AND
_UserLock-Type[500] <> ? NO-LOCK:
FIND _Connect WHERE _Connect._Connect-usr = _UserLock._UserLock-Usr
NO-LOCK NO-ERROR.
IF _UserLock._UserLock-Chain[500] <> ? OR
_UserLock._UserLock-Flags[500] <> ? OR
_UserLock._UserLock-Recid[500] <> ? OR
_UserLock._UserLock-Type[500] <> ?
THEN DO:
DISPLAY
_UserLock._UserLock-Chain[500] FORMAT ">>>9"
_UserLock._UserLock-Flags[500] FORMAT "X(5)"
_UserLock._UserLock-Recid[500] FORMAT ">>>>>>>>>>>>>>>9 "
_UserLock._UserLock-Type[500] FORMAT "X(5)"
_UserLock._UserLock-Usr FORMAT ">>>9"
_UserLock._UserLock-Name
SUBSTRING( _Connect._Connect-Device,6) WHEN AVAILABLE _connect WITH FRAME Z.
DOWN WITH FRAME Z.
END.
END.