This is a blast from the past but good info on understanding what the LHC does and how to recreate it to resolve corruption problems. JK CTX759510 - Function of the Local Host Cache on MetaFrame XP This document was published at: http://support.citrix.com/article/CTX759510 Document ID: CTX759510, Created on: Jun 7, 2001, Updated: Nov 5, 2003 Products: Citrix MetaFrame XP 1.0 for Microsoft Windows 2000, Citrix MetaFrame XP 1.0 for Microsoft NT 4.0 Server Terminal Server Edition Each MetaFrame XP server stores a subset of the data store in the Local Host Cache (LHC). The LHC performs two primary functions: ? Permits a server to function in the absence of a connection to the data store. ? Improves performance by caching information used by ICA Clients for enumeration and application resolution. The LHC is an Access database, Imalhc.mdb, stored, by default, in the %ProgramFiles%\Citrix\Independent Management Architecture folder. The following information is contained in the local host cache: ? All servers in the farm and some basic information. ? All applications published within the farm and their properties. ? All Windows network domain trust relationships within the farm. ? All information specific to itself. (product code, SNMP settings, licensing information) On the first startup of the member server, the LHC is populated with a subset of information from the data store. From then on, the IMA service is responsible for keeping the LHC synchronized with the data store. The IMA service performs this task through change notifications and periodic polling of the data store. If the data store is unreachable, the LHC contains enough information about the farm to allow normal operations for up to 96 hours on servers running SP2/FR2 or greater. On servers with no service pack or SP1/FR1, the grace period is 48 hours. During this grace period, the server continues to service requests while the IMA service attempts to connect to the data store periodically (based on the data store query interval). If the data store is unreachable for 96 hours, the licensing subsystem fails to verify licensing and the server stops taking incoming connections. Because the LHC holds a copy of the published applications and Windows domain trust relationships, ICA Client application enumeration requests can be resolved locally by the LHC. This provides a faster response to the ICA Client for application enumerations because the local server does not have to contact other member servers or the zone data collector. The member server must still contact the zone data collector for load management resolutions. In some instances it can be necessary to either refresh or recreate the local host cache. The sections below describe these situations. Refreshing the Local Host Cache If the IMA service is currently running but published applications do not appear correctly in ICA Client application browsing, force a manual refresh of the local host cache by executing dsmaint refreshlhc from a command prompt on the affected server. This action forces the local host cache to read all changes immediately from the data store. A discrepancy in the local host cache occurs only if the IMA service on a server misses a change event and is not synchronized correctly with the data store. Recreating the Local Host Cache If the IMA service does not start, the cause may be a corrupt LHC. Recreating the Local Host Cache after a minimum of SP1 has been installed: Important: The data store server must be available for dsmaint recreatelhc to work. If the data store is not available, the IMA service will fail to start. 1. Stop the IMA service on the MetaFrame server, if it is started. This can be done via the command line, net stop imaservice, or from services. 2. Run dsmaint recreatelhc, which renames the existing LHC database, creates a new database and modifies the following registry key HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\Runtime\PSRequired key to 1. Setting the value PSRequired to 1 forces the server to establish communication with the datastore in order to populate the Local Host Cache database. When the IMA service is restarted, the LHC is recreated with the current data from the data store. 3. Restart the IMA service. This can be done via the command line, net start imaservice, or from services. OR To recreate the LHC database on servers that do not have a minimum of SP1 installed, follow these steps to manually recreate the LHC: Verify the data store is available before beginning this procedure. If the data store is not available, the IMA service fails to start until the data store is available. 1. Stop the IMA service on the MetaFrame server, if it is started. This can be done via the command line, net stop imaservice, or from services. 2. Go to %ProgramFiles%\Citrix\Independent Management Architecture and rename the imalhc.mdb to imlhc.mdb.bak 3 Launch the ODBC Data Source Administrator: ? On Windows 2000, choose Control Panel > Administrative Tools > Data Sources (ODBC). ? On TSE, choose Control Panel > ODBC Data Sources. 3. Select the File DSN tab and browse to %ProgramFiles%\Citrix\Independent Management Architecture. 4. Select the imalhc.dsn file and click Configure. 5. In the Database area, click Create. The New Database dialog box appears. 6. In the Database Name box, type the name imalhc.mdb for the new local host cache database. 7. Click OK to create the database, and then click OK to close the ODBC Data Source Administrator. 8. Open regedt32 and navigate to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\RUNTIME and modify the value of PSRequired (REG_DWORD): 0x1 9. Restart the IMA service. This can be done via the command line, net start imaservice, or from services. IMPORTANT: Restarting the IMA service instead of rebooting might cause the SNMP service to Dr. Watson if SNMP is enabled. This error is benign.