Sei sulla pagina 1di 3

With regards to the "Compact In-Use Databases" tip (attached below) in the

NTILOT0307 issue of Lotus Advisor Explorer, I'd add the following.

First, the tip actually tells you how to down the server so you can compact a no-
longer-in-use .NSF. That said, here are a few things I've noticed on this subject:

• On a multi-processor box, the compact process can use all CPUs, and the
task flies (very fast).
• On the same multi-processor box, my tests have shown only one CPU is
tasked (much slower) when using ncompact vs. compact.
• If you've downed your production server and you're waiting for one CPU to
do the job, you might be down longer than you bargained for.

Before you attempt this technique (down and ncompact on your production files),
you might want to shut down the server, do an OS copy, and let ncompact work on a
non-production, decent-size .NSF copy so you can see just how long you would have
been down had you been working on the real file. It's good to know whether you'll be
down for 30 seconds or hours. (My NamesNET takes 40 to 60 minutes to compact
using ncompact on a dual PIII-700 with 1GB RAM with striped U2UW SCSI RAID0
array.)

If it takes too long, you might instead (for those big in-use files) want to create a
new replica (no white space), down the server, sync the old with the new with a
client, and rename the newly replicated file to the old. I do this, and the 40 to 60
minute operation is done in less than 1 minute.

Another benefit is you have a copy of the .NSF when you're done, and you can
instantly down-rename back to the original to reduce the chances of a compact
problem.

I hope this helps with your database compacts!

The original "Compact In-Use Databases" tip is as follows:

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 not in use. This limitation can be
problematic, especially for the system log, Log.nsf, and the Domino Directory,
Names.nsf.

So, how do you compact the log and the Domino Directory if the server must access
them all the time? Take the server down, of course. This action usually requires
management approval, because the server will no longer be serving Web pages and
databases or routing mail. Fortunately, you can do the compaction quickly.

The compact task is an executable named Ncompact.exe on Windows NT/2000


servers. It has a similar name under Linux, OS/2, AS/400, and other supported
operating systems. You can run it from a command prompt. Just click on Start, then
Run, and type cmd in the dialog. A DOS console opens. Change directories to
Domino and type in the command. Here's an example:
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 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 you have to compact only a few databases on the server this way, the
administrator can easily type in the commands and bring the server back up when
finished. If you have to compact several, you'd be better off using a batch file similar
to the one below. The batch file eliminates the tedious and error-prone typing
process and can even automate the process of stopping and restarting the server.
(I've numbered the lines to discuss the code more clearly line-by-line; they aren't
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 lines 1 through 8 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 happen. Lines 2 through 4 navigate to the drive and
directory of the Domino executables. Line 5, if not commented out, compacts 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 have to compact only a single
Domino directory, or you may have to compact a half-dozen or more.

Lines 9 and 10 do the same for the mail router files on the server. If you use mail
routing in your organization, these files are even more heavily fragmented than the
log or the directory.

Line 11 moves into the data directory. Line 12 moves the current log database into a
separate directory outside the Lotus\Domino structure. This action preserves a
historical record of the server's activity, in the event an audit is necessary. Line 13
reminds the administrator to rename the moved file so it won't be overwritten the
next time the batch file runs. Line 14 pauses the batch file until the administrator or
operator presses a key. This pause reinforces the message in line 13. Finally, line 15
restarts the Domino server service.

You can perform many other administrative tasks within this batch file. You can run
Updall and Fixup, with their respective switches, against databases the administrator
chooses. Just insert the proper commands prior to line 11 to ensure execution.

CLICK to discuss this topic with the Advisor community (opens new window).

How to Compact In-Use Databases, Revisited


No reader comments ... yet.

Printer-friendly
page layout

How to Compact In-Use Databases, Revisited -- Tags: Administration, Database, Database Development, IBM,
IBM Lotus, IBM Lotus Domino, IBM Software

Potrebbero piacerti anche