Btrieve Command-Line Maintenance Utility (butil)
Use this utility if you prefer a command-line interface or if you want to start or stop continuous operation. The Btrieve Maintenance utility is also available in a command-line format that runs on the server (from a DOS command prompt on Windows platforms) or locally on DOS, Windows, Linux, and OS X clients. You can execute Maintenance utility commands from the command line or through a command file you create. Before you perform commands in the Btrieve Maintenance utility, also called BUTIL, it is important you understand some concepts and elements addressed in the Commands.
The Btrieve Command-Line Maintenance utility performs the following file and data manipulations:
Return Codes
When BUTIL finishes executing, it returns an exit code or DOS errorlevel return code to the operating system. The return codes are as follows:
Requested operation succeeded.
Commands
The following table lists the commands that you can use with the Command-line Maintenance Utility.
Stop (DOS only)
Viewing Command Usage Syntax
To view a summary of each command usage, enter the butil command at the file server.
Command Format
The format for the Maintenance utility command line is as follows:
BUTIL [-command [parameter ...]] | @commandFile
command
Command Files
You can use a command file to do the following:
For each command executed, the resulting output file shows the command followed by its results. All messages appear on the server console screen, as well.
Command files contain the same information as that required on the command line.
Rules for Command Files
Observe the following rules when creating a Maintenance utility command file:
You must end each command with <end> or [end]. You must also end each command with <end> when trying to execute multiple commands. The <end> or [end] must be lowercase.
Command File Example
The following is an example command file, COPYCRS.CMD. The file calls the BUTIL - CLONE command to create the NEWCRS.MKD file by cloning the COURSE.MKD file, and the -CREATE command to create the NEWFILE.DTA file by using the description provided in the NEWFILES.DES description file.
-clone newcrs.mkd course.mkd <end>
-create newfile.dta newfiles.des <end>
The following command uses the COPYPATS.CMD file and writes the output to the COPYPATS.OUT file:
butil @copypats.cmd copypats.out
Description Files
Description files are ASCII text files that contain descriptions of file and key specifications that the Maintenance utility can use to create data files and indexes. Some users employ description files as a vehicle for archiving information about the data files they have created. For more information about the description file format, see Description Files.
Extended File Support
The size of the database engine data file can be larger than the operating system file size limit. When you export data from an extended MicroKernel file to an unformatted file, the size of the unformatted file can exceed the database engine file size limit because of the differences in the physical format.
When you are exporting large files, the Interactive Maintenance utility detects that the unformatted file has exceeded the operating system file size limit (2 GB) and starts creating extension files. This process is transparent. Extension files and the original unformatted file must reside on the same volume. The extension file uses a naming scheme in which the file names are similar to the base file name. In contrast to native MicroKernel Engine extension files which use a caret “^” to indicate extension file status, the unformatted extension files use a tilde “~” to avoid overwriting any existing extended MicroKernel Engine files with the same base file name. The first export extension file is the same base file name with “.~01” extension. The second extension file is “.~02,” and so on. These extensions are appended in hexadecimal format.
While the naming convention supports up to 255 extension files, the current maximum number of extension files is 64, thus supporting files as large as 128 GB.
To Save or Recover huge files to unformatted files, see the respective command. Also, when you import data from an unformatted file, the utility detects if the file has extensions and loads the data from the extension file.
Owner Names
The MicroKernel allows you to restrict access to files by specifying an owner name. Because owner names are optional, the files you use with the utility may or may not require an owner name.
A short owner name can be up to 8 bytes. A long owner name can be up to 24 bytes. Once a long owner name is specified, the data file cannot be read by a database engine prior to PSQL v10.10. Also, a data file with a long owner name cannot be rebuilt to a file format prior to 9.5 unless the owner name is first removed. An owner name, long or short, with less than the maximum allowed bytes is padded with spaces to the maximum length (8 or 24 bytes).
If the file requires an owner name, you must specify it using the /O option. You can specify one of the following:
Asterisk (*). The utility prompts you for the owner name. With the rollfwd command, the utility prompts you for a list of owner names separated by commas.
Owner names are case-sensitive. If you enter owner names on the command line, the utility discards leading blanks. If you specify an asterisk, the utility does not discard leading blanks.
Redirecting Error Messages
Be sure that you specify a fully qualified file name (including a drive letter or UNC path) when redirecting error messages.
BUTIL -command commandParameters > filePath
ASCII File Format
See Importing and Exporting ASCII File Format in the Interactive Maintenance utility section.
Rules for Specifying File Names on Different Platforms
When you run BUTIL on Windows, Linux, or OS X, you do not need to specify the name of the path if the data file resides in the same directory as your current directory.