IBM Support

How to list locked VOBs

Question & Answer


Question

How do I get a listing of all the IBM® Rational® ClearCase® VOBs that are locked in a particular registry region?

Answer

To determine a listing of locked VOBs in a particular region, you need to run the cleartool lslock command.

There is no method provided by ClearCase to list all VOBs that are locked. The cleartool lslock command works on a single VOB only.

Example:

C:\>cleartool lslock vob:\name
23-Jul.17:01   name    lock versioned object base "\name" (locked)
"Locked for all users."

Review the IBM Rational ClearCase Command Reference on the topic of lslock (cleartool man lslock) for more information.



You can write a simple script that can automate the task of listing all lock VOBs on the host using the following commands:

cleartool lsvob -short

cleartool lslock



Examples:
Microsoft® Windows® (click to expand)
Using the Windows FOR command, you can obtain a listing of all VOBs in the region the server is set to.

Note: From the command line, type for /? for help information about the FOR command.


for /F %v in ('cleartool lsvob -short') do cleartool lslock vob:%v

Example:

C:\>for /F %v in ('cleartool lsvob -short') do cleartool lslock vob:%v


08-Mar.14:44   jdoe     lock versioned object base "\PVOB" (locked)
  "Locked for all users."
21-Feb.08:29   jdoe     lock versioned object base "\MyVOB" (locked)
  "Locked for all users."
21-Feb.08:32   jdoe     lock versioned object base "\test" (locked)
  "Locked for all users."

UNIX® and Linux® (click to expand)
Using the FOR shell command, you can obtain a listing of all VOBs in the region the server is set to.

Note: From the command line, type man <shell> (<shell> for which ever shell script you are running) for help information about the FOR command.

To list all the locked VOBs in a given region, type the following command:

for i in `cleartool lsvob -short -host <hostname>`; do cleartool lslock vob:$i; done

Example:

#>  for i in `cleartool lsvob -short -host host1`; do cleartool lslock vob:$i; done


--04-05T14:26  root       lock versioned object base "/vobs/top" (locked)
  "Locked for all users."
--04-05T14:26  root       lock versioned object base "/vobs/sys" (locked)
  "Locked for all users."
--04-05T14:26  root       lock versioned object base "/vobs/common" (locked)
  "Locked for all users."
--04-05T14:26  root       lock versioned object base "/vobs/ckvob2" (locked)
  "Locked for all users."

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"VOB","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF015","label":"IRIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"2002.05.00;2003.06.00;7.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21150818