Btrieve File Rebuilding (FOPS6 on Netware)

 

Following are the steps you need to take to rebuild a corrupted Btrieve file with the Btrieve Utility program:
BUTIL.EXE.

Whilst rebuilding files the FOPS6 program must not be running. Quit all FOPS6 programs that are running, including
on "Comms" PCs.

To rebuild the files from a workstation the Btrieve Requester program must be loaded beforehand.
e.g. from a MS DOS prompt enter:

F:\PUBLIC\BREQUEST

The BUTIL commands will execute quicker from the server console prompt. The commands are entered slightly differently, for the example below:-

Insert the word LOAD before BUTIL
Replace F:\ in the filenames with SYS:\     APP:\ (fromserver)

The following example recovers a corrupted transaction file: F:\FOPS6\FIL\TRANS.FIL

Step 1: Read All the Data

Execute the following command at a DOS prompt:

BUTIL -RECOVER F:\FOPS6\FIL\TRANS.FIL  F:\FOPS6\FIL\TRANS.REC

This will read the records from TRANS.FIL and save them into a flat file called TRANS.REC.

Step 2: Create a New File

Execute the following command at a DOS prompt:

BUTIL -CLONE F:\FOPS6\FIL\TRANS.NEW   F:\FOPS6\FIL\TRANS.FIL

This will create a new file TRANS.NEW with the same Btrieve definition as the existing file TRANS.FIL
The new file will have no data in it.

Step 3: Load the Data in

Execute the following command at a DOS prompt:

BUTIL -LOAD  F:\FOPS6\FIL\TRANS.REC   F:\FOPS6\FIL\TRANS.NEW

This will load the data that was recovered in step 1 into the newly created file from step 2.

STEP 4: Rename Your Files

Execute the following commands at a DOS prompt:

REN TRANS.FIL TRANS.OLD
REN TRANS.NEW TRANS.FIL

Now, TRANS.FIL should be clean and ready to use in your application.

Following a server crash, typically the following files will need rebuilding.
ORDERH, ORDERL, PALLET, NETPACK, TOTALS & TRANS. STOCK

To use the above example to rebuild the files, substitute all 'TRANS' with the name of the file.

Click here to return to MT Support Index