Question & Answer
Question
How can I list and count elements in an IBM® Rational® ClearCase® VOB on UNIX®, Linux® and Microsoft® Windows®?
Answer
The following details provide different methods for listing out and counting the elements in a VOB:
Using cleartool find
While set into a view with the default config spec, run the following from the top level of the VOB:
- To list out the elements in a VOB that are on a specific branch:
UNIX and Linux:
cleartool find -all -element 'brtype(main)' -print
Windows:
cleartool find -all -element "brtype(main)" -print
UNIX and Linux only:
- To count all the elements that are on a specific branch:
cleartool find -all -element 'brtype(main)' -print |wc -l
- This is the command syntax for counting the number of elements in a VOB, including elements in all directory versions on all branches that are not shown in the current view.
You can use the cleartool find command with the wc (word count) command. This command counts the lines, words, and characters of all the input returned from the cleartool find. - set a view
cleartool setview testview
- change directory (cd) to the VOB-tag
cd /vob2/testvob
- list out all the elements in the VOB
cleartool find -all -print
- list out and count the elements: (UNIX and Linux only)
cleartool find -all -print | wc -l
Note: There are no equivalent commands or utilities to count the elements in a VOB on Windows.
For more information on using any of the cleartool sub-commands used in this technote, refer to the IBM Rational ClearCase Command Reference, or run cleartool man <sub-command>.
Using countdb
On Windows, UNIX and Linux, you can run the countdb utility and check the output for line beginning with "ELEMENT" to get the element count.
Example:
<...deleted output...for example only>
******************************************************
Record Distribution
******************************************************
TID_THE_USUAL : 1
TID_DO_LINK_COUNTS : 1
MASTER : 1
SYSTEM : 1
STRING_FREE : 2
STRING : 285
OBJECT : 127
WELL_KNOWN_OBJECT_ENTRY : 35
ELEMENT : 10
The above output shows that the VOB has a total of 10 elements.
For more information on the countdb utility refer to technote 1126456.
Using vob_sidwalk
This utility acts on the database directly to return a count of all objects found in the VOB.
Syntax:
vob_sidwalk \<vobtag> <dumpfile>
Note: The dump file will contain a list of all:
- UIDs and GIDs present in the VOB on UNIX and Linux
- User and group SIDs present in the VOB on Windows
Example:
- >vob_sidwalk \General_Test .\dump.txt
VOB Tag: \General_Test (xxxxx:C:\CCSHARE\VOB\General_Test.vbs)
Meta-type "directory element" ... 6 object(s)
Meta-type "directory version" ... 16 object(s)
Meta-type "tree element" ... 0 object(s)
Meta-type "element type" ... 13 object(s)
Meta-type "file element" ... 15 object(s)
Meta-type "derived object" ... 0 object(s)
Meta-type "derived object version" ... 0 object(s)
Meta-type "version" ... 31 object(s)
Meta-type "symbolic link" ... 0 object(s)
Meta-type "hyperlink" ... 0 object(s)
Meta-type "branch" ... 21 object(s)
Meta-type "pool" ... 3 object(s)
Meta-type "branch type" ... 1 object(s)
Meta-type "attribute type" ... 4 object(s)
Meta-type "hyperlink type" ... 9 object(s)
Meta-type "trigger type" ... 0 object(s)
Meta-type "replica type" ... 1 object(s)
Meta-type "label type" ... 3 object(s)
Meta-type "replica" ... 2 object(s)
Meta-type "activity type" ... 0 object(s)
Meta-type "activity" ... 0 object(s)
Meta-type "state type" ... 0 object(s)
Meta-type "state" ... 0 object(s)
Meta-type "role" ... 0 object(s)
Meta-type "user" ... 0 object(s)
Meta-type "baseline" ... 0 object(s)
Meta-type "domain" ... 0 object(s)
Total number of objects found: 125
Successfully processed VOB "\General_Test".
For more information on vob_sidwalk, refer to IBM Rational ClearCase Command Reference, or run cleartool man vob_sidwalk from command line.
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21125941