Minor changes here and there. Still FIXMEs left.
[idzebra-moved-to-github.git] / doc / administration.xml
1 <chapter id="administration">
2  <!-- $Id: administration.xml,v 1.7 2002-10-10 14:27:18 heikki Exp $ -->
3  <title>Administrating Zebra</title>
4  
5  <para>
6   Unlike many simpler retrieval systems, Zebra supports safe, incremental
7   updates to an existing index.
8  </para>
9  
10  <para>
11   Normally, when Zebra modifies the index it reads a number of records
12   that you specify.
13   Depending on your specifications and on the contents of each record
14   one the following events take place for each record:
15   <variablelist>
16    
17    <varlistentry>
18     <term>Insert</term>
19     <listitem>
20      <para>
21       The record is indexed as if it never occurred before.
22       Either the Zebra system doesn't know how to identify the record or
23       Zebra can identify the record but didn't find it to be already indexed.
24      </para>
25     </listitem>
26    </varlistentry>
27    <varlistentry>
28     <term>Modify</term>
29     <listitem>
30      <para>
31       The record has already been indexed.
32       In this case either the contents of the record or the location
33       (file) of the record indicates that it has been indexed before.
34      </para>
35     </listitem>
36    </varlistentry>
37    <varlistentry>
38     <term>Delete</term>
39     <listitem>
40      <para>
41       The record is deleted from the index. As in the
42       update-case it must be able to identify the record.
43      </para>
44     </listitem>
45    </varlistentry>
46   </variablelist>
47  </para>
48  
49  <para>
50   Please note that in both the modify- and delete- case the Zebra
51   indexer must be able to generate a unique key that identifies the record 
52   in question (more on this below).
53  </para>
54  
55  <para>
56   To administrate the Zebra retrieval system, you run the
57   <literal>zebraidx</literal> program.
58   This program supports a number of options which are preceded by a dash,
59   and a few commands (not preceded by dash).
60 </para>
61  
62  <para>
63   Both the Zebra administrative tool and the Z39.50 server share a
64   set of index files and a global configuration file.
65   The name of the configuration file defaults to
66   <literal>zebra.cfg</literal>.
67   The configuration file includes specifications on how to index
68   various kinds of records and where the other configuration files
69   are located. <literal>zebrasrv</literal> and <literal>zebraidx</literal>
70   <emphasis>must</emphasis> be run in the directory where the
71   configuration file lives unless you indicate the location of the 
72   configuration file by option <literal>-c</literal>.
73  </para>
74  
75  <sect1 id="record-types">
76   <title>Record Types</title>
77   
78   <para>
79    Indexing is a per-record process, in which either insert/modify/delete
80    will occur. Before a record is indexed search keys are extracted from
81    whatever might be the layout the original record (sgml,html,text, etc..).
82    The Zebra system currently supports two fundamental types of records:
83    structured and simple text.
84    To specify a particular extraction process, use either the
85    command line option <literal>-t</literal> or specify a
86    <literal>recordType</literal> setting in the configuration file.
87   </para>
88   
89  </sect1>
90  
91  <sect1 id="configuration-file">
92   <title>The Zebra Configuration File</title>
93   
94   <para>
95    The Zebra configuration file, read by <literal>zebraidx</literal> and
96    <literal>zebrasrv</literal> defaults to <literal>zebra.cfg</literal>
97    unless specified by <literal>-c</literal> option.
98   </para>
99   
100   <para>
101    You can edit the configuration file with a normal text editor.
102    parameter names and values are separated by colons in the file. Lines
103    starting with a hash sign (<literal>&num;</literal>) are
104    treated as comments.
105   </para>
106   
107   <para>
108    If you manage different sets of records that share common
109    characteristics, you can organize the configuration settings for each
110    type into "groups".
111    When <literal>zebraidx</literal> is run and you wish to address a
112    given group you specify the group name with the <literal>-g</literal>
113    option.
114    In this case settings that have the group name as their prefix 
115    will be used by <literal>zebraidx</literal>.
116    If no <literal>-g</literal> option is specified, the settings
117    without prefix are used.
118   </para>
119   
120   <para>
121    In the configuration file, the group name is placed before the option
122    name itself, separated by a dot (.). For instance, to set the record type
123    for group <literal>public</literal> to <literal>grs.sgml</literal>
124    (the SGML-like format for structured records) you would write:
125   </para>
126   
127   <para>
128    <screen>
129     public.recordType: grs.sgml
130    </screen>   
131   </para>
132   
133   <para>
134    To set the default value of the record type to <literal>text</literal>
135    write:
136   </para>
137   
138   <para>
139    <screen>
140     recordType: text
141    </screen>
142   </para>
143   
144   <para>
145    The available configuration settings are summarized below. They will be
146    explained further in the following sections.
147   </para>
148   
149   <para>
150    FIXME - Didn't Adam make something to have multiple databases in multiple dirs...
151   </para>
152   
153   <para>
154    <variablelist>
155     
156     <varlistentry>
157      <term>
158       <emphasis>group</emphasis>
159       .recordType&lsqb;<emphasis>.name</emphasis>&rsqb;:
160       <replaceable>type</replaceable>
161      </term>
162      <listitem>
163       <para>
164        Specifies how records with the file extension
165        <emphasis>name</emphasis> should be handled by the indexer.
166        This option may also be specified as a command line option
167        (<literal>-t</literal>). Note that if you do not specify a
168        <emphasis>name</emphasis>, the setting applies to all files.
169        In general, the record type specifier consists of the elements (each
170        element separated by dot), <emphasis>fundamental-type</emphasis>,
171        <emphasis>file-read-type</emphasis> and arguments. Currently, two
172        fundamental types exist, <literal>text</literal> and
173        <literal>grs</literal>.
174       </para>
175      </listitem>
176     </varlistentry>
177     <varlistentry>
178      <term><emphasis>group</emphasis>.recordId: 
179      <replaceable>record-id-spec</replaceable></term>
180      <listitem>
181       <para>
182        Specifies how the records are to be identified when updated. See
183        <xref linkend="locating-records"/>.
184       </para>
185      </listitem>
186     </varlistentry>
187     <varlistentry>
188      <term><emphasis>group</emphasis>.database:
189      <replaceable>database</replaceable></term>
190      <listitem>
191       <para>
192        Specifies the Z39.50 database name.
193        FIXME - now we can have multiple databases in one server. -H
194       </para>
195      </listitem>
196     </varlistentry>
197     <varlistentry>
198      <term><emphasis>group</emphasis>.storeKeys:
199      <replaceable>boolean</replaceable></term>
200      <listitem>
201       <para>
202        Specifies whether key information should be saved for a given
203        group of records. If you plan to update/delete this type of
204        records later this should be specified as 1; otherwise it
205        should be 0 (default), to save register space.
206        See <xref linkend="file-ids"/>.
207       </para>
208      </listitem>
209     </varlistentry>
210     <varlistentry>
211      <term><emphasis>group</emphasis>.storeData:
212       <replaceable>boolean</replaceable></term>
213      <listitem>
214       <para>
215        Specifies whether the records should be stored internally
216        in the Zebra system files.
217        If you want to maintain the raw records yourself,
218        this option should be false (0).
219        If you want Zebra to take care of the records for you, it
220        should be true(1).
221       </para>
222      </listitem>
223     </varlistentry>
224     <varlistentry>
225      <term>register: <replaceable>register-location</replaceable></term>
226      <listitem>
227       <para>
228        Specifies the location of the various register files that Zebra uses
229        to represent your databases.
230        See <xref linkend="register-location"/>.
231       </para>
232      </listitem>
233     </varlistentry>
234     <varlistentry>
235      <term>shadow: <replaceable>register-location</replaceable></term>
236      <listitem>
237       <para>
238        Enables the <emphasis>safe update</emphasis> facility of Zebra, and
239        tells the system where to place the required, temporary files.
240        See <xref linkend="shadow-registers"/>.
241       </para>
242      </listitem>
243     </varlistentry>
244     <varlistentry>
245      <term>lockDir: <replaceable>directory</replaceable></term>
246      <listitem>
247       <para>
248        Directory in which various lock files are stored.
249       </para>
250      </listitem>
251     </varlistentry>
252     <varlistentry>
253      <term>keyTmpDir: <replaceable>directory</replaceable></term>
254      <listitem>
255       <para>
256        Directory in which temporary files used during zebraidx' update
257        phase are stored. 
258       </para>
259      </listitem>
260     </varlistentry>
261     <varlistentry>
262      <term>setTmpDir: <replaceable>directory</replaceable></term>
263      <listitem>
264       <para>
265        Specifies the directory that the server uses for temporary result sets.
266        If not specified <literal>/tmp</literal> will be used.
267       </para>
268      </listitem>
269     </varlistentry>
270     <varlistentry>
271      <term>profilePath: <literal>path</literal></term>
272      <listitem>
273       <para>
274        Specifies a path of profile specification files. 
275        The path is composed of one or more directories separated by
276        colon. Similar to PATH for UNIX systems.
277       </para>
278      </listitem>
279     </varlistentry>
280     <varlistentry>
281      <term>attset: <replaceable>filename</replaceable></term>
282      <listitem>
283       <para>
284        Specifies the filename(s) of attribute set files for use in
285        searching. At least the Bib-1 set should be loaded
286        (<literal>bib1.att</literal>).
287        The <literal>profilePath</literal> setting is used to look for
288        the specified files.
289        See <xref linkend="attset-files"/>
290       </para>
291      </listitem>
292     </varlistentry>
293     <varlistentry>
294      <term>memMax: <replaceable>size</replaceable></term>
295      <listitem>
296       <para>
297        Specifies <replaceable>size</replaceable> of internal memory
298        to use for the zebraidx program.
299        The amount is given in megabytes - default is 4 (4 MB).
300       </para>
301      </listitem>
302     </varlistentry>
303
304     <varlistentry>
305      <term>root: <replaceable>dir</replaceable></term>
306      <listitem>
307       <para>
308        Specifies a directory base for Zebra. All relative paths
309        given (in profilePath, register, shadow) are based on this
310        directory. This setting is useful if if you Zebra server
311        is running in a different directory from where
312        <literal>zebra.cfg</literal> is located.
313       </para>
314      </listitem>
315     </varlistentry>
316
317    </variablelist>
318   </para>
319   
320  </sect1>
321  
322  <sect1 id="locating-records">
323   <title>Locating Records</title>
324   
325   <para>
326    The default behavior of the Zebra system is to reference the
327    records from their original location, i.e. where they were found when you
328    ran <literal>zebraidx</literal>.
329    That is, when a client wishes to retrieve a record
330    following a search operation, the files are accessed from the place
331    where you originally put them - if you remove the files (without
332    running <literal>zebraidx</literal> again, the client
333    will receive a diagnostic message.
334   </para>
335   
336   <para>
337    If your input files are not permanent - for example if you retrieve
338    your records from an outside source, or if they were temporarily
339    mounted on a CD-ROM drive,
340    you may want Zebra to make an internal copy of them. To do this,
341    you specify 1 (true) in the <literal>storeData</literal> setting. When
342    the Z39.50 server retrieves the records they will be read from the
343    internal file structures of the system.
344   </para>
345   
346  </sect1>
347  
348  <sect1 id="simple-indexing">
349   <title>Indexing with no Record IDs (Simple Indexing)</title>
350   
351   <para>
352    If you have a set of records that are not expected to change over time
353    you may can build your database without record IDs.
354    This indexing method uses less space than the other methods and
355    is simple to use. 
356   </para>
357   
358   <para>
359    To use this method, you simply omit the <literal>recordId</literal> entry
360    for the group of files that you index. To add a set of records you use
361    <literal>zebraidx</literal> with the <literal>update</literal> command. The
362    <literal>update</literal> command will always add all of the records that it
363    encounters to the index - whether they have already been indexed or
364    not. If the set of indexed files change, you should delete all of the
365    index files, and build a new index from scratch.
366   </para>
367   
368   <para>
369    Consider a system in which you have a group of text files called
370    <literal>simple</literal>.
371    That group of records should belong to a Z39.50 database called
372    <literal>textbase</literal>.
373    The following <literal>zebra.cfg</literal> file will suffice:
374   </para>
375   <para>
376    
377    <screen>
378     profilePath: /usr/local/yaz
379     attset: bib1.att
380     simple.recordType: text
381     simple.database: textbase
382    </screen>
383
384   </para>
385   
386   <para>
387    Since the existing records in an index can not be addressed by their
388    IDs, it is impossible to delete or modify records when using this method.
389   </para>
390   
391  </sect1>
392  
393  <sect1 id="file-ids">
394   <title>Indexing with File Record IDs</title>
395   
396   <para>
397    If you have a set of files that regularly change over time: Old files
398    are deleted, new ones are added, or existing files are modified, you
399    can benefit from using the <emphasis>file ID</emphasis>
400    indexing methodology.
401    Examples of this type of database might include an index of WWW
402    resources, or a USENET news spool area.
403    Briefly speaking, the file key methodology uses the directory paths
404    of the individual records as a unique identifier for each record.
405    To perform indexing of a directory with file keys, again, you specify
406    the top-level directory after the <literal>update</literal> command.
407    The command will recursively traverse the directories and compare
408    each one with whatever have been indexed before in that same directory.
409    If a file is new (not in the previous version of the directory) it
410    is inserted into the registers; if a file was already indexed and
411    it has been modified since the last update, the index is also
412    modified; if a file has been removed since the last
413    visit, it is deleted from the index.
414   </para>
415   
416   <para>
417    The resulting system is easy to administrate. To delete a record you
418    simply have to delete the corresponding file (say, with the
419    <literal>rm</literal> command). And to add records you create new
420    files (or directories with files). For your changes to take effect
421    in the register you must run <literal>zebraidx update</literal> with
422    the same directory root again. This mode of operation requires more
423    disk space than simpler indexing methods, but it makes it easier for
424    you to keep the index in sync with a frequently changing set of data.
425    If you combine this system with the <emphasis>safe update</emphasis>
426    facility (see below), you never have to take your server off-line for
427    maintenance or register updating purposes.
428   </para>
429   
430   <para>
431    To enable indexing with pathname IDs, you must specify
432    <literal>file</literal> as the value of <literal>recordId</literal>
433    in the configuration file. In addition, you should set
434    <literal>storeKeys</literal> to <literal>1</literal>, since the Zebra
435    indexer must save additional information about the contents of each record
436    in order to modify the indexes correctly at a later time.
437   </para>
438   
439    <!--FIXME - There must be a simpler way to do this with Adams string tags -H
440      -->
441
442   <para>
443    For example, to update records of group <literal>esdd</literal>
444    located below
445    <literal>/data1/records/</literal> you should type:
446    <screen>
447     $ zebraidx -g esdd update /data1/records
448    </screen>
449   </para>
450   
451   <para>
452    The corresponding configuration file includes:
453    <screen>
454     esdd.recordId: file
455     esdd.recordType: grs.sgml
456     esdd.storeKeys: 1
457    </screen>
458   </para>
459   
460   <note>
461    <para>You cannot start out with a group of records with simple
462     indexing (no record IDs as in the previous section) and then later
463     enable file record Ids. Zebra must know from the first time that you
464     index the group that
465     the files should be indexed with file record IDs.
466    </para>
467    </note>
468   
469   <para>
470    You cannot explicitly delete records when using this method (using the
471    <literal>delete</literal> command to <literal>zebraidx</literal>. Instead
472    you have to delete the files from the file system (or move them to a
473    different location)
474    and then run <literal>zebraidx</literal> with the
475    <literal>update</literal> command.
476   </para>
477 </sect1>
478  
479  <sect1 id="generic-ids">
480   <title>Indexing with General Record IDs</title>
481   
482   <para>
483    When using this method you construct an (almost) arbitrary, internal
484    record key based on the contents of the record itself and other system
485    information. If you have a group of records that explicitly associates
486    an ID with each record, this method is convenient. For example, the
487    record format may contain a title or a ID-number - unique within the group.
488    In either case you specify the Z39.50 attribute set and use-attribute
489    location in which this information is stored, and the system looks at
490    that field to determine the identity of the record.
491   </para>
492   
493   <para>
494    As before, the record ID is defined by the <literal>recordId</literal>
495    setting in the configuration file. The value of the record ID specification
496    consists of one or more tokens separated by whitespace. The resulting
497    ID is represented in the index by concatenating the tokens and
498    separating them by ASCII value (1).
499   </para>
500   
501   <para>
502    There are three kinds of tokens:
503    <variablelist>
504     
505     <varlistentry>
506      <term>Internal record info</term>
507      <listitem>
508       <para>
509        The token refers to a key that is
510        extracted from the record. The syntax of this token is
511        <literal>(</literal> <emphasis>set</emphasis> <literal>,</literal>
512        <emphasis>use</emphasis> <literal>)</literal>,
513        where <emphasis>set</emphasis> is the
514        attribute set name <emphasis>use</emphasis> is the
515        name or value of the attribute.
516       </para>
517      </listitem>
518     </varlistentry>
519     <varlistentry>
520      <term>System variable</term>
521      <listitem>
522       <para>
523        The system variables are preceded by
524        
525        <screen>
526         $
527        </screen>
528        and immediately followed by the system variable name, which
529        may one of
530        <variablelist>
531         
532         <varlistentry>
533          <term>group</term>
534          <listitem>
535           <para>
536            Group name.
537           </para>
538          </listitem>
539         </varlistentry>
540         <varlistentry>
541          <term>database</term>
542          <listitem>
543           <para>
544            Current database specified.
545           </para>
546          </listitem>
547         </varlistentry>
548         <varlistentry>
549          <term>type</term>
550          <listitem>
551           <para>
552            Record type.
553           </para>
554          </listitem>
555         </varlistentry>
556        </variablelist>
557       </para>
558      </listitem>
559     </varlistentry>
560     <varlistentry>
561      <term>Constant string</term>
562      <listitem>
563       <para>
564        A string used as part of the ID &mdash; surrounded
565        by single- or double quotes.
566       </para>
567      </listitem>
568     </varlistentry>
569    </variablelist>
570   </para>
571   
572   <para>
573    For instance, the sample GILS records that come with the Zebra
574    distribution contain a unique ID in the data tagged Control-Identifier.
575    The data is mapped to the Bib-1 use attribute Identifier-standard
576    (code 1007). To use this field as a record id, specify
577    <literal>(bib1,Identifier-standard)</literal> as the value of the
578    <literal>recordId</literal> in the configuration file.
579    If you have other record types that uses the same field for a
580    different purpose, you might add the record type
581    (or group or database name) to the record id of the gils
582    records as well, to prevent matches with other types of records.
583    In this case the recordId might be set like this:
584    
585    <screen>
586     gils.recordId: $type (bib1,Identifier-standard)
587    </screen>
588    
589   </para>
590   
591   <para>
592    (see <xref linkend="data-model"/>
593     for details of how the mapping between elements of your records and
594     searchable attributes is established).
595   </para>
596   
597   <para>
598    As for the file record ID case described in the previous section,
599    updating your system is simply a matter of running
600    <literal>zebraidx</literal>
601    with the <literal>update</literal> command. However, the update with general
602    keys is considerably slower than with file record IDs, since all files
603    visited must be (re)read to discover their IDs. 
604   </para>
605   
606   <para>
607    As you might expect, when using the general record IDs
608    method, you can only add or modify existing records with the
609    <literal>update</literal> command.
610    If you wish to delete records, you must use the,
611    <literal>delete</literal> command, with a directory as a parameter.
612    This will remove all records that match the files below that root
613    directory.
614   </para>
615   
616  </sect1>
617  
618  <sect1 id="register-location">
619   <title>Register Location</title>
620   
621   <para>
622    Normally, the index files that form dictionaries, inverted
623    files, record info, etc., are stored in the directory where you run
624    <literal>zebraidx</literal>. If you wish to store these, possibly large,
625    files somewhere else, you must add the <literal>register</literal>
626    entry to the <literal>zebra.cfg</literal> file.
627    Furthermore, the Zebra system allows its file
628    structures to span multiple file systems, which is useful for
629    managing very large databases. 
630   </para>
631   
632   <para>
633    The value of the <literal>register</literal> setting is a sequence
634    of tokens. Each token takes the form:
635    
636    <screen>
637     <emphasis>dir</emphasis><literal>:</literal><emphasis>size</emphasis>. 
638    </screen>
639    
640    The <emphasis>dir</emphasis> specifies a directory in which index files
641    will be stored and the <emphasis>size</emphasis> specifies the maximum
642    size of all files in that directory. The Zebra indexer system fills
643    each directory in the order specified and use the next specified
644    directories as needed.
645    The <emphasis>size</emphasis> is an integer followed by a qualifier
646    code, 
647    <literal>b</literal> for bytes,
648    <literal>k</literal> for kilobytes.
649    <literal>M</literal> for megabytes,
650    <literal>G</literal> for gigabytes.
651   </para>
652   
653   <para>
654    For instance, if you have allocated two disks for your register, and
655    the first disk is mounted
656    on <literal>/d1</literal> and has 2GB of free space and the
657    second, mounted on <literal>/d2</literal> has 3.6 GB, you could
658    put this entry in your configuration file:
659    
660    <screen>
661     register: /d1:2G /d2:3600M
662    </screen>
663    
664   </para>
665   
666   <para>
667    Note that Zebra does not verify that the amount of space specified is
668    actually available on the directory (file system) specified - it is
669    your responsibility to ensure that enough space is available, and that
670    other applications do not attempt to use the free space. In a large
671    production system, it is recommended that you allocate one or more
672    file system exclusively to the Zebra register files.
673   </para>
674   
675  </sect1>
676  
677  <sect1 id="shadow-registers">
678   <title>Safe Updating - Using Shadow Registers</title>
679   
680   <sect2>
681    <title>Description</title>
682    
683    <para>
684     The Zebra server supports <emphasis>updating</emphasis> of the index
685     structures. That is, you can add, modify, or remove records from
686     databases managed by Zebra without rebuilding the entire index.
687     Since this process involves modifying structured files with various
688     references between blocks of data in the files, the update process
689     is inherently sensitive to system crashes, or to process interruptions:
690     Anything but a successfully completed update process will leave the
691     register files in an unknown state, and you will essentially have no
692     recourse but to re-index everything, or to restore the register files
693     from a backup medium.
694     Further, while the update process is active, users cannot be
695     allowed to access the system, as the contents of the register files
696     may change unpredictably.
697    </para>
698    
699    <para>
700     You can solve these problems by enabling the shadow register system in
701     Zebra.
702     During the updating procedure, <literal>zebraidx</literal> will temporarily
703     write changes to the involved files in a set of "shadow
704     files", without modifying the files that are accessed by the
705     active server processes. If the update procedure is interrupted by a
706     system crash or a signal, you simply repeat the procedure - the
707     register files have not been changed or damaged, and the partially
708     written shadow files are automatically deleted before the new updating
709     procedure commences.
710    </para>
711    
712    <para>
713     At the end of the updating procedure (or in a separate operation, if
714     you so desire), the system enters a "commit mode". First,
715     any active server processes are forced to access those blocks that
716     have been changed from the shadow files rather than from the main
717     register files; the unmodified blocks are still accessed at their
718     normal location (the shadow files are not a complete copy of the
719     register files - they only contain those parts that have actually been
720     modified). If the commit process is interrupted at any point during the
721     commit process, the server processes will continue to access the
722     shadow files until you can repeat the commit procedure and complete
723     the writing of data to the main register files. You can perform
724     multiple update operations to the registers before you commit the
725     changes to the system files, or you can execute the commit operation
726     at the end of each update operation. When the commit phase has
727     completed successfully, any running server processes are instructed to
728     switch their operations to the new, operational register, and the
729     temporary shadow files are deleted.
730    </para>
731    
732   </sect2>
733   
734   <sect2>
735    <title>How to Use Shadow Register Files</title>
736    
737    <para>
738     The first step is to allocate space on your system for the shadow
739     files.
740     You do this by adding a <literal>shadow</literal> entry to the
741     <literal>zebra.cfg</literal> file.
742     The syntax of the <literal>shadow</literal> entry is exactly the
743     same as for the <literal>register</literal> entry
744     (see <xref linkend="register-location"/>).
745      The location of the shadow area should be
746      <emphasis>different</emphasis> from the location of the main register
747      area (if you have specified one - remember that if you provide no
748      <literal>register</literal> setting, the default register area is the
749      working directory of the server and indexing processes).
750    </para>
751    
752    <para>
753     The following excerpt from a <literal>zebra.cfg</literal> file shows
754     one example of a setup that configures both the main register
755     location and the shadow file area.
756     Note that two directories or partitions have been set aside
757     for the shadow file area. You can specify any number of directories
758     for each of the file areas, but remember that there should be no
759     overlaps between the directories used for the main registers and the
760     shadow files, respectively.
761    </para>
762    <para>
763     
764     <screen>
765      register: /d1:500M
766      
767      shadow: /scratch1:100M /scratch2:200M
768     </screen>
769     
770    </para>
771    
772    <para>
773     When shadow files are enabled, an extra command is available at the
774     <literal>zebraidx</literal> command line.
775     In order to make changes to the system take effect for the
776     users, you'll have to submit a "commit" command after a
777     (sequence of) update operation(s).
778    </para>
779    
780    <para>
781     
782     <screen>
783      $ zebraidx update /d1/records 
784      $ zebraidx commit
785     </screen>
786     
787    </para>
788    
789    <para>
790     Or you can execute multiple updates before committing the changes:
791    </para>
792    
793    <para>
794     
795     <screen>
796      $ zebraidx -g books update /d1/records  /d2/more-records
797      $ zebraidx -g fun update /d3/fun-records
798      $ zebraidx commit
799     </screen>
800     
801    </para>
802    
803    <para>
804     If one of the update operations above had been interrupted, the commit
805     operation on the last line would fail: <literal>zebraidx</literal>
806     will not let you commit changes that would destroy the running register.
807     You'll have to rerun all of the update operations since your last
808     commit operation, before you can commit the new changes.
809    </para>
810    
811    <para>
812     Similarly, if the commit operation fails, <literal>zebraidx</literal>
813     will not let you start a new update operation before you have
814     successfully repeated the commit operation.
815     The server processes will keep accessing the shadow files rather
816     than the (possibly damaged) blocks of the main register files
817     until the commit operation has successfully completed.
818    </para>
819    
820    <para>
821     You should be aware that update operations may take slightly longer
822     when the shadow register system is enabled, since more file access
823     operations are involved. Further, while the disk space required for
824     the shadow register data is modest for a small update operation, you
825     may prefer to disable the system if you are adding a very large number
826     of records to an already very large database (we use the terms
827     <emphasis>large</emphasis> and <emphasis>modest</emphasis>
828     very loosely here, since every application will have a
829     different perception of size).
830     To update the system without the use of the the shadow files,
831     simply run <literal>zebraidx</literal> with the <literal>-n</literal>
832     option (note that you do not have to execute the
833     <emphasis>commit</emphasis> command of <literal>zebraidx</literal>
834     when you temporarily disable the use of the shadow registers in
835     this fashion.
836     Note also that, just as when the shadow registers are not enabled,
837     server processes will be barred from accessing the main register
838     while the update procedure takes place.
839    </para>
840    
841   </sect2>
842   
843  </sect1>
844  
845 </chapter>
846  <!-- Keep this comment at the end of the file
847  Local variables:
848  mode: sgml
849  sgml-omittag:t
850  sgml-shorttag:t
851  sgml-minimize-attributes:nil
852  sgml-always-quote-attributes:t
853  sgml-indent-step:1
854  sgml-indent-data:t
855  sgml-parent-document: "zebra.xml"
856  sgml-local-catalogs: nil
857  sgml-namecase-general:t
858  End:
859  -->