dbCheck

As Charles is not in the office, I take care of this case.

Can you run the following on the VOB that is replicated:

cleartool checkvob -data -protection -debris vob_stg_pname
cleartool checkvob -data -protection -debris -pool vob_stg_pname
cleartool checkvob -hlink vob_stg_pname

I would like also that you run dbcheck on this VOB. Here is the procedure if the VOB is on Unix.

Perform a dbcheck as root on the problem vob's database. Be aware that this may take a considerable amount of time on large vobs. It will likely be required as the next step in any case.

0. Log in as root on the vob server host
1. cd < vob storage directory >/db
2. cleartool lock -vob < vob storage directory >
3. /usr/atria/etc/utils/dbcheck -a -k -p8192 vob_db 2 > dbcheck.out (/bin/sh)
OR
/usr/atria/etc/utils/dbcheck -a -k -p8192 vob_db >& dbcheck.out (/bin/csh)

NOTE: The redirect of the dbcheck.out file assumes you are running csh or sh. If you are running a different shell, adjust the command. Also, the string "vob_db" is not an abbreviation, and should be typed literally.

NOTE: If the dbcheck command has memory problems, leave off the "-p8192" option.
NOTE: The vob must be locked in step 2 to ensure the accuracy of the dbcheck output. If, however, an error occurs while locking the vob continue to step 3.

Send me the result of all these command (checkvob and dbcheck)

Get Logs

The Winmsd Report (NT):

Go to a command line and type in "winmsd" then hit enter. This will bring up a GUI NT diagnostics report. Click on FILE then SAVE REPORT. On the create report screen, make sure you select COMPLETE mode then click OK. Save this report to a location on your hard drive as a text file.

The Winmsd Report (Win 2000):

Go to a command line and type in "winmsd" then hit enter. This will bring up a GUI Win2K diagnostics report. Highlight "System Information" in the left frame. Click on Action, Save as System Information File.

The ClearCase Doctor Report: (Version 3.1 and later)

Go to a command prompt and type "ccdoctor" and hit enter. This will launch the ClearCase Doctor. Click START ANALYSIS and when it is done, select ANALYSIS > SAVE AS from the pull down menu and save this file with the default .ccdoc extension.

The System and Application Logs: (Windows NT)

Click START > PROGRAMS > ADMINISTRATIVE TOOLS > EVENT VIEWER.
Click on the LOG pull down menu and select SYSTEM, then click on the LOG pull down again and  select SAVE AS. Save this log as system.evt

Then click on the LOG pull down again and select APPLICATION.
Then click on the LOG pull down again and select SAVE AS. Save this log
as application.evt

The System and Application Logs: (Windows 2000)

Click START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > EVENT VIEWER
Right click on Application Log, save log file as AND
Right click on System Log, save log file as

Go to a command line and type "cleartool getlog -a -full" this will print to the screen a lot of ClearCase logs. You can pipe this output to a file by adding the following syntax:

cleartool getlog -a -full > c:\temp\getlog.txt
 

Here are the procedures will need to follow in order to correct the
premissions at you site.


For VOBs

1. Run fix_prot (this command can be found in the %clearcaseahome%\etc\utils directory)
fix_prot -root -chown owner -chgrp group \\machine\vobstore\vob.vbs

2. Run fix_prot again (must be run 2 times with different options)
fix_prot -r -chown owner -chgrp group -chmod 775 \\machine\vobstore\vob.vbs

3. Run the protectvob command as follows:
cleartool protectvob -chown owner -chgrp group d:\vobstore\vob.vbs

4. Then run the protect command to re-protect each and every vob element
with the proper protections:
a. Start a view (create a new one if you need to)
b. CD to the root of the vob
c. Issue the following command IN THE CLEARTOOL INTERACITVE. (type cleartool at a command line and hit enter to get to the prompt)

You can use the find command to find all elements and then execute the protect -r command on them. Here is an example (notice that this example is run from the cleartool interactive):

CLEARTOOL> find . -all -exec 'cleartool protect -chown owner -chgrp
group -chmod 775 "%CLEARCASE_PN%"'


