Adventures with updall and compact on Domino 8.x databases (This database must be compacted to support the use of @AllChildren or @AllDescendants error on Domino 8.x continued)


During research on problems with views or view indexes – relating to the ” This database must be compacted to support the use of @AllChildren or @AllDescendants error on  Domino 8.x error” I was refreshing my recollection of the switches available for the updall and compact server commands for Domino 8

The following two items were very useful

Question
How does the Notes Indexer work?
Answer
Glossary of Notes Indexer Terms:
View – A view is one way of looking at all or some of the documents in the database. By selecting the View menu, you’ll see a list of available views for the selected database.

Collection – Each view in a Notes database has a corresponding collection in the database. A collection contains a series of indexes related to the particular view. The collection indexes consist of:

1. An index sorted by note number.
2. The user-defined view collection (defined in the Design View Sort dialog)
3. An index of parent-child documents within the view.

Refresh – Refresh a view by pressing F9. Refreshing the view reads from the index and repaints the screen accordingly. It does not rebuild the index.

Rebuild – Rebuild a view by pressing Shift+F9. Rebuilding a view makes a call to NIF, and causes the current view’s collection to be completely rebuilt.

Update – Pressing CTRL+SHIFT+F9 updates or builds all the views in the database. This includes both views which are hidden and views which are open. Pressing CTRL+SHIFT+F9 will work on server-based or local databases. If the views are not built, Notes will build them. If the views are already built, Notes will update them, not rebuild them.

