Manage Learn to apply best practices and optimize your operations.

Locate missing databases in a Lotus Domino cluster Hall of Famer Blessan Philip explains how to generate a report in Microsoft Excel of all databases that are not present on the Lotus Domino servers in a selected cluster.

The following code – which I've tested it in Lotus Domino R6, embedded in a button generates a report in Microsoft Excel of all databases that are not present on Lotus Domino servers in a selected cluster.

  1. The code first prompts the user to enter the Lotus Domino server name where the cluster directory (cldbdir.nsf) resides.

  2. It then prompts to enter the number of servers in the cluster of which the entered server is a member

  3. Finally, it generates reports in Microsoft Excel of all databases that are not present on all the Lotus Domino servers of the selected cluster.

Details of the missing Domino databases generated contains database file path, title and the servers on which it is present.

Dim session As New notessession
Dim db As NotesDatabase
Dim doccoll As NotesDocumentCollection
Dim Allview As NotesView 
Dim doc As NotesDocument 
Dim tempdoc As NotesDocument
Dim xlApp As Variant, xlsheet As Variant, 
rows As Integer, cols As Integer
Dim tempCol As Integer

Dim serv_nm As String
Dim db_nm As String

Dim TempNumServOnClust As String
Dim NumServOnClust As Integer

Dim lst_repid  List As String 


serv_nm=Inputbox("Provide the name 
of the server on which the Cluster 
directory resides. Blank  entry would 
look for the cluster directory database 
on local  ","Tools","ServerName")
("Number of member servers of the cluster ","Tools","2")

If  Not Isnumeric(TempNumServOnClust) Then
Msgbox "Server count on the  cluster should be numeric"
Exit Sub
End If

'Set db=session.CurrentDatabase 
Set db=New NotesDatabase(serv_nm,db_nm)

If db Is Nothing Then
Msgbox "Database could not 
be found on the server"+serv_nm
Exit Sub
End If 
Set Allview=db.getview("($ReplicaID)") 
'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
xlsheet.Cells(rows,cols).Value ="Following Databases 
are not available on all the " +Cstr(NumServOnClust)+"   
Servers ,  Database: " + db.title +", Export  created on: " 
+ Format(Now,"DD/MON/yyyy HH:MM")
xlApp.StatusBar = "Creating Column Heading. 
Please be patient..."


xlsheet.Cells(rows,1).value="Database File"
xlsheet.Cells(rows,3).value="Available on Servers"


Set doc=allview.GetFirstDocument

While Not doc Is Nothing 
repid = Evaluate({@text(ReplicaID;"*")},doc)
Set doccoll=allview.GetAllDocumentsByKey(repid(0))

flg=Iselement ( lst_repid( repid(0) ) )
xlApp.StatusBar = "Checking  " & doc.title(0)

If doccoll.count<NumServOnClust  
And  flg=False   Then
xlsheet.Cells(rows,1).Value ="'"+ 
xlsheet.Cells(rows,2).Value ="'"+ 
Set tempdoc=doccoll.GetFirstDocument
While Not tempdoc Is Nothing    
xlsheet.Cells(rows,tempCol).Value ="'"+ 
Set tempdoc=doccoll.GetNextDocument(tempdoc)
xlApp.StatusBar = "Importing Notes Data - 
Document " & rows-1   
End If

Set doc=allview.GetNextDocument(doc)

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 Domino clustering
  • Tip: Domino clusters for Internet traffic
  • Expert Advice Implementing a Domino cluster and manual LEI failover

    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.

  • This was last published in August 2006

    Dig Deeper on Lotus Notes Domino Clustering

    Start the conversation

    Send me notifications when other members comment.

    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

    Please create a username to comment.




    • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

    • V6R1 upgrade planning checklist

      When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

    • Connecting multiple iSeries systems through DDM

      Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...