cleartool checkvob -pool -fix <vob-stg-dir>

NOTE: Please be careful here to add the period after the find, and make sure the quotes are in there correctly.

Once these four steps are done, your vob should be protected correctly and ready for use. All of these 4 steps are not always needed for every protection problem, however, you cannot go wrong by running all of them.

For views

1. fix_prot -root -chown <viewowner> -chgrp <viewgroup> <unc-path-to-view>

2. fix_prot -r -chown <viewowner> -chgrp <viewgroup> -chmod 644 <unc-path-to-view>
 

Protect VOB actions
  • cleartool protectvob -add_group <group-name>
Tree structure on cmd.

cleartool lsvtree Cada-NT@@

Remove view using ID.
  • cleartool describe -long vob:/scmvob
  • cleartool rmview -vob <mount point of vob> -uuid <uuid of deleted view>
    (Please note that this command should NOT be used on active views)
Multisite ClearCase

Developers at each site are given the opportunity to demand mastership of a said branch and therefore are afforded exclusive rights on an element.  In order to master the branch, it must be mastered by the replica they are working with.  They do so, by executing a 'reqmaster' command.  If they have the correct permissions, the replica will become effectively mastered by them.  They can then perform a blocking checkout (checkout reserved) at which point they will be able to read / write/ remove the element. 
 
multitool reqmaster -nc /branch p-name
cleartool checkout -nc /p-name
 
NB - Make sure the access control list (acl) is modified so that it contains a list of those who who need to request mastership of branches mastered by that replica. 
 
multitool reqmaster -acl -edit vob selector
 
NB - To ensure further security on the branch that you wish to have restricted access, implement the -deny command
 
multitool reqmaster -deny branch p-name
 
For further information please consult your multisite manual - esp. pgs 117 - 120, though do not hesitate to contact us again with further questions,

 

Perl Script

#
# This perl script is intended to be given to costumers by Rational
# support. It gets general information that we need for all multisite
# support calls.The user must give a string identifying the site. He/she
# may choose any string he/she wishes but all references to this site in
# the escalation data base must use this string. The script expects to
# be run in a view in the vob tag for the replica at the site given as
# an argument. It will print a banner containing the site string followed
# by output from the following commands. The script handles differences
# in syntax between 2.x and 3.x versions of ClearCase.
#
# 1. cleartool lsvob <vob_tag>
# 2. cleartool -VerAll
# 3. multitool -VerAll
# 4. cleartool lsreplica -long
# 5. multitool lsepoch
# 6. for each replica found in step 4
# 6a. cleartool desc replica:$replica
# 6b. cleartool dump replica:$replica
# 7. uname on unix, ver on NT
#


#
# Try to determine whether we are unix or NT. Assume the following
# will fail on any unix.
#
if(system("cmd.exe /c ver")) {
$UnixVersion = 1;
$NT_Version = 0;
} else {
$UnixVersion = 0;
$NT_Version = 1;
}


if($NT_Version) {
$RMFILE = "cmd /c del";
$SEP = '\\';
$UNAME = "cmd /c ver";
if(exists($ENV{'TMP'})) {
$TMPDIR = $ENV{'TMP'};
} elsif (-d $ENV{'SystemDrive'}.'\tmp') {
$TMPDIR = $ENV{'SystemDrive'}.'\tmp';
} elsif (-d $ENV{'SystemDrive'}.'\temp') {
$TMPDIR = $ENV{'SystemDrive'}.'\temp';
} else {
unless(mkdir($ENV{'SystemDrive'}.'\temp', 0777)) {
printf "Could not find TMP ev or open \\temp on $ENV{'SystemDrive'}\n";
exit 0;
}
$TMPDIR = $ENV{'SystemDrive'}.'\temp';
}
$Program = "MultitoolInfo.nt";
$CurrentHost = `hostname`;
} else {
$RMFILE = "rm -f";
$SEP = '/';
$TMPDIR = "/usr/tmp";
$UNAME = "uname -a";
$Program = "MultitoolInfo.nt";
$CurrentHost = `uname -n`;
}

