ClearCase Support: How to Clean, Recover, and Defragment ClearCase Views
ClearCase Views are basically your private workspace to access and make changes to VOBs, however these Views quickly decrease in performance as they grow in size. Additionally, ClearCase Views break often. Therefore, Views need to be periodically cleaned, fixed, and even defragmented.
Here are a set of instructions to help with Views. You can actually pick and choose which steps to follow, since most of these steps are optional if your View is still in working condition. You will need to be logged in as the View's owner for all of the instructions to work, and maybe even in your View.
- First, I recommend checking in or unchecking out all elements (files and directories) that are checkedout in your View. I do not recommend having elements checkedout for over a week. You can run these procedures to find all of your checkedout elements.
Second, you can clean up all View private elements in your View. You can run this command to find all View private elements in your View.
Copy all View private files that you want to keep out of your View and/or permanently add them to source control. Next, make sure you have no checkedout elements, using the instructions in the first step above. Finally, delete all the remaining View private elements with this command. Please note that this command will delete your checkedout elements too, so be very careful with this command.
cleartool lspriv | xargs rm -rf
Now, you should have an empty View.
Next, sometimes VOBs are deleted, moved, or renamed. However, Views still think they have View private files in the old VOB location that no longer exists. So, run this command to find these lost files.
cleartool lspriv | grep "DIR-"
If any output is produced, then you need to remove this lost View private data files from these obsolete VOB directories.
cleartool recoverview -force -dir DIRECTORY_NUMBER -tag VIEW_NAME
The directory number is the information between "
". Alternatively, if the same missing VOB has a lot of missing directory data, you can use the "-vob VOB_NAME" arguments, but make sure this VOB Name does not exist elsewhere as if the VOB was just moved.
Next, go to the View's storage directory. Then go to the source sub-directory called ".s". Then go the View's lost and found sub-directory called "lost+found". Delete all files and directories in this lost and found directory. Do not delete this lost and found directory!
rm –rf VIEW_STORAGE_DIRECTORY/.s/lost+found/*
Now that you have cleaned your View, you now need to clean up the data tables with the follow command. This should drastically improve the speed of large Views that had a lot of cleaning.
cleartool recoverview -force -tag VIEW_NAME
This command may take a long time to run. After this command finishes running, immediately run the same command a second time. If a lot of data tables were cleaned up, then the second time that you run this command will defragment or recover internal disk space of the View. In other words, make the data tables smaller without large data gaps. This should improve performance of the View even more.
Finally, force a View refresh on all servers using this command.
cleartool setcs -current
by Phil for Humanity