Electronics
Btrieve
Motorcycling
Software

Continuous Operations & NetWare Btrieve v6.x

NetWare Btrieve v6.0 is a core component of NetWare SQL v3.0, the latest version of Novell's relational data access system for NetWare v3.11. In the March 1992 issue of Bullets, a special supplement on NetWare SQL v3.0 briefly mentioned the enhancements to the product. One of the new features of the NetWare Btrieve v6.0 engine, Continuous Operations, allows you to back up Btrieve files while they are in use by Btrieve or NetWare SQL applications. This article will discuss the new design in more detail and explain how to implement Continuous Operations to provide uninterrupted access to Btrieve files, even during backups.

In the past, Btrieve users were unable to back up Btrieve databases while running applications because, if Btrieve files were in use during a backup, a file (or set of files) could be in an inconsistent state when the file was backed up. Backups do not occur instantaneously; they take time, so one file could be backed up, then a change could be made to a group of files before the other files were backed up. The backup would then be useless since the files would be out of sync.

Versions of Btrieve prior to v6.0 used pre-image files to record changes being made to corresponding Btrieve files. To maintain pre-v6.0 Btrieve file consistency, the pre-image files also would have had to be backed up. Then, after restoring the database, the pre-image files could be used to restore the Btrieve files to their original state (i.e., the state they were in before the changes that occurred while the backup was being performed).

Novell also recommended that files created with earlier versions of Btrieve should always be flagged Non-Sharable to the operating system. This flag prevented file corruption by allowing only one entity (such as the NetWare Btrieve NLM) to access a Btrieve file at a time. This precaution also prevented software from backing up Btrieve files whenever an application was accessing them. The operating system would return a "sharing" error and the backup would fail.

Each of these issues is addressed in NetWare Btrieve v6.0. Some understanding of the new design is required before discussing how to implement these online backups using Continuous Operations.

Shadow Pages & PATs

Versions of Btrieve prior to v6.0 used pre-image files extensively;any change made to a Btrieve file required the creation of a pre-image file. The NetWare Btrieve v6.0 file structure has been altered to eliminate the need for pre-image files. The new design uses a technique called shadow paging and a structure called a Page Allocation Table (PAT). With shadow paging, each page involved in write operations is duplicated and any changes made to the file are written to the duplicate copy. In the event of a system failure,recovery is accomplished by invalidating the duplicate copy of all pages. If a change is completed successfully, the altered copy of the page becomes "current."

The PAT structure is integral to this file management scheme. PAT pages keep a record of which physical pages are copies, and which copies are "current" at any given time. This design maintains Btrieve files in a consistent state and data integrity is managed within the file itself, not in a pre-image file.

Continuous Operations

When Btrieve files are placed in Continuous Operation mode, NetWare Btrieve immediately creates a "DELTA" file for each Btrieve file.This DELTA file is given the same name as the Btrieve file except that it has a ".^^^" extension. So, if the file "patients.btr" was placed in Continuous Operation mode, then the resulting DELTA file would be named "patients.^^^."

Next, if the Btrieve file is not already open (for some application), NetWare Btrieve opens it in "Read-Only, Sharable"mode, so that the file can be accessed by a Btrieve application while it is in Continuous Operation mode. If the Btrieve file is already open, the open mode for the Btrieve file is switched to"Read-Only, Sharable." Backup software can then begin to back up all Btrieve files that are in Continuous Operation mode.

While files are in Continuous Operation mode, NetWare Btrieve uses the DELTA files mentioned above to record all changes made to Btrieve files. If a user accesses Btrieve files while they are open in Continuous Operation mode, NetWare Btrieve v6.0 writes all user modifications to the DELTA files. DELTA files are NetWare sparse files, and their sizes (as seen in a DIR command) are usually be larger than the space they occupy on disk.

Because NetWare Btrieve writes all modifications to DELTA files,the original Btrieve files can be kept in a consistent state while the file is in Continuous Operations mode. Btrieve v6.0 files can then be backed up without the consistency problems that would arise with files created with previous versions.

