Rebuilding a Data Source

In this section:

How to:

The Rebuild utility provides a number of useful project management utilities. Rebuild enables you to restructure data sources, rebuild indexes, and check the integrity of data sources.

Note: You can only use this utility with FOCUS data sources.


Top of page

x
Procedure: How to Use the Rebuild Utility

To open the Rebuild dialog box:

  1. Click Utilities from the Command menu and select Rebuild.

    The Rebuild dialog box opens, as shown in the following image.

    the Rebuild dialog box

  2. Select a Rebuild option.
    Rebuild a disorganized file

    This option can be used to perform the following functions:

    • Reoptimize a FOCUS data source after a large amount of data has been added or deleted.
    • Select specific segment instances to include in the data source, based on record selection criteria you specify.
    Index a field

    Builds or rebuilds the index for the specified field. Use this option to index an additional field that was not originally specified as an index field or to change the index for a field. See Rebuilding the Index.

    Check the integrity of a file

    Checks the structural integrity of a data source. If FOCUS encounters an error during the check, it displays a message. For more information, see Checking the Integrity of a Data Source.

  3. Enter the name of the data source to rebuild. You can either manually name the source, or click the Browse button to open a dialog box and select the data source.
  4. In the Selection Criteria field, specify the selection criteria for rebuilding a disorganized data source and reorganizing a data source to fit a new Master File. Only data that meets the selection criteria is included in the rebuilt data source.

Top of page

x
Rebuilding a Disorganized File

This option in the Rebuild dialog box enables you to:


Top of page

x
Rebuilding the Index

How to:

When you first create a Master File in the Synonym Editor, you specify the fields that you want indexed. Sometimes, after data is entered, you may need to index an additional field that was not originally specified as an index field.

The first step is to alter the Master File to indicate that the field should be indexed. Altering the Master File does not actually create the index. To do this, you must use the Rebuild utility after you index a field.



x
Procedure: How to Index a Field After Data Is Entered

From the Synonym Editor, select the field to be indexed, and then click the I - Index check box under the FIELDTYPE attribute.

or

Open and edit the Master File as text in the Text Editor. For instructions on indexing a field as text, see the Describing Data With WebFOCUS Language manual.

After you index a field you must rebuild the index. See How to Rebuild the Index.



x
Procedure: How to Rebuild the Index
  1. In the Rebuild dialog box, select Index a field.
  2. In the Filename field, type a data source name or click Browse and select a data source from the list.
  3. In the Field to Index field, type the name of the field you want to index.

    To index all the fields designated as index fields in that data source, type an asterisk (*) in the Field to Index box.

  4. Click OK.

    The Rebuild utility rebuilds the data source, creating an index for all specified fields.

For more information on indexing fields, see the Describing Data With WebFOCUS Language manual.


Top of page

x
Checking the Integrity of a Data Source

How to:

It is rare for the structural integrity of a FOCUS data source to be damaged. Structural damage will occasionally occur, however, during a disk drive failure or if an incorrect Master File is used. In this situation, you can check the integrity of the Master File. Checking the integrity of a Master File performs the following essential tasks:

While checking the integrity reports on a good deal of data that would otherwise be lost, it is important to remember that backing up your FOCUS data sources frequently is the best method for preventing data loss.

Checking the Master File integrity will occasionally fail to uncover structural damage. If you have reason to believe that there is damage to your data source, though results from checking the integrity indicates otherwise, there is a second method of checking file integrity. This method uses the ? FILE and TABLEF commands. For more information, see the Describing Data With WebFOCUS Language manual.



x
Procedure: How to Check the Structural Integrity of a FOCUS Data Source

In the Rebuild dialog box, select Check the integrity of a file.

If the Rebuild utility encounters an error during the check, it logs a message for you. You should then attempt to recover as much of the data source as possible or restore it from a backup.


WebFOCUS