sub GetSystemInfo {
my($tmpfile) = MultisiteInfoTemp();
return undefined if(DoCommand($LocalCmd,1,qq($UNAME > "$tmpfile")));
WriteTmpFile($tmpfile);
DoCommand($LocalCmd,0,qq($RMFILE "$tmpfile"));
}


#
# Actually returns a function reference. The base string passed
# in will be used as a file prefix for all subsequent calls to the
# referenced function. A sequence number is attached to the end
# of the tmpfile name on each call to the referenced fuction.
sub TempFile {
my($base) = shift;
my($path) = $TMPDIR.$SEP.$base;
return sub { $Sequence++; return "$path.$Sequence"; };
}

# Our tempfiles will have a file prefix of "MultisiteInfoTemp.pid".
*MultisiteInfoTemp = TempFile("MultisiteInfoTemp.".$$);

#
# A general error message function. Its passed one of these error
# types, the function where the error occurred, and the message.
$InternalError = "Internal Error";
$FatalError = "Fatal Error";
$WarningError = "Warning";
sub Error {
my($type,$f,$msg) = @_;
print STDOUT "$Program: $type Encountered in $f:\n $msg\n";
return undefined;
}

#
# A specialized error message function to print cleartool errors.
# The ClearTool function below sets $LastClearToolCommand command
# each time its called. That function also always leaves all cleartool
# output in @ClearToolOutput
sub ReportClearToolError {
if(@ClearToolOutput) {
print STDERR "Cleartool Error encountered\n";
print STDERR "Cleartool Command: $LastClearToolCommand\n";
print STDERR "Cleartool Error Massage:\n";
print STDOUT @ClearToolOutput, "\n";
return undefined;
}
return 0;
}

#
# A specialized error message function to print multitool errors.
# The MultiTool function below sets $LastMultiToolCommand command
# each time its called. That function also always leaves all multitool
# output in @MultiToolOutput
sub ReportMultiToolError {
if(@MultiToolOutput) {
print STDERR "Multitool Error encountered in $f:\n";
print STDERR "Multitool Command: $LastMultiToolCommand\n";
print STDERR "Multitool Error Massage:\n";
print STDOUT @MultiToolOutput, "\n";
return undefined;
}
return 0;
}

#
# Open a pipe to cleartool during the initial call and leave it open for
# the duration of this process. All write the passed command to the
# pipe followed by a command that cleartool is sure not to recognize. All
# cleartool out up to and not including the "command not recognized" is
# read and placed in ClearToolOutput for use by the caller or
# ReportClearToolError.
$CommandTerminator = "Snarf";
$SpawnedCleartool = 0;
sub ClearTool {
my($command) = @_;

@ClearToolOutput = ();

$LastClearToolCommand = $command;

# Spawn a cleartool process if we haven't yet done so
if (!$SpawnedClearTool) {
unless(pipe(CT_READ, CT_P_WRITE)) {
Error($InternalError,'ClearTool',"Pipe failed: $!\n");
return undefined;
}
my($oldfh) = select(CT_P_WRITE); $| = 1; select($oldfh);
# redirect STDOUT to CT_P_WRITE, ditto for STDERR
unless(open(SAVED_STDOUT, ">&STDOUT")) {
Error($InternalError,'ClearTool',"Can\'t dup STDOUT: $!\n");
return undefined;
}
close(STDOUT);
unless(open(STDOUT, ">&CT_P_WRITE")) {
Error($InternalError,'ClearTool',"Can\'t redirect STDOUT: $!\n");
return undefined;
}
unless(open(SAVED_STDERR, ">&STDERR")) {
Error($InternalError,'ClearTool',"Can\'t dup STDERR: $!\n");
return undefined;
}
close(STDERR);
unless(open(STDERR, ">&CT_P_WRITE")) {
Error($InternalError,'ClearTool',"Can\'t redirect STDERR: $!\n");
return undefined;
}

# spawn the cleatool and get a WRITE fh for its input.
# Its output / errout is inherited from our (redirected) STD{OUT,ERR}
unless(open(CT_WRITE, "| cleartool")) {
Error($InternalError,'ClearTool',"Can\'t spawn cleartool: $!\n");
return undefined;
}
$oldfh = select(CT_WRITE); $| = 1; select($oldfh);

close(CT_P_WRITE); # this isn't our side of the pipe

# redirect STD{OUT,ERR} back to their original state
close(STDOUT);
unless(open(STDOUT, ">&SAVED_STDOUT")) {
Error($InternalError,'ClearTool',"Can\'t put STDOUT back: $!\n");
return undefined;
}
close(SAVED_STDOUT);

close(STDERR);
unless(open(STDERR, ">&SAVED_STDERR")) {
Error($InternalError,'ClearTool',"Can\'t put STDERR back: $!\n");
return undefined;
}
close(SAVED_STDERR);

$SpawnedClearTool++;
}
# Send the command.
print CT_WRITE $command, "\n";
# Send
print CT_WRITE $CommandTerminator, "\n";
# Get the response
while (<CT_READ>) {
# print "Ct Out: $_";
last if (m(Unrecognized command: "$CommandTerminator"));
push(@ClearToolOutput, $_);
}
@ClearToolOutput;

}