After a backup is completed, the files can be removed from Continuous Operation mode. When NetWare Btrieve v6.0 receives a request to remove files from Continuous Operation mode, it:

  • Begins a TTS transaction,
  • Transfers all changes recorded in all DELTA files to the Btrieve files
  • Deletes the DELTA files, and
  • Ends the TTS transaction.

    TTS transactions are used to ensure that either each of these steps are executed or none are executed. Because this is when NetWare Btrieve actually writes to the Btrieve files, it is very important to keep the files in sync.

    Implementing Continuous Operations using BUTIL and NSUTIL

    BUTIL and NSUTIL are two utilities included with NetWare SQL v3.0 which can be used to activate Continuous Operations. BUTIL and NSUTIL are both NetWare Loadable Modules (NLMs) and can be used at the NetWare server console.

    If you want to place a single Btrieve file in Continuous Operation mode, you can use the following command:

         load butil -startbu Btrfilename

    In this command, "startbu" stands for "start backup" and"Btrfilename" refers to the fully qualified path and filename of the Btrieve file, including the volume name. So, if "test1.btr"were a file in the "dir1" directory off the root level of the SYS volume, the command would be:

         load butil -startbu sys:dir1\test1.btr

    If you wish to place a group of Btrieve files in Continuous Operation mode, list each filename in an ASCII file, and issue the following command at your server console:

         load butil -startbu @ASCIIfilename

    In this command, "ASCIIfilename" refers to the complete path and name of the ASCII file.

    To remove Btrieve files from Continuous Operation mode, use one of the following commands:

         load butil -endbu Btrfilename

    or

         load butil -endbu @ASCIIfilename

    where "endbu" stands for "end backup."

    NetWare SQL v3.0 also includes support for named databases. NSUTIL uses this feature to implement Continuous Operations. The named database feature allows a user to link a name with a particular database, so that operations can be performed on the database without specifying the location of the data dictionary and each data file.

    The following command will place all files that are part of the"Dbname" database into Continuous Operation mode:

         load nsutil -startbu dbname

    Because of the way named databases are implemented, "dbname" does not have to contain a path pointing to the location of the database; only the name of the database is required.

    If you want to place multiple named databases in Continuous Operation mode, use the following command:

         load nsutil -startbu @ASCIIfilename

    where "ASCIIfilename" is the complete path and name of the ASCII file that lists the named databases.

    To remove the databases from Continuous Operation mode, use one of the following commands:

         load nsutil -endbu dbname

    or

         load nsutil -endbu @ASCIIfilename

    Implementing Continuous Operations Using a TSA

    NetWare SQL v3.0 includes a Target Service Agent (TSA) that allows you to use any backup utility that complies with Novell's SMS(Storage Management Services) architecture to backup named databases. This component of NetWare SQL v3.0 is called TSA-NWS.NLM and it uses TSA.NLM (provided with NetWare 3.11) to communicate with the backup utility. TSA.NLM and TSA-NWS.NLM are designed to be loaded at the target server (the server where the databases to be backed up reside). The backup utility should be loaded at the host server (the server where the backup device resides).

    TSA-NWS allows the user to specify the names of the databases that are to be backed up. These databases are then individually placed in Continuous Operation mode, backed up, and then removed from Continuous Operation mode. Additional documentation is included in the NetWare SQL Installation and Operation manual. This method cannot be used to back up individual Btrieve files.

    Additional Tips

    Placing files in and removing files from Continuous Operation mode is an atomic process; either all of the files specified or none of the files specified are effected. If, for any reason, NetWare Btrieve encounters an error in either of these mode change procedures, it returns a status 88 (Incompatible Mode Error) at the server console.

    Do not delete DELTA files. These files contain all changes made to the Btrieve files since they were placed in Continuous Operation mode. Do not back up the DELTA files. If this occurs and the DELTA files are later restored with the backed up Btrieve files, then any subsequent access to the associated Btrieve files will make NetWare Btrieve read the DELTA files first, and "roll-in" the changes.

    If Btrieve files have been assigned Btrieve owner names, BUTIL, NSUTIL, and TSA-NWS can still perform their Continuous Operation functions without the owner names being specified. (This is not considered to be a security violation since these functions can only be performed at the server console or through RCONSOLE, and this implies that the user has SUPERVISOR rights on the file server's resources.)

    As with previous versions of NetWare Btrieve, all Btrieve files should have unique names. Files with different extensions are not considered unique. For example, if files named "file1.btr" and "file1.dat" were part of a set of files that were placed in Continuous Operation mode, NetWare Btrieve would create the DELTA file, "file1.^^^," for the first file it encountered. For the second file, however, NetWare Btrieve would detect that a DELTA file already existed and return a status 88 to the server console. As a result, neither file would be placed in Continuous Operation mode.

    Copyright © Madis Kaal 2000-