Case Studies
DSA News Briefs
Events
Press Releases
Publications
|
Publications
Domino Server Maintenance
Lotus Advisor Magazine
By Bill Sargent
A Domino database is much like a file system on a computer. With normal use, files are created, updated, and deleted. This results in fragmentation. The same holds true in a Domino database. Documents are created, edited, and deleted. Attachments to documents are created, updated, and deleted. All this activity results in “white space.” The COMPACT task on the server can take care of the white space in every database on the server. But, it can only work on a database that is not in use. And that can be problematic.
The busiest database on any Domino server is the system log, LOG.NSF. Everything the server does is written to the log. The server keeps a constant session with the log file, so it can write down everything it does. As a result, the database can’t be efficiently compacted.
The second busiest database is the Domino Directory, NAMES.NSF. The server is constantly looking in this one to resolve mail addresses, group memberships, mail routing, and access control, and maintains an open session with this database.
The system administrators are in and out of the Domino Directory all day long, too, adding and deleting users; creating, updating, and deleting groups; changing HTTP passwords; adding, updating, and deleting connection documents, program documents, and a host of other changes. All this activity can lead to white space in the Directory, but the server has that constant session, so the database can’t be efficiently compacted. Eventually, this fragmentation will affect server performance, and the users will notice that.
So, how does one compact the log and the Domino Directory if the server needs to access them all the time? Take the server down, of course. This action usually requires management approval, as the server will no longer be serving web pages and databases, nor will it be routing mail. Fortunately, the compaction is a fairly quick process.
The compact task is actually an executable named NCOMPACT.EXE on Windows NT/2000 servers. It has a similar name under Linux, OS/2, AS400, and other supported operating systems. It can be run from a command prompt. Just click Start, Run and type cmd into the dialog box. A DOS console will open. Change directories into Domino and type in the command. An example follows:
C:\Lotus\Domino\ncompact –B –D names.nsf
The file path might be different, depending on how the server was installed, but the command is the same. The –B and –D switches will compact the database in place, with file size reduction (-B) and discard any built view indexes (-D). This removes the maximum amount of white space from the database and helps keep view indexes up to date, by removing existing ones.
If there are only a few databases on the server that need compacted in this fashion, the administrator can easily type in the commands and bring the server back up when finished. If there are several to be compacted, however, then a batch file might be preferable. This saves the tedious and error prone typing process, and can even automate the process of stopping and restarting the server. The following sample batch file demonstrates the discussion above. Please note that the lines are numbered for convenience of discussion, and are not actually numbered in operation.
1. net stop "Lotus Domino Server (LotusDominoData)"
2. d:
3. cd\
4. cd lotus\domino
5. rem ncompact log.nsf
6. ncompact -B -D names.nsf
7. ncompact -B -D names2.nsf
8. ncompact -B -D names3.nsf
(repeat above for all directories in directory assistance, or for all cascaded directories, as applicable)
9. ncompact -B -D mail1.box
10. ncompact -B -D mail2.box
11. cd data
12. move d:\lotus\domino\data\log.nsf d:\logbackup\log.nsf
13. echo "Don't forget to rename the moved log file."
14. pause
15. net start "Lotus Domino Server (LotusDominoData)"
Line 1 stops the Domino server service. This closes the open sessions on the log and directory so the compact can be done. Lines 2 through 4 navigate to the drive and directory of the Domino executables. Line 5, if not commented out, will compact the log. The reason for the comment is addressed in line 12.
Lines 6 through 8 compact the primary Domino directory and secondary directories. Depending on organizational requirements, you may only need a single Domino directory compacted or may need a half-dozen or more done.
Lines 9 and 10 do the same for the mail router files on the server. If mail routing is used in your organization, these files are even more heavily fragmented than either the log or the directory.
Line 11 moves into the data directory. Line 12 moves the current log database into a separate directory outside of the Lotus\Domino structure. This is done to preserve a historical record of the server’s activity, in the event an audit of some type is necessary. Line 13 reminds the administrator to rename the moved file, so it won’t be overwritten the next time the batch file is run. Line 14 pauses the batch file until the administrator or operator hits a key. This is to reinforce the message in line 13. Finally, line 15 restarts the Domino server service.
The first time you run this batch file, it may take a while, depending on how many databases you are compacting and how long the server has been in operation. After the initial run, subsequent runs will be quicker.
Many other administrative tasks can be performed within this batch file. Updall and Fixup, with their respective switches can be run against databases of the administrator’s choosing. Just insert the proper commands ahead of line 11, to ensure proper execution.
This batch file has proven very useful to my client over the years. I hope it is useful to you as well.
|
|
|