#
# Open a pipe to multitool during the initial call and leave it open for
# the duration of this process. All write the passed command to the
# pipe followed by a command that multitool is sure not to recognize. All
# multitool out up to and not including the "command not recognized" is
# read and placed in MultiToolOutput for use by the caller or
# ReportMultiToolError.
$SpawnedMultiTool = 0;
sub MultiTool {
my($command) = @_;

@MultiToolOutput = ();

$LastMultiToolCommand = $command;

# Spawn a multitool process if we haven't yet done so
if (!$SpawnedMultiTool) {
unless(pipe(MT_READ, MT_P_WRITE)) {
Error($InternalError,'MultiTool',"Pipe failed: $!\n");
return undefined;
}
my($oldfh) = select(MT_P_WRITE); $| = 1; select($oldfh);

# redirect STDOUT to MT_P_WRITE, ditto for STDERR
unless(open(SAVED_STDOUT, ">&STDOUT")) {
Error($InternalError,'MultiTool',"Can\'t dup STDOUT: $!\n");
return undefined;
}
close(STDOUT);
unless(open(STDOUT, ">&MT_P_WRITE")) {
Error($InternalError,'MultiTool',"Can\'t redirect STDOUT: $!\n");
return undefined;
}
unless(open(SAVED_STDERR, ">&STDERR")) {
Error($InternalError,'MultiTool',"Can\'t dup STDERR: $!\n");
return undefined;
}
close(STDERR);
unless(open(STDERR, ">&MT_P_WRITE")) {
Error($InternalError,'MultiTool',"Can\'t redirect STDERR: $!\n");
return undefined;
}

# spawn the cleatool and get a WRITE fh for its input.
# Its output / errout is inherited from our (redirected) STD{OUT,ERR}
unless(open(MT_WRITE, "| multitool")) {
Error($InternalError,'MultiTool',"Can\'t spawn multitool: $!\n");
return undefined;
}
$oldfh = select(MT_WRITE); $| = 1; select($oldfh);

close(MT_P_WRITE); # this isn't our side of the pipe

# redirect STD{OUT,ERR} back to their original state
close(STDOUT);
unless(open(STDOUT, ">&SAVED_STDOUT")) {
Error($InternalError,'MultiTool',"Can\'t put STDOUT back: $!\n");
return undefined;
}
close(SAVED_STDOUT);

close(STDERR);
unless(open(STDERR, ">&SAVED_STDERR")) {
Error($InternalError,'MultiTool',"Can\'t put STDERR back: $!\n");
return undefined;
}
close(SAVED_STDERR);

$SpawnedMultitool++;
}
# Send the command.
print MT_WRITE $command, "\n";
# Send
print MT_WRITE $CommandTerminator, "\n";

# Get the response
while (<MT_READ>) {
# print "Mt Out: $_";
last if (m(Unrecognized command: "$CommandTerminator"));
push(@MultiToolOutput, $_);
}
@MultiToolOutput;

}

