Rebuild Utility Tasks
The following Rebuild tasks are available:
GUI Tasks
Click Tools then Rebuild from the PSQL Control Center menu or access Rebuild from the operating system Start menu or Apps screen.
1
After you click Next at the Rebuild welcome screen, the Select Files screen appears.
2
Click Add and select the data or dictionary file you want to rebuild. You can select more than one file to rebuild at a time.
Figure 42 Select Files Dialog Box
The Rebuild utility deletes the original file after rebuilding it if the file is being rebuilt in the same directory. If the new file is in a different directory, the original file is not deleted.
3
Click Next after you have added the desired file or files.
4
5
Click Next to begin the rebuild process.
The utility reports the processing information. When the rebuild process completes, the success or failure of it displays and View Log File is enabled.
Figure 43 Rebuild Process
6
To display the results, click View Log File. The contents of the log file display in the default text editor for the operating system.
The Rebuild utility writes to the log file for every file it attempts to convert. If you disabled the Continue on Error setting, the log file contains the information up to the point of the error. If the rebuild was not successful, the status file contains error messages explaining why the rebuild failed.
7
Click Finish when you have finished rebuilding files and viewing the log file.
CLI Tasks
The Rebuild command-line utility is named rbldcli.exe on Windows and rbldcli on Linux and OS X. The following command line Rebuild utility tasks are available:
Command Line Parameters
The parameter option specifies the parameter(s) used with the utility. You may use the parameters in any order. Precede each parameter with a hyphen (-). Do not place a space after the hyphen or after the single-letter parameter and the parameter value.
*Note: On Linux and OS X platforms only, the parameters are case sensitive.
Parameter is defined as follows:
Instructs Rebuild to continue with the next data or dictionary file if an error occurs. The utility notifies you of non-MicroKernel data files or errors with MicroKernel files, but continues rebuilding data files. The errors are written to the log file. See Log File.

Tip
: This parameter is particularly useful if you specify wildcard characters (*.*) for a mixed set of files. Mixed set means a combination of MicroKernel files and non-MicroKernel files. Rebuild reports an error for each non-MicroKernel file (or any errors on MicroKernel files), but continues processing.
If you specify -d, Rebuild converts pre-6.0 supplemental indexes (which allow duplicates) to 6.x, 7.x, or 8.x indexes with linked-duplicatable keys.

If you omit this parameter, Rebuild preserves the indexes as repeating-duplicatable keys.

If you access your data files only through the MicroKernel Engine and your files have a relatively large number of duplicate keys, you can use the -d parameter to enhance the performance of the Get Next and Get Previous operations.
-m<0 | 2>
See Amount of Memory for how the amount of memory affects the method chosen.
See Choosing a Page Size in PSQL Programmer's Guide in the Developer Reference.
-bdirectoryname
Specifies an alternate location for the rebuilt file (which may also be a location on a different server). The default location is the directory where the data file is located. You must specify a location that already exists. Rebuild does not create a directory for you. The directory also must be on a machine that is running the PSQL database engine.

You may use either a fully qualified path or a relative path. Do
not use wildcard characters in directoryname.

On your local server, the MicroKernel Database Engine and the Message Router must be loaded. On a remote server, the MicroKernel Database Engine and communications components must be loaded.

If you omit this parameter, the rebuilt file replaces the original data file. A copy of the original file is not retained.

If you specify this parameter, the rebuilt file is placed in the specified location and the original file is retained. An exception to this is if the specified location already contains data files with the same names. Rebuild fails if the alternate location you specify contains files with the same names as the source files. For example, suppose you want to rebuild mydata.mkd, which is in a directory named folder1. You want to place the rebuilt file into a directory named folder2. If mydata.mkd also exists in folder2 (perhaps unknown to you), Rebuild fails and informs you to check the log file.

Note: Ensure that you have create file permission for the location you specify (or for the location of the source file if you omit the parameter).
-knumber
-lfile
Turns on page compression for file provided the following conditions are true:
Turns off page compression for file. This parameter has no effect if file does not contain page compression.
Turns off record compression for file. This parameter has no effect if file does not contain record compression.
If you omit this parameter, Rebuild uses the value set for the MicroKernel's “Create File Version” configuration option. See Create File Version.

Note1: If you specify a file format newer than the version supported by the current database engine, Rebuild uses the highest supported file format of that engine. Rebuild reports no error or message for this.
Note2: Rebuild does not convert data types in indexes. If you rebuild a file to an older file format for use with an older database engine, ensure that the engine supports the data types used. You must manually adjust data types as required by your application and by the database engine.

Example1. Your data file contains index fields that use the WZSTRING data type. If you rebuild the data file to a 6.x file format, the WZSTRING data type is not converted. You would be unable to use the data file with a Btrieve 6.15 engine. That engine does not support the WZSTRING data type.

Example 2. Your data file contains true NULLs. You rebuild the data file to a 7.x file format. The true NULLs are not converted. You would be unable to use the data file with the PSQL 7 engine. That engine does not support true NULLs.
-uiduname
-pwdpword
Specifies the password for the user who is identified by uname. Pword must be supplied if uname is specified.
-dbdbname
File and @command_file are defined as follows:
@command_file
1
By default, you must be logged in as user psql to run utilities. User psql has no password and can be accessed only through the root account by using the su command. To use utilities from accounts other than psql, you must first make modifications to your .bash_profile. See PSQL Account Management on Linux and OS X in Getting Started With PSQL.
2
Change directory to /usr/local/psql/bin directory.
3
rbldcli [–parameter ...] file
or
rbldcli @command_file
Parameter, file, and @command_file are defined in Command Line Parameters.
Example Usage
The following example continues on error, sets a page size of 4096 bytes, and places the rebuilt files in a different directory on the server.
rbldcli -c -p4096 -b/usr/local/psql/tmp /usr/local/psql/data/DEMODATA/*.mkd
1
2
Optionally, change to the \bin directory where you installed the Program Files. (This is not required if the location is in the Path system variable.)
3
rbldcli [–parameter ...] file
or
rbldcli @command_file
Parameter, file, and @command_file are defined in Command Line Parameters.
Example Usage
The following example continues on error, sets a page size of 4096 bytes, and places the rebuilt files in a different directory on the server.
rbldcli -c -p4096 -bc:\dbtemp c:\datafiles\*.mkd
Rebuild reports on the screen the number of records processed per file, incrementing 50 records at a time. In addition, Rebuild writes information to a text log file. See Log File.