Is there any command to compact all the databases in mail directory at once instead of compacting one by one.
Subject: from the help file
The following tables describe the options you can use with the Compact server task. The first column lists the options as they appear when you run Compact using the Task - Start tool or the Files tab in the Domino Administrator. The second column lists the equivalent command-line options that you use when you run Compact using a console command or using a Program document.
Compact - Basics
Option
Command-line equivalent
Description
Compact only this database or folder
(To specify databases to compact using the Files tab, select the databases in the files pane.)
database path
Specify any additional options after the database path.
To compact a database in the Domino data folder, enter the file name, for example SALES.NSF. To compact databases in a folder within the data folder, specify the database path relative to the data folder. For example, to compact all databases in the folder DATA\SALES, specify SALES.
If you choose “Compact all databases” (or don’t specify a database path at the command line) Compact compacts all databases in the data folder and in folders within the data folder.
For more information on database path, see Running Compact using a console command.
Compact - Options
Option
Command-line equivalent
Description
Compact database only if unused space is greater than x percent
-S percent
Compacts all databases with a specified percent of unused space. For example, if you specify 10, databases with 10% or more recorded unused space are compacted. Note that the unused space calculation is not always a reliable measure of unused space.
Discard any built view indexes
-D
Discards built view indexes. Use this option to compact databases just before you store them on tape, for example. Does copy-style compacting.
Keep or revert database to previous format
-R
Compacts databases without converting to the current release file format of the server that stores the databases or reverts databases in the current release file format to the previous release file format. For example, on Domino 6 servers, this option compacts Domino 5 databases without converting them to the Domino 6 file format and converts Domino 6 databases to the Domino 5 file format. This option uses copy-style compacting.
Compact - Style
Option
Command-line equivalent
Description
In-place (recommended)
-b
Uses in-place compacting and recovers unused space without reducing the file size, unless there’s a pending structural change to a database, in which case copy-style compacting occurs. This is the recommended method of compacting.
In-place with file size reduction
-B
Uses in-place compacting, recovers unused space and reduces file size, unless there’s a pending structural change in which case copy-style compacting occurs. If you use transaction logging, do full database backups after compacting completes.
Copy-style
-c
Uses copy-style compacting. Use this option, for example, to solve database corruption problems.
Copy-style: Allow access while compacting
-L
Enables users to continue to access databases during compacting. If a user edits a database during compacting, compacting is canceled. This is useful only when copy-style compacting is done.
Copy-style: Ignore errors and proceed
-i
Enables compacting to continue even if it encounters errors such as document corruption. Only used for copy-style compacting.
Compact - Advanced
The advanced compact options are not available through the Compact tool in the Files tab of the Domino Administrator.
Option*
Command-line equivalent
Description
Document table bitmap optimization: Off
-f
Disables “Document table bitmap optimization” database property. Does copy-style compacting.
Document table bitmap optimization: On
-F
Enables “Document table bitmap optimization” database property. Does copy-style compacting.
Don’t support specialized response hierarchy: Off
-h
Disables “Don’t support specialized response hierarchy” database property; in other words, support specialized response hierarchy. Does copy-style compacting.
Don’t support specialized response hierarchy: On
-H
Enables “Don’t support specialized response hierarchy” database property; in other words, do not support specialized response hierarchy. Does copy-style compacting.
Enable transaction logging: Off
-t
Disables transaction logging.
Enable transaction logging: On
-T
Enables transaction logging. Use Compact - T when a database is open or closed. If you use Compact - T on a database that is closed, logging is enabled but the Compact is not logged until the database is opened; therefore, logging is not available until you reopen the database.
Don’t maintain unread marks: Off
-u
Disables “Don’t maintain unread marks” database property; in other words, maintain unread marks.
Don’t maintain unread marks: On
-U
Enables “Don’t maintain unread marks” database property; in other words, do not maintain unread marks.
- Select “Set advanced properties” before you enable or disable any of these properties.
Compact - Archive
When you use the document archiving tool to archive and delete documents in a database, you can use the following Compact options to archive documents if the database is located on a server and you’ve chosen the advanced archiving option “Automatically on server.”
For more information on the server archiving option, see Archiving locally or on a server if you have installed Lotus Notes 6 Help. Or, go to www.lotus.com/ldd/doc to download or view Lotus Notes 6 Help.
Option*
Command-line equivalent
Description
Archive only
-A
Archives and deletes documents from a database without compacting the database.
Archive and then compact
-a
Archives and deletes documents from a database and then compacts the database.
Delete and then archive
-j
Deletes documents from a database and then compacts the database.
*The Compact tool in the Files tab of the Domino Administrator provides only the option “Archive database;” this option archives and then compacts.
See also
Ways to compact databases
Compacting databases
Database properties that optimize database performance
Running Compact using a console command
Glossary
Feedback on Help or Product Usability?
Subject: How to compact all the databases in mail directory at once
While the other two answers are technically feasible, there’s a little more to each one than meets the eye.
-
To do all the files in a directory on the server (whether mail, or anything else) go to the Files tab in Domino Administrator. Select all the files in the directory you want to compact, right-click on any one of them, and choose “compact” from the Context menu. This lets the server do the compacting while yo ugo do something else.
-
it’s a good plan to compact BOTH before AND after an upgrade; frequently, upgrads include all sorts of invisible stuff which makes files dramatically smaller (and if you are unlucky, dramatically bigger!).
-
If you don’t get much space back after compacting, then consider a) rebuilding the view indexes (consult admin help for compact switches to do this) or b) take a new replica of the file and dump the original. Quite a few mail files can get ‘stuck’ - I had one the other week which just inched over 8Gb before falling apart with loads of un-deletable delete stubs. A new replica got that down to 1.4Gb…
Subject: RE :How to compact all the databases in mail directory at once
You should create a program on the admin client for the server and then look at calling the compact command as a sheduled task.
See admin help and the correct sintacs for the command I use compact -B
Subject: How to compact all the databases in mail directory at once
Try running d:\lotus\domino\data\ncompact mail\ from a dos prompt. I’d shut the server down to do the whole server every three months, or before upgrades.
You can also specify a program the server runs on a periodic basis. In 6.5.1 it’s located in Configuration\Servers\Programs view and I have mine as compact -S10 -B \mail