Manage Learn to apply best practices and optimize your operations.

Tracking Usage Of Db

Often after moving a database to production the customer wants to know who is looking at what. Sometimes this is in response to wanting to clean up ACL and unwanted views, sometimes it is to try and enhance the database based on what is working. In response, I have written a utility that tracks who is going into a database, view, and when. The report is written to statistic database which can be monitored.
First, in the database to hold the statistics; build a Form that will hold 4 pieces of data

Text Field to contain the database name (DBOpened)
Text Field to contain the User opening a view (viewUserName)
Time Field to hold the date the view was opened (viewDateOpen)
Text Field to hold the name of the view that was opened (viewOpen)

Next, in the database you want to track usage, build a Script Library (I call mine TrackViewUse)
Sub TrackViewUse (Source As Notesuiview)
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim view As NotesView
Set view = Source.View
Dim db As notesdatabase
Set db = session.currentdatabase
Dim db2 As New notesdatabase ("", "")
Dim doc As notesdocument
Call db2.Open("MDDB1/BTV/A/IBMMD", "SHARED/IPD/pipestat.nsf")

Set doc=New notesdocument(db2)
doc.form = "viewUse"
doc.DBOpened = db.Title
doc.viewUserName = session.CommonUserName
doc.viewDateOpen = Now()
doc.viewOpen = view.Name
Call db2.Close
End Sub

Finally, in the database you want to track (you'll want to do this in each view)

In the Options for the views delecare the Subroutine
Use "TrackViewUse"

In the PostOpen Event of the views call the Subroutine
Sub Postopen(Source As Notesuiview)
TrackViewUse Source
End Sub

The results will be a document in the statistic database recording the database name, who entered and when, and the name of the view.

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

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 ...