#
# Invoke the perl system mechanism to execute a local command. Try
# to make sence out of errors.
sub System {
my($args) = @_;
my($rc) = 0;
my($st) = 0xffff & system($args);
return $st if($st == 0);
$rc = $st;
print " System Error encountered in $f:\n";
printf " system(%s) returned %#04x: ", "args", $rc;
if($rc == 0xff00) {
print " command failed\n";
}
elsif($rc > 0xff) {
$rc >>= 8;
print " ranwith non-zero exit status $rc\n";
}
else {
print "ran with ";
if($rc & 0x80) {
$rc &= ~0x80;
print " coredump from ";
}
print " signal $rc\n";
}
$st;
}

#
# Front end for the ClearTool, MultiTool, and System functions. Print
# a banner if $display is set. For ClearTool and MultiTool calls either
# call the appropriate specialized error message function or print the
# contents of the Clear/Multi/Output array if $display is set. For System
# just return. On error undefined is return, 0 otherwise.
$ClearToolCmd = 1;
$MultiToolCmd = 2;
$LocalCmd = 3;
sub DoCommand {
my($type,$display,$command) = @_;
print "\n";
if($type == $ClearToolCmd) {
if($display) {
print qq(######## Output of "cleartool $command"\n);
}
if(grep(/Error/,ClearTool($command)) or !@ClearToolOutput) {
return undefined if(ReportClearToolError());
}
if($display) {
foreach (@ClearToolOutput) {
print;
}
}
} elsif($type == $MultiToolCmd) {
if($display) {
print qq(######## Output of "multitool $command"\n);
}
if(grep(/Error/,MultiTool($command)) or !@MultiToolOutput) {
return undefined if(ReportMultiToolError());
}
if($display) {
foreach (@MultiToolOutput) {
print;
}
}
} elsif($type == $LocalCmd) {
if($display) {
#
# Local commands may redirect the output to a tmp file for parsing.
# Strip off the redirection in the banner.
$pcmd = $1 if($command =~ /(.*)>/);
print qq(######## Output of "$pcmd"\n);
}
if(System($command)) {
return undefined;
}
} else {
print "Internal Error: DoCommand called with unknown type\n";
return undefined;
}
}

#
# Open and write the named tmp file to standard output.
sub WriteTmpFile {
my($f) = @_;
unless(open(TMPDESC,$f)) {
Error($InternalError,'WriteTmpFile',"Open of tmp file $f failed: $!");
return undefined;
}
while(<TMPDESC>) {
print;
}
close(TMPDESC);
}

#
# cleartool doesn't recognoze version request in pipe mode so make
# an explicate cleartool call.
sub ClearToolVersion {
my($tmpfile) = MultisiteInfoTemp();
return undefined if(DoCommand($LocalCmd,1,
qq(cleartool -VerAll > "$tmpfile")));
unless(open(TMPDESC,$tmpfile)) {
Error($InternalError,'ClearToolVersion',
"Open of tmp file $tmpfile failed: $!");
return undefined;
}
while(<TMPDESC>) {
print;
$CC_Version = $1 if(/ClearCase version (.*?) /);
}
close(TMPDESC);
DoCommand($LocalCmd,0,qq($RMFILE "$tmpfile"));
return 0;
}

#
# multitool doesn't recognoze version request in pipe mode so make
# an explicate multitool call.
sub MultiToolVersion {
my($tmpfile) = MultisiteInfoTemp();
return undefined if(DoCommand($LocalCmd,1,
qq(multitool -VerAll > "$tmpfile")));

unless(open(TMPDESC,$tmpfile)) {
Error($InternalError,'MultiToolVersion',
"Open of tmp file $tmpfile failed: $!");
return undefined;
}
while(<TMPDESC>) {
print;
$MS_Version = $1 if(/MultiSite version (.*?) /);
}
close(TMPDESC);
DoCommand($LocalCmd,0,qq($RMFILE "$tmpfile"));
return 0;
}

#
# Main program.

$nargs = scalar @ARGV;

if($nargs != 2) {
print "$Program: Perl MultitoolInfo.pl <site designation> <vob tag>\n";
exit(1);
}

$Site = shift(@ARGV);
$VobTag = shift(@ARGV);

#
# Print a banner.
print "\n";
print "******************************************************************\n";
print "***** Vob: $VobTag\n";
print "***** Site: $Site\n";
print "***** Host: $CurrentHost\n";
print "******************************************************************\n";

#
# Can't use the ClearTool or MultiTool function to get version information
# because the pipe interface doesn't recognize the version commands.
exit(1) if(ClearToolVersion());
exit(1) if(MultiToolVersion());

#
# The above set CC_Version and MS_Version globals. Set a boolean
# for easy version checks.
if($CC_Version =~ /^3/) {
$CC_V3 = 1;
}

#
# The real work
exit(1) if(DoCommand($ClearToolCmd,1,"lsvob -long $VobTag"));
exit(1) if(DoCommand($ClearToolCmd,1,"lsreplica -long"));
DoCommand($MultiToolCmd,1,"lsepoch");
foreach (@MultiToolOutput) {
push(@Replicas,$1) if(m/^Oplog IDs for row "(.*)"/);
}

foreach $replica (@Replicas) {
if($CC_V3) {
DoCommand($ClearToolCmd,1,"desc replica:$replica");
} else {
DoCommand($ClearToolCmd,1,"desc -vreplica $replica");
}
}

foreach $replica (@Replicas) {
if($CC_V3) {
DoCommand($ClearToolCmd,1,"dump replica:$replica");
} else {
DoCommand($ClearToolCmd,1,"dump -vreplica $replica");
}
}

#
# On NT the output of this command is pretty lengthy so it goes on
# the end. On unix its just uname -a.
GetSystemInfo();
 

Problems exchanging replica VOB

In my opinion the followning has happend. The mastersite created the "TestPrograms@@\main\sungrace" branch, created the replica that was sent to you, removed the branch, created a new branch with the same name but whit an different location and syncronized it to your site. This means that you have two different with the same name. Or has the branch "sungrace" been created, the VOB replicated, the branch removed, branch recreated and there after sync packets has been generated. This also means that the replica has two branches with the same name.
Could you please confirm which/if this teories is correct or not, with the
master site in India.

Could your please run a lshihstory on both sites as below
cleartool lshistory -minor replica:<replica-name>

Here is how to change the epoch, this is to be run at the sungrace site.
multitool chepoch LmsHq sungrace=30000

Then create a sync packet and send it to lmshq, using
syncreplica -export

Import it on lmshq, using
multitool syncreplica -import -receive

create and sync again from lmshq to sungrace
 

Problems exchanging replica VOB - version 2

LmsHq so multitool things that we have imported the replicated file.

-Multisite already thinks that the replica has been updated. The sending site takes for granted that the sync packets are imported correctly. at replica site sungrace give mastership of branch "sungrace" to site LmsHq again run

- the replica site sungrace can not give mastership to LmsHq, becurse LmsHq can not import the sync packet with the mastership.

The reason way multisite still not are importing the packets is becurse the branch sungrace was added befor the 30000 row.

Now, Could you run a
cleartool lshistory -minor replica:sungrace@<vob-selector>

 

After talking with you over the phone here are the descriptions.
Gain mastership over the all objects that were mastered by the Indian replica.

multitool chmaster -all -force sungrace@<vob-selector> -long LmsHq

After gaining the mastership, create a new replica
multitool mkreplica ...

Import the replica in India, create an Indian branch and sync it with India
multitool syncreplica -export ...

Instruct India to change the name of the branch "S:\SEGIN_SCM/cada-nt-vob\Cada-NT\Sungrace\TestPrograms@@\main\sungrace",
then to move the content of there old sungrace branch from the old replica to the new replica and the new Indian branch
cleartool mv .....

and then instruct India to create a new sync packet
multitool syncreplica ..

Import the sync packet at LmsHq.
syncreplica -import ...

Then finally the both sites will be in sync. I would recommend though that the sites should be synchronized at least once or twice a week. So if there are any problems it will be detected sooner. With more frequent replication the packet size also is smaller.

 

Could you try to create a new view, mount the vob
cd into the vob, and re-run the rmreplica command

multitool rmreplica <replica-name>

 

Problems exchanging replica VOB - version 3