Identifying users locking records
-
Topic author - Newbie
- Posts: 3
- Joined: Thu Jul 16, 2020 4:33 pm
- Reputation: 0
- Status: Offline
Identifying users locking records
What's the best way to determine which user/process is locking an ISAM or relative file record? We've tried a few different standalone "view record locks" utilities, but we haven't had much success getting them to work or integrating them into our software. We have a DCL command file that performs a "SHOW DEVICE/FILES" of each mounted volume and parses the data to idenfity the PIDs accessing a particular file, but that won't tell us which process is actually locking a particular record. Is there an easy way to get this info?
Re: Identifying users locking records
Hello
Have a look at blocking on the freeware v8
A utility to locate the holder of an RMS record lock that is blocking other processes
https://www.digiater.nl/openvms/freeware/v80/blocking/
Have a look at blocking on the freeware v8
A utility to locate the holder of an RMS record lock that is blocking other processes
https://www.digiater.nl/openvms/freeware/v80/blocking/
-
Topic author - Newbie
- Posts: 3
- Joined: Thu Jul 16, 2020 4:33 pm
- Reputation: 0
- Status: Offline
Re: Identifying users locking records
Thanks. That's one of the utilities we've tried in the past, but I ran into some issues when trying to use it for what we need. This version is for VAX or Alpha, and it doesn't appear to build on Integrity. It's possible that there's an updated version somewhere or that we could get it to work somehow, but even on Alpha it didn't encompass that we need.
If a file is opened exclusively, it gives an "%RMS-E-FLK, file currently locked by another user" error message. Ideally, we'd like to know who has the file locked, but we could work around that by using our "SHOW DEVICE/FILES" method. However, the bigger hurdle is that the utility requires us to know the key information of the locked record in order to see who has it locked. We rarely have that level of detail and I'm not 100% sure how that works with relative files (but I'm sure I could probably figure it out).
The scenario we're trying to address is when a user reports that their process is "stuck" and all we're able to determine is that they're likely spinning sequentially through a large file and have hit a locked record somewhere. We generally use a read wait method that waits until the required record has been freed up. It'd be a Herculean task to go through our whole system to identify every read, key read or sequential read, to trap the lock and throw the details somewhere we could view. As a result, we need a method that will tell us all the lock information for a particular file without knowing the exact record or records that are locked.
If a file is opened exclusively, it gives an "%RMS-E-FLK, file currently locked by another user" error message. Ideally, we'd like to know who has the file locked, but we could work around that by using our "SHOW DEVICE/FILES" method. However, the bigger hurdle is that the utility requires us to know the key information of the locked record in order to see who has it locked. We rarely have that level of detail and I'm not 100% sure how that works with relative files (but I'm sure I could probably figure it out).
The scenario we're trying to address is when a user reports that their process is "stuck" and all we're able to determine is that they're likely spinning sequentially through a large file and have hit a locked record somewhere. We generally use a read wait method that waits until the required record has been freed up. It'd be a Herculean task to go through our whole system to identify every read, key read or sequential read, to trap the lock and throw the details somewhere we could view. As a result, we need a method that will tell us all the lock information for a particular file without knowing the exact record or records that are locked.
Re: Identifying users locking records
Were I to have this problem, I would use SDA to look at the active process. I would expect the process to be in LEF state. Using SHOW PROCESS/CHANNEL, you would see the active files. A SHOW PROCESS/LOCK should indicate lock information that may provide the information you require.
Dan
Dan
-
Topic author - Newbie
- Posts: 3
- Joined: Thu Jul 16, 2020 4:33 pm
- Reputation: 0
- Status: Offline
Re: Identifying users locking records
Thank you. That sounds promising. I've tried ANAL/SYSTEM, but I'm having trouble understanding what to do with the info. The SHOW PROCESS/CHANNEL is easy enough. It list all the files and devices being accessed in plain terms (along with Channel, SSB, and Window columns). I can't figure out the SHOW PROCESS/LOCK info, though. You're correct that the process that's waiting for the locked record is in an LEF state. And the SHOW PROCESS/LOCK does dump out information when it's in this state, but I can't make heads or tails of it. If you can, could you explain how I would relate it to a specific file, record or which PID is causing the lock?abrsvc wrote: ↑Wed Aug 12, 2020 9:56 amWere I to have this problem, I would use SDA to look at the active process. I would expect the process to be in LEF state. Using SHOW PROCESS/CHANNEL, you would see the active files. A SHOW PROCESS/LOCK should indicate lock information that may provide the information you require.
Dan
-
- Master
- Posts: 199
- Joined: Fri Aug 14, 2020 11:31 am
- Reputation: 0
- Status: Offline
Re: Identifying users locking records
There is also the PWAIT$SDA SDA Extension, which can identify Blocking locks for a process.
Please see an example in one of my old DECUS presentations about OpenVMS SDA Extensions:
http://de.openvms.org/Spring2009/05-sda ... html#PWAIT
The PWAIT$SDA tool is available on Ian Millers Homepage on EISNER:
http://eisner.encompasserve.org/~miller/
Volker.
Please see an example in one of my old DECUS presentations about OpenVMS SDA Extensions:
http://de.openvms.org/Spring2009/05-sda ... html#PWAIT
The PWAIT$SDA tool is available on Ian Millers Homepage on EISNER:
http://eisner.encompasserve.org/~miller/
Volker.