If you have a previous version of NetWare Btrieve and you are upgrading to 6.1x, ensure that you have uncorrupted Btrieve (data) files before continuing with your regular operations.
To detect file corruption, use the Btrieve Maintenance utility (BUTIL.NLM) commands to perform either of the following procedures on each Btrieve file:
NOTE: For detailed information about using the BUTIL commands, see the section NetWare Btrieve Maintenance Utility in Chapter 5, "Using Btrieve Utilities."
Follow these steps to determine whether the PAT pages in your Btrieve files are corrupted and to repair any such corruption: If you do not already have current backups, make backup copies of your existing Btrieve files. Determine the page size of your Btrieve files using the following Maintenance utility command on each file: load butil -stat <full_pathname_of_Btrv_file> NOTE: The Maintenance utility runs as an NLM, and the NLM environment does not recognize drive letters or environment variables. Therefore, for commands such as STAT that require a filename, that name must include the full pathname, such as SYS:\BTRIEVE\DATA\ACCTNOS.BTR. If you do not specify a volume, the utility assumes that SYS: is the volume name.
Please keep a record of the size of each file on which you execute the STAT command. You will need to provide it to the utility in step 4. Use the following Maintenance utility command on each Btrieve file to detect PAT corruption: butil -salvage <full_pathname_of_Btrv_file> NOTE: The SALVAGE command does not recover records from your Btrieve file. Therefore, this repair procedure does not take as long to complete as it would if you were using the BUTIL -RECOVER command.
The SALVAGE command examines the records in the file's Page Allocation Table to determine whether corruption has occurred. (The PAT maintains a map of the physical location of each page in the Btrieve file.) If the utility does not report PAT corruption, the file is fine. You do not have to take further corrective measures. If the utility reports PAT corruption, proceed to step 4. The utility asks if you wish to repair the file. Select Yes and enter the page size that you recorded for the file in step 2. Use the BUTIL -SALVAGE command a second time on each Btrieve file. If the utility fully recovers the PAT pages on the first run, it reports no errors. The file is fine. You do not need to take further corrective measures. If the utility again reports PAT corruption, proceed to step 6. Make sure you have enough disk space to hold two copies of the Btrieve file you are working with. Use the following Maintenance utility command to clone the corrupted Btrieve file: butil -clone <newBtrvFile> <corruptedBtrvFile> The CLONE command creates a new, empty Btrieve file with the same file specifications as the corrupted file, including any indexes but excluding the owner name. The new Btrieve file contains all the defined key characteristics (such as key position, key length, duplicate key values, an so on) included in the original, corrupted file. Use the following Maintenance utility command to recover the records from the corrupted file and insert them into the new copy of the Btrieve file: butil -copy <corruptedBtrvFile> <newBtrvFile> The COPY command copies the contents of the corrupted file into the cloned file, retrieving each record from the original file and inserting it into the new file. (The record size must be the same in both files.) After copying the records, COPY displays the total number of records inserted into the new file. You may now resume normal operations with your NetWare Btrieve application. Follow these steps to determine whether the PAT pages in your files or the Btrieve files themselves are corrupted and to repair any corruptions: If you do not already have current backups, make backup copies of your existing Btrieve files. Use the following Maintenance utility command on each Btrieve file to detect PAT corruption: load butil -salvage <full_pathname_of_Btrv_file> NOTE: The SALVAGE command does not recover records from your Btrieve file. Therefore, this repair procedure does not take as long to complete as it would if you were using the BUTIL -RECOVER command.
The SALVAGE command examines the records in the file's Page Allocation Table to determine whether corruption has occurred. (The PAT maintains a map of the physical location of each page in the Btrieve file.) If the utility does not report PAT corruption, the file is fine. You do not need to take further corrective measures. If the utility reports PAT page corruption, proceed to step 3. The utility asks if you wish to repair the file. Select No. Make sure you have enough disk space to hold two copies of the Btrieve file you are working with. Create a description file for each Btrieve file that must be recovered. See Description Files for instructions on how to create a description file. Use the following Maintenance utility command to create a duplicate empty Btrieve file: butil -create <BtrvFile descriptionFile> The CREATE command generates an empty Btrieve file using the file and key characteristics you have specified in the description file. NOTE: Using the CREATE command ensures an uncorrupted Btrieve header. You can also use the BUTIL -CLONE command to create the duplicate empty Btrieve file, but that command does not guarantee a clean header. You may now resume normal operation with your NetWare Btrieve application.Detecting and Repairing PAT Corruption Only
Detecting and Repairing PAT Corruption and Other Types of File Corruption