IBM Support

Locking and unlocking all VOBs on the VOB server

Troubleshooting


Problem

This technote explains how to lock or unlock all the IBM® Rational® ClearCase® VOBs on a given VOB server at once by passing a command line syntax to the cleartool command.

Resolving The Problem


To lock or unlock a VOB, you need to run the following commands:

  • Lock: cleartool lock vob:<vob-tag>
  • Unlock: cleartool unlock vob:<vob-tag>

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



You can write a simple script that can automate the task of locking or unlocking all VOBs on the host.



Examples:
Microsoft® Windows®
Using the Windows FOR command, you can lock or unlock all of the VOBs on the server.

Note: From the command line, type for /? for help information about the FOR command.
  1. Open a command prompt (Start > Run type cmd)

  2. To lock all the VOBs, type the following command:

    for /f %v in ('cleartool lsvob -short -host <VOB host>') do cleartool lock vob:%v

    Example:

    C:\>for /f %v in ('cleartool lsvob -short -host host2') do cleartool lock vob:%v
    Locked versioned object base "\PVOB".
    Locked versioned object base "\multisite".
    Locked versioned object base "\test_vob".
    Locked versioned object base "\UCM_1".
    Locked versioned object base "\UCM_2".
    Locked versioned object base "\import".
    Locked versioned object base "\MyVOB".

  3. To unlock all the VOBs, type the following command:

    for /f %v in ('cleartool lsvob -short -host <VOB host>') do cleartool unlock vob:%v

    Example:

    C:\>for /f %v in ('cleartool lsvob -short -host host2') do cleartool unlock vob:%v
    Unlocked versioned object base "\PVOB".
    Unlocked versioned object base "\multisite".
    Unlocked versioned object base "\test_vob".
    Unlocked versioned object base "\UCM_1".
    Unlocked versioned object base "\UCM_2".
    Unlocked versioned object base "\import".
    Unlocked versioned object base "\MyVOB".

UNIX® and Linux®
Using the FOR shell command, you can lock or unlock all of the VOBs on the server.

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

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

    Example:
    $> for i in `cleartool lsvob -short -host host1`; do cleartool lock vob:$i; done
    Locked versioned object base "/vobs/testvob".
    Locked versioned object base "/vobs/pvob".
    Locked versioned object base "/vobs/vob2".
    Locked versioned object base "/vobs/top".
    Locked versioned object base "/vobs/sys".

  2. To unlock all the VOBs, type the following command:

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

    Example:
    $> for i in `cleartool lsvob -short -host host1`; do cleartool unlock vob:$i; done
    Unlocked versioned object base "/vobs/testvob".
    Unlocked versioned object base "/vobs/pvob".
    Unlocked versioned object base "/vobs/vob2".
    Unlocked versioned object base "/vobs/top".
    Unlocked versioned object base "/vobs/sys".

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"VOB","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2002.05.00;2003.06.00;7.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"VOB","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21136290