Note: For additional information about rebuilding Notes indexes, refer to the document titled “What causes Notes database indexes to rebuild? (#1090329).

The Notes ‘Indexer’ is actually a composite of three different subsystems. They are described below.

Discussion of NIF

The Notes Indexing Facility is comprised of a set of functions that the Notes server uses to manipulate indexes. Most of these calls are made by the server as users access databases (remember that Notes is client-server).

As a user makes changes to documents in a database, the current view for that user is updated immediately. This process is necessary so that the user sees their changes as they occur.

When a user changes documents within one view, and then switches to another view, NIF sees that the database has been modified since the last time the collection was rebuilt, so it forces an update to the collection. When the new view is open, it will reflect the updated documents. Note that this update may take some time if many documents are involved (other user’s updates are included), or if the view is complex.

An indicator at the top left corner of the view (a reload arrow) signals that a view is out of date. That is, the database contains newer information than that reflected on the screen. Pressing F9 refreshes the view. Refreshing the view reads the index from the database, and paints it on your screen. Clicking the indicator with the mouse button also refreshes the view. (In Notes 3.x, the indicator that a view is out of date is a black question mark against a yellow background.)

The workstation normally stores the current chunk (called a page) of the index in memory. When you scroll back and forth within the view, you notice that scrolling down once or twice is quick, but the third times takes a few moments. This is because that third scroll has pushed you past the page of the index held in the workstations memory. A new page must be read from the database. This is when you may notice the refresh arrow. It will appear when you read a page of the index, and documents have been modified in the database since the view was last updated.

As you scroll up and down, you will see new documents in the view as they are updated by other users. The refresh arrow will display until you press F9. The view you have open may or may not change after pressing F9. This will depend on whether the modified document are supposed to appear in this view, or some other.

Discussion of Update

$Update.EXE is a process that runs continually, checking a work queue for databases to update. It checks the queue every 5 seconds. If it finds a queued request, it opens each collection within the specified database, forcing the update of the collections’ indexes.

Update is normally specified on the ServerTasks= line of the NOTES.INI. For example:

ServerTasks=Replica, Router, Update

The Update process works off a queue, and updates database indexes as requested. Requests normally comes from the Replicator, Router, or a user.

Replicator When a database replicates, the Replicator adds an entry to the Update queue.
Router When the Router adds a document to a database, it also adds an entry to the Update queue.
User When a user closes a database, the workstation adds an entry to the Update queue if the database has been modified.

Update will wait to combine multiple request for the same job. About 15 minutes after the replication ends, the Update queue kicks in, updating all the indexes on the database. When Update has refreshed all the collections, it updates any databases that have Full Text indexes with the Index Update Frequency set to ‘hourly’.

When a user closes a database, an entry is added to the Update queue. About 15 minutes later, the collections for that database will be updated to reflect the new documents that the user changed. If another user goes into the database before Update has updated the collections, the collection that the user opens is forced to update immediately. Note that this update may take some time if many documents are involved, or if the view is complex.

Discussion of Updall

$Updall.EXE is the single-instance version of $Update. It runs until it has processed each database, and terminates. It does not work from a queue. Like $Update, $Updall opens databases, forcing the update of the collection. When Update has rebuilt all the collections, it updates any databases that have Full Text indexes. Updall also purges delete stubs from databases.

Updall is normally specified on the ServerTasksat2= line of the Notes.INI. For example:

ServerTasksat2=Updall

Parameters for Updall

Updall – Basic options

Option in Task – Start tool Command-line option Description
  • Index all databases
  • Index only this database or folder
databasepath “Only this database” updates only the specified database. To update a database in the Domino data folder, enter the file name, for example, SALES.NSF. To update databases in a folder within the data folder, specify the database path relative to the data folder, for example, DOCREADME.NSF.”Index all databases” (or no database path) updates all databases on the server.
Update this view only database –Tviewtitle Updates a specific view in a database. Use, for example, with -R to solve corruption problems.To run Updall on a single view use the syntax:

Load Updall Database filename.nsf -T “viewname” -R

Updall – Update options

Option in Task – Start tool Command-line option Description
Update: All built views -V Updates built views and does not update full-text indexes.
Update: Full text indexes -F Updates full-text indexes and does not update views.
Update: Full text indexes: Only those with frequency set to: Immediate -H Updates full-text indexes assigned “Immediate” as an update frequency.
Update: Full text indexes: Only those with frequency set to: Immediate or Hourly -M Updates full-text indexes assigned “Immediate” or “Hourly” as an update frequency.
Update: Full text indexes: Only those with frequency set to: Immediate or Hourly or Daily -L Updates full-text indexes assigned “Immediate,” “Hourly,” or “Daily” as an update frequency.

Updall – Rebuild options

Option in Task – Start tool Command-line option Description
Rebuild: Full-text indexes only -X Rebuilds full-text indexes and does not rebuild views. Use to rebuild full-text indexes that are corrupted.
Rebuild: All used views -R Rebuilds all used views. Using this option is resource-intensive, so use it as a last resort to solve corruption problems with a specific database.
Rebuild: Full-text indexes and additionally: All unused views database -C Rebuilds unused views and a full-text index in a database. Requires you to specify a database.

Updall – Search Site options

Option in Task – Start tool Command-line option Description
Update database configurations: Incremental -A Incrementally updates search-site database configurations for search site databases.
Update database configurations: Full -B Does a full update of search-site database configurations for search site databases.

These parameters may be combined. For example:

Load Updall -V -M

AND

Question
What switches are available when running the Compact server task in Lotus Notes/Lotus Domino?
Answer
The default compaction style is “in-place compaction”.
NOTE: When the Compact task runs, it opens the database to find out the amount of “% used” (as opposed to looking in log.nsf).

When running Compact from the server console, the syntax is as follows:
load compact databasename -switch

Further info is available here http://www-01.ibm.com/support/docview.wss?uid=swg21084388

Having run a compact and updall against the database in question – with the error still occurring – I started to look more closely at the likelihood that there could have been use of either @alldescendants or @allchildren. So time for a search through the code. In notes 8.5.2 designer – kicked off a search for @all and was surprised to get 40 or so  matches. Now knowing that I would not have used the formula that frequently I  looked closely at the matches to find out what the exact use was.

Found an example that made no sense since it was a flat view and the select code for the records showed “21: event=’selection’><formula>SELECT ((Form = “Customer”)) | @AllDescendants</formula></code>” where I would have only expected the SELECT ((Form = “Customer”)) code.

In order to “persuade” designer to rebuild the index I  found that changing the selection criteria to formula from simple and also adding in an extra column (deleted once the item had saved) and then saving and reopening the view allowed me to open the view without the error.

So the  solution then

If you are getting the “This database must be compacted to support the use of @AllChildren or @AllDescendants error” in Notes 8 when you think you shouldn’t.

Open the view in designer

Remove the selection criteria

Save the view

Re-add the correct selection criteria (as formula or convert simple to formula)

add a new column to the view

Save it

Reopen it and delete the obsolete column once the view displays correctly.