Home > Domino Tips > Administrator > Clustering > Locate missing databases in a Lotus Domino cluster
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

CLUSTERING

Locate missing databases in a Lotus Domino cluster


Blessan V Philip
08.10.2006
Rating: -4.20- (out of 5) Hall of fame tip of the month winner


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


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 


rows=1
cols=1 


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")
 db_nm="cldbdir.nsf"
 
TempNumServOnClust=Inputbox$
("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
Else
NumServOnClust=Cint(TempNumServOnClust)
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.Workbooks.Add
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..."

rows=2 

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

maxcols=NumServOnClust

Set doc=allview.GetFirstDocument

rows=3 
 
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 ="'"+ 
doc.GetItemValue("Pathname")(0) 
xlsheet.Cells(rows,2).Value ="'"+ 
doc.GetItemValue("Title")(0)    
   
'=================================
======================
Set tempdoc=doccoll.GetFirstDocument
tempCol=3
While Not tempdoc Is Nothing    
xlsheet.Cells(rows,tempCol).Value ="'"+ 
tempdoc.GetItemValue("Server")(0)   
Set tempdoc=doccoll.GetNextDocument(tempdoc)
tempCol=tempCol+1
Wend
'===================================
========================
   
   
xlApp.StatusBar = "Importing Notes Data - 
Document " & rows-1   
 
rows=rows+1
   
End If
 
lst_repid(repid(0))=repid(0)

Set doc=allview.GetNextDocument(doc)
Wend

xlApp.Rows("1:1").Select
xlApp.Selection.Font.Bold = True
xlApp.Selection.Font.Underline = True
xlApp.Range(xlsheet.Cells(2,1), 
xlsheet.Cells(rows,maxcols)).Select
xlApp.Selection.Font.Name = "Arial"
xlApp.Selection.Font.Size = 9
xlApp.Selection.Columns.AutoFit
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.Range("A1").Select
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 SearchDomino.com:

  • 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 SearchDomino.com 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.

    Rate this Tip
    To rate tips, you must be a member of SearchDomino.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



    RELATED CONTENT
    Lotus Notes Domino Clustering
    Domino Mailbag: Notes/Domino clustering
    LotusScript code rebuilds corrupted busytime.nsf file
    Routing Domino cluster servers to the correct network
    Lotus Domino server clustering
    Comparing replicas on clustered Lotus Domino servers
    Upgrade all members of the cluster?
    DB replacement function malfunctions in a clustered environment
    Can I configure Domino to use private LAN for Directory lookups?
    Preparing for consolidation -- Part 1
    Create a separate LAN for cluster replication traffic

    Clustering
    Comparing replicas on clustered Lotus Domino servers
    Preparing for consolidation -- Part 1
    Domino cluster tuning
    Monitoring cluster replication
    Mail delegation in cluster environment
    Domino clusters for Internet traffic
    A primer on Domino clustering

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



  • Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
    HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts