DISK WRITE BEHIND CACHING AND ERROR 2104QLBASE

This white paper contains information on the causes of error 2104, as well as methods for disabling disk write behind caching on Windows platforms.

Common causes of 2104

The 2104 error is a file system error that is passed on to SQLBase when a file cannot be read or written to. The most common cause of the error 2104 is a lack of disk space. SQLBase can run out of space for the DBS or log or temp files. This usually happens on a LOAD where recovery has not been turned off, or if there are a lot of transactions against a database, which make it grow unexpectedly large. Having LOGBACKUPON can lead to a lack of disk space as well.

If your 2104 error is the result of running out of disk space, you must free up some space before you try to reconnect to the database. The database will have crashed, and therefore SQLBase will try to initiate a recovery on the first connect. This recovery process creates log files. If there is no space for the log files, the recovery will fail.

The second most common cause of error 2104 is a problem with the machine's file system. This can be the result of faulty disk controllers or other hardware problems. It is a good idea to run CHKDSK, SCANDISK or other appropriate disk checking utilities when you get a 2104 error.

Another cause of error 2104 is a scheduling problem with network backup software. For example, the network backup locks a temporary file that SQLBase needs to write to as read-only in preparation for backing it up.

The more subtle causes of error 2104 have to do with disk caching. Write behind caching defers the write to disk of information in the cache memory for some period of time. It is designed to enhance performance. Write behind caching should never be enabled on disks that contain a database. This goes for any relational database, not just SQLBase.

If write behind caching is enabled, an error that causes the database to be shutdown unexpectedly may generate a 2104 error. This can lead to database inconsistency and database corruption. Whenever you encounter an error 2104, you should do a CHECK DATABASE to make sure there is no corruption.

Many Windows operating systems enable write behind caching by default. The following sections explain how to disable write behind caching on Windows 95, Windows NT, Windows 2000 and Windows XP.

Windows 95

Windows 95 enables write caching by default. To turn it off, go into Control Panel, click the System icon. Click the Performance tab. Click the File System button. Click the Troubleshooting tab. Click the checkbox that reads 'Disable write-behind caching for all drives.'

Windows NT

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

  1. Start Registry Editor (Regedt32.exe) and go to the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Rdr\Parameter

  1. Click Add Value on the Edit menu.
  2. Enter the following:

Value Name: UseWriteBehind

Data Type: REG_DWORD

Data: 0

4. Go to the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services \Lanmanworkstation\parameter

5. Click Add Value on the Edit menu.

6. Enter the following:

Value Name: UtilizeNTCaching

Data Type: REG_DWORD

Data: 0

  1. Shut down and restart your computer.

Windows 2000

Make sure that you have at least service pack 3 installed or the settings will be reset when you restart your PC.

1. Click the "Start" button on the desktop.

  1. When the menu appears, click on "My Computer".
  2. Locate your Hard Drive. (Usually labelled with "(C:)". Right click on the Hard Drive Icon and select "Properties".
  3. Click on the "Hardware" tab to bring the hardware settings to the front.
  4. Highlight your local hard drive and click on the "Properties" button near the bottom of the window.
  5. Click the "Policies" tab to bring the drive policy options forward.

7. Disable write-behind caching by removing the check mark in the box next to the statement "Write-cache enabled" and click "OK".

Windows XP

  1. Click the "Start" button on the desktop.
  2. When the menu appears, click on "My Computer".
  3. Locate your Hard Drive. (Usually labelled with "(C:)". Right click on the Hard Drive Icon and select "Properties".
  4. Click on the "Hardware" tab to bring the hardware settings to the front.
  5. Highlight your local hard drive and click on the "Properties" button near the bottom of the window.
  6. Click the "Policies" tab to bring the drive policy options forward.
  7. Remove the check mark from the box with the description "Enable write caching on the disk" and click "OK".