Express 6.x and Windows 2000/NT Server File Locking
Technical Note 1583
Last Reviewed 25-Jul-2002
Applies To
Express Software Manager version 6.x
Summary
Express Meter tracks application usage by rapidly sharing its library files with networked workstations. When an Express library resides on a Windows 2000 or NT server that has opportunistic file locking (Oplock) enabled, a shared file may become locked and the library may become corrupt. This technical note specifies procedures for troubleshooting and resolving problems with opportunistic file locking.
How Oplock Works
When Oplock is enabled, default file information is saved to a local cache to reduce network traffic. When the file is closed or requested by another workstation, the file is released by the workstation's client redirector, and the cached information is saved on the Windows NT or Windows 2000 server.
If the client redirector does not release the file, however, the file information remains cached on the workstation. When the server requests the file, the workstation behaves as if the file was already released. The server repeats the unfulfilled request while another workstation waits for access to this file. In this scenario, the file is locked and workstation performance may be severely affected.
For more information about opportunistic file locking, search for "oplocks" on Microsoft's web site, http://www.microsoft.com. For specific information about Oplock and Windows NT, see Microsoft Article Q129202, PC Ext: Explanation of Opportunistic Locking on Windows NT. (Enter Q129202 in the Search box.)
Oplock and Express Software Manager
Express Meter tracks application usage by rapidly sharing its library files with networked workstations. When an Express library resides on a Windows NT or Windows 2000 server that has Oplock enabled, a shared file, such as A00004s7.use, may become locked when a workstation does not properly close (release) the shared file. When the Windows NT/2000 server requests A00004s7.use and the file is not released, the request is repeated. Workstation performance is impaired because other workstations are prevented from opening A00004s7.use.
Express Metrix strongly recommends that Oplock be disabled on the Windows NT/2000 servers that host Express libraries. After you determine that Oplock is the cause of your problem, choose the appropriate resolution for your environment. Follow the troubleshooting procedures in the next section.
Troubleshooting Oplock
Problems with Oplock are manifested by a combination of symptoms. You will not see a specific error message that identifies opportunistic file locking as the cause of impaired workstation performance.
To troubleshoot Oplock, compare the common symptoms with your problem, verify that the library cannot be copied, and verify that shared files are locked open. Then resolve the problem by disabling Oplock on the Windows NT/2000 servers where Express libraries are located.
Common Symptoms of File Locking
Although a specific error message is not displayed for opportunistic file locking, Oplock problems can be identified by a combination of the following symptoms:
- When attempting to update the database, the update fails.
- When running reports, the database update fails.
- A repair or backup of the library fails.
- The library becomes corrupt.
- The library folder cannot be copied.
- A workstation hangs when trying to open an application, but releasing the associated library file in Windows NT Server Manager (the In Use dialog) resolves the issue.
- The following error appears in Express.log (in the library folder on the server):
"Cannot open Applib.lib file or A*.use file."
Note: If this error occurs only once, it may be a network issue, but when this error recurs on multiple machines trying to open the same file, the problem is a locked file (Oplock).
Verify That the Library Cannot be Copied
Perform this simple test to determine whether an Express library contains a locked file:
- On the system administrator's workstation, open Windows Explorer.
- Right-click the library folder and click Copy.
If the copy procedure fails, then a file is locked.
Verify That Shared Files Are Locked Open
Use the Windows NT Server Manager to verify that at least one of the Express shared files is locked open by another user:
- Launch Server Manager from the Windows NT Console or other workstation where Server Manager is installed.
- Select your Windows NT Server from the list of computers in the domain.
- Click the In Use button.
- Look for shared files in the Express library folder currently in use. (For example, A00004s7.use or Applib.lib.)
Note: Server Manager does not specifically display a "file locked" message.
- Refresh the In Use list. The shared Express library files should not remain in use for more than one second per user. If a file remains in use for a longer time, and if the same machine is affected, the file is locked. Note: A large library requires a longer time to refresh, which is not necessarily indicative of a locked file.
- Highlight the workstations or users with locked files.
- Disconnect any unexpected file locks. The suspended workstations should immediately release.
This procedure is not an appropriate long-term resolution, but it confirms that the issue involves opportunistic file locking. For long-term resolution, see the next section.
Resolving Windows NT/2000 Server File Locking
To avoid diminished workstation performance and library corruption caused by opportunistic file locking, Express Metrix recommends disabling Oplock on the Window NT/2000 servers that host Express libraries.
Disabling Oplock on the Windows NT/2000 Servers
To disable opportunistic file locking, a registry entry must be created (or edited) on each Windows NT/2000 server that hosts an Express library.
You can automatically edit the registry by running a utility from Express Metrix, or you can create the registry key manually by following the procedures in the next section.
Note: Errors made when editing the registry can cause unpredictable and irreversible system problems.
Running the Express Metrix Utility
Express Metrix developed a utility that automates the registry changes required to disable Oplock. This utility, Tn1094.exe, is a program file that automatically enters the single registry change. To automate the registry change:
- Obtain Ex1381as.exe from www.expressmetrix.com:
- Run Ex1381as.exe on the Windows NT 4.0 server where the Express Library is located. This will extract the Tn1094.exe utility files.
- Run Setup.exe to install the support files for the Tn1094.exe utility.
- Run Tn1094.exe on the Windows NT 4.0 server where the Express library is located. This will make the required registry change.
- Restart the server for the registry change to take effect. The following key is added to the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\ Parameters\EnableOpLocks=0
- Repeat steps 2 through 5 for each Windows NT server that hosts an Express library. Note: If you have a library on a server that is also running SQL Server, see Maintaining Oplock on SQL Servers below.
Manually Editing the Registry
Follow these steps to manually create (or edit) the registry entry to disable Oplock.
- On a Windows NT or Windows 2000 server that hosts an Express library, run Regedit.
- Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\ Parameters
- If the EnableOplocks key does not already exist, then Oplock is enabled by default. To disable Oplock, you must create the key with these values:
Value Type: REG_DWORD
Value Name: EnableOpLocks
Value Data: 0
Note: If you want to enable Oplock at a later time, set the Value Data to 1 (EnableOplocks=1).
Maintaining Oplock on Back Office Servers
Microsoft Back Office Server products such as Microsoft Exchange Server may require that Oplock be enabled. For this reason we recommend you create your Express libraries on a server that is not running Microsoft Back Office Server products. Microsoft may also require Oplock to be enabled on Microsoft SQL Server in certain situations. In those situations Express libraries should be placed on a separate server that does not also house Microsoft SQL Server.
Related Technical Notes
| 1316 |
Express Software Manager and Windows 2000/NT Server File Locking |
| 9989 |
Express Software Manager 6.x Technical Notes |
|