Operating System - OpenVMS
1748025 Members
3819 Online
108757 Solutions
New Discussion юеВ

Re: Finding Record Locks

 
SOLVED
Go to solution
Andy Bustamante
Honored Contributor

Re: Finding Record Locks


Adding to Volker's comment, AM also has the ability to configure access levels, see the documentation for configuration option of SYS$MANAGER:AMDS$DRIVER_ACCESS.DAT. The default access is monitoring. You also have the ability to adjust quotas, force quorum to be recalculated or even crash a node remotely.

I presently use Windows 2000 server with AM on the local LAN segment. With Terminal Services I can control the PC remotely. Access is restricted by VPN accounts.


Andy
If you don't have time to do it right, when will you have time to do it over? Reach me at first_name + "." + last_name at sysmanager net
Hein van den Heuvel
Honored Contributor

Re: Finding Record Locks

>>> Hein - could you email me an OBJ of your tool - ratkinson-at-tbs-ltd-dot-co-dot-uk.

You can download a (slightly older) executable from the OpenVMS freeware site, or request an account on eisner.decus.org or the deathrow cluster (just google +openvms +deathrow)

>>> My assumption is that I'm going to have to cobble together a mixture of tools to do this, which is very annoying, as the code within the application we use is capable of telling you who is locking the record but only sends a message every 10 minutes!

IF your (batch) application waits for the lock then my tool will do it all, giving it the batch job process ID. ANAL/SYS... set proce 'batch job'... SHOW PROC/LOCK will also quickly show who is halding the lock.

Good luck,
Hein.
B Claremont
Frequent Advisor

Re: Finding Record Locks

You might want to take a look at the Lotsa Lock chapter in Bruce Ellis's "Hitchhikers Guide to VMS" for more hints on writing code to access lock information.

Bruce Claremont
www.MigrationSpecialties.com
www.MigrationSpecialties.com
Jim_McKinney
Honored Contributor
Solution

Re: Finding Record Locks

Attached is a VAX-to-Alpha port of Bruce Ellis' blocking_lock program found in his HitchHiker book.
Robert Atkinson
Respected Contributor

Re: Finding Record Locks

Doesn't look like Bruce's program works on my VMS 7.3-2 system, but thanks for sending it in Jim :-

ALPHA_ROB$ link showlock.obj
%LINK-W-NUDFSYMS, 9 undefined symbols:
%LINK-I-UDFSYM, EXE$CVT_EPID_TO_PCB
%LINK-I-UDFSYM, EXE$SIGTORET
%LINK-I-UDFSYM, LCK$GL_MAXID
%LINK-I-UDFSYM, LCK$GQ_IDTBL
%LINK-I-UDFSYM, SCH$GL_PCBVEC
%LINK-I-UDFSYM, SMP$ACQUIRE
%LINK-I-UDFSYM, SMP$GL_FLAGS
%LINK-I-UDFSYM, SMP$RELEASE
%LINK-I-UDFSYM, SYS$VERSION_BEGIN
%LINK-W-USEUNDEF, undefined symbol SYS$VERSION_BEGIN referenced
in psect $LINKAGE offset %X00000040
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol SMP$RELEASE referenced
in psect $LOCK_LINKAGE_2 offset %X00000050
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol SMP$ACQUIRE referenced
in psect $LOCK_LINKAGE_2 offset %X00000060
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol SMP$GL_FLAGS referenced
in psect $LOCK_LINKAGE_2 offset %X00000070
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol EXE$SIGTORET referenced
in psect $LOCK_LINKAGE_2 offset %X00000090
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol LCK$GL_MAXID referenced
in psect $LOCK_LINKAGE_2 offset %X000000B0
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol EXE$CVT_EPID_TO_PCB referenced
in psect $LOCK_LINKAGE_2 offset %X000000C0
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol SCH$GL_PCBVEC referenced
in psect $LOCK_LINKAGE_2 offset %X000000D0
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1
%LINK-W-USEUNDEF, undefined symbol LCK$GQ_IDTBL referenced
in psect $LOCK_LINKAGE_2 offset %X000000D8
in module BLOCKING_LOCK file OPS$DATA:[ROBERT]SHOWLOCK.OBJ;1


GAMMA_ROB$$$ set proc/priv=all
GAMMA_ROB$$$ showlock 20C026DA
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=000000000000001C, PC=0000000000020850, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
image module routine line rel PC abs PC
SHOWLOCK 0 0000000000020850 0000000000020850
0 FFFFFFFF80273ED4 FFFFFFFF80273ED4
GAMMA_ROB$$$
Volker Halle
Honored Contributor

Re: Finding Record Locks

Rob,

this is a privileged program, which needs to link to the executive:

$ LINK/SYSEXE showlock

Note that you will need CMKRNL and that this program might then be able to crash your system.

Volker.
Robert Atkinson
Respected Contributor

Re: Finding Record Locks

Thanks Volker, that works a treat now :-

GAMMA_ROB$$$ showlock
pid> 20C032E6

PID 20C032E6 belongs to process RAA_RobertAtki3 owned by user RAA
which has requested a PW mode lock with LKID 090060E2.

LKID: 090060E2
Resource name (ascii) ....R...
Resource name (hex) 00000000 00000000 00000052 00000001
00000000 00000000 00000000 00000000
Parent Resource name (ascii) RMS$...├Г ...ROBERT ...
Parent Resource name (hex) 5245424F 52020000 CA880015 24534D52
00000000 00000000 00202020 20202054

This lock request is currently blocked by a PW mode lock held by
process RAA_RobertAtki2 with PID 20C026DA and owned by user RAA.


I'll give it a go in a real situation and see if it works.

Rob.
Volker Halle
Honored Contributor

Re: Finding Record Locks

Rob,

let me add an advice:

If you get undefined symbols during a LINK operation, NEVER try to run the resulting image with CMKRNL (or CMEXEC) privileges enabled.

ACCVIOs, which will result when the code tries to reference those undefined symbol locations in KERNEL mode, will almost certainly cause a system crash.

In your case, the program died with ACCVIO before reaching kernel mode, so you were lucky.

Volker.
Robert Atkinson
Respected Contributor

Re: Finding Record Locks

Thanks for the head-up.

I never get involved with low-level languages, just stuff like PHP, so this one's certainly news to me.

Glad I ran it on our test node now!

Rob.
Jim_McKinney
Honored Contributor

Re: Finding Record Locks

> ACCVIOs, which will result when the code tries to reference those undefined symbol locations in KERNEL mode, will almost certainly cause a system crash.

To trap this sort of thing, I included an exception handler that is active in kernel mode, in the port of Bruce's program.