Icon Technical Bulletins

Using Shared Access to DBISAM Databases Under Windows 10/2016 with SMB 3.x
Published on Thu, Jul 25 2019

The SMB (Server Message Block) protocol is a file-sharing protocol that has been present in Windows since Windows 2000. Windows XP/2003 used version 1.x of the SMB protocol, Windows Vista/2008 used version 2.x of the protocol, and Windows 8/2012 introduced version 3.x of the protocol.

For more information on how the SMB protocol works, please see the following link:

Server Message Block Protocol [Wikipedia]

Since its original inception, the SMB protocol has been constantly upgraded and changed to support different types of workloads, and in the process has experienced bugs and incompatibilities with every new major update. Originally, the SMB protocol was designed to work reliably with shared-file database access so that database engines like Microsoft Access (and DBISAM, among many others) would work reliably when directly accessed by multiple users on a small local area network. As shared-file database access has diminished in usage in favor of client-server database access, the SMB protocol has slowly moved away from being optimized for such access. Because of this, SMB 3.x is the first major version of the protocol that requires client and server registry changes in order to work reliably with shared-file databases like DBISAM. Although you may never see any issues with corruption or odd behaviors without these registry changes, you should seriously consider implementing them if you plan to continue using direct, file-sharing access to DBISAM databases in a Windows 10/2016 environment.

Since last year, we have been working with customers on stress-testing various combinations of heavy access/update scenarios with SMB 3.x, and have come up with the following SMB settings changes that will allow client and server machines to work reliably under heavy loads of reading/updating. These settings rely on using PowerShell commands to get/set their values, and require Administrator privileges in order to successfully retrieve or update them.

Client SMB Changes

PowerShell Commands: Get-SmbClientConfiguration/Set-SmbClientConfiguration

SettingValue
DirectoryCacheLifetime0
EnableBandwidthThrottlingFalse
FileInfoCacheLifetime0
OplocksDisabledTrue
UseOpportunisticLockingFalse

Server SMB Changes

PowerShell Commands: Get-SmbServerConfiguration/Set-SmbServerConfiguration

SettingValue
CachedOpenLimit0
EnableLeasingFalse
EnableOplocksFalse

Information These settings are for use with Windows 10/2016 and may not be available as PowerShell settings in Windows 8.x/2012 (or earlier versions of Windows). There are equivalent registry changes that can be made that correspond to these PowerShell settings, so please consult the Windows SMB documentation for more information on the applicable registry keys/values that must be changed.

You can download a .zip file with two batch files (smbclient.bat and smbserver.bat) and two PowerShell scripts (smbclient.ps1 and smbserver.ps1) that can be used to automate the updating of the above SMB settings via the following link:

SMB 3.x Batch Files and PowerShell Scripts (smbscripts.zip)

The batch files simply start PowerShell from the command-line, set the PowerShell execution policy to bypass to get around any execution policy restrictions that might block the updates (even for Administrators), and then update the SMB settings. For more information on PowerShell execution policies, please see the following link:

PowerShell Set-ExecutionPolicy [Microsoft]
Image