Manage Learn to apply best practices and optimize your operations.

Comparing replicas on clustered Lotus Domino servers Hall of Fame veteran Blessan Philip provides a script that automatically generates a Microsoft Excel report to compare server replicas in a Lotus Domino cluster -- including actual mail file sizes, quotas and warning thresholds. This information can then be used to identify any replication issues.

This following code was tested in Lotus Domino Server R6. Once you embed it in a button or agent, clicking/running this script will generate a Microsoft Excel comparison report, including actual mail file size, quota, and warning threshold for the replicas residing on the source and destination servers in a Lotus Domino server cluster.

The Microsoft Excel report that is generated can be used to study mismatches, which could be caused by lack of replication between the databases in the two Lotus Domino servers being compared in the cluster.

Clicking on the button or running the agent containing the following code will:

  1. Prompt you to enter the first server of the cluster.

  2. Prompt you to enter another server in the cluster that you wish to check.

  3. Prompt you to enter the folder (mail for mail files) of the first/source server to be checked.

  4. Generate the report in Microsoft Excel, which can then be used to study the mismatches in the replica size, etc.

 On Error Resume Next
Dim session As New notessession 
Dim Sdbdirectory As NotesDbDirectory
Dim Sdb As NotesDatabase
Dim Sfilepath As String 

Dim Ddbdirectory As NotesDbDirectory
Dim Ddb As NotesDatabase

Dim SrcServ As String
Dim DestServ As String
Dim rows As Long
Dim maxcols As Integer
SrcServ=Inputbox$("Please enter the 
Source Server","Tools","Source Server") 
DestServ=Inputbox$("Please enter the 
Destination Server","Tools","Destination server")
Sfilepath=Inputbox$("Please provide 
the folder path on source which needs 
to be checked e.g. mail or databases","Tools","mail")
'excel variable initialization
Set xlApp = CreateObject("Excel.Application") 
'start Excel with OLE Automation
xlApp.StatusBar = "Creating WorkSheet. 
Please be patient..."
xlApp.Visible = True
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).
Worksheets(1) 'select first worksheet
'worksheet title
xlApp.StatusBar = "Creating Column 
Heading. Please be patient..."


xlsheet.Cells(rows,1).value="Database File  "

xlsheet.Cells(rows,3).value="Mail Size (MB)"
xlsheet.Cells(rows,4).value="Mail Quota  (MB)"
xlsheet.Cells(rows,5).value="Warning Threshold  (MB)"
xlsheet.Cells(rows,6).value="Mail Size (MB)"
xlsheet.Cells(rows,7).value="Mail Quota  (MB)"
xlsheet.Cells(rows,8).value="Warning Threshold  (MB)"

Set Sdbdirectory=session.GetDbDirectory(SrcServ)
Set Ddbdirectory=session.GetDbDirectory(DestServ)


While Not   Sdb Is Nothing
If tmpFilename=Sfilepath Then
Set Ddb=New notesdatabase("","")
flag  = DDb.OpenByReplicaID(DestServ,repid)
If flag=True  Then
xlsheet.Cells(rows,1).Value = Sdb.FileName
xlsheet.Cells(rows,2).Value ="'"+ Sdb.Title
xlsheet.Cells(rows,3).Value =(Sdb.size/1000000)
xlsheet.Cells(rows,4).Value =Sdb.SizeQuota/1024
xlsheet.Cells(rows,5).Value =sdb.SizeWarning/1024
xlsheet.Cells(rows,6).Value =(Ddb.size/1000000)
xlsheet.Cells(rows,7).Value =Ddb.SizeQuota/1024
xlsheet.Cells(rows,8).Value =Ddb.SizeWarning/1024
xlApp.StatusBar = "Importing Notes Data - Document " & rows-1   
Set DDb=Nothing    
xlsheet.Cells(rows,1).Value = Sdb.FileName
xlsheet.Cells(rows,2).Value ="'"+ Sdb.Title
xlsheet.Cells(rows,3).Value =(Sdb.size/1000000)
xlsheet.Cells(rows,4).Value =Sdb.SizeQuota/1024
xlsheet.Cells(rows,5).Value =sdb.SizeWarning/1024
xlsheet.Cells(rows,6).Value ="Missing on destination server"

xlApp.StatusBar = "Importing Notes Data - Document " & rows-1   
End If
End If 

xlApp.Selection.Font.Bold = True
xlApp.Selection.Font.Underline = True
xlApp.Selection.Font.Name = "Arial"
xlApp.Selection.Font.Size = 9
With xlApp.Worksheets(1)
.PageSetup.Orientation = 2
.PageSetup.centerheader = "Report - Confidential"
.Pagesetup.RightFooter = "Page &P" & Chr$(13) & "Date: &D"
Pagesetup.CenterFooter = ""
End With
xlApp.ReferenceStyle = 1
xlApp.StatusBar = "Importing Data from 
Lotus Notes Application was Completed." 
Set xlapp=Nothing 'stop OLE
Set db=Nothing

Do you have comments on this tip? Let us know.

Related information from

  • Tip: A primer on Lotus Domino clustering
  • Tip: Monitoring Lotus Domino cluster replication
  • Tip: Locate missing databases in a Lotus Domino cluster
  • Tip: Lotus Domino cluster tuning

    This tip was submitted to the tip library by member Blessan V. Philip Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

  • Dig Deeper on Lotus Notes Domino Clustering



    • Favorite iSeries cheat sheets

      Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

    • HTML cheat sheet

      This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

    • Carol Woodbury: Security

      Carol Woodbury