Tag Archives: data

MSSQL How long will data be in cache/buffer

How fast is data leving the cache, when it not access again.

With this query, you can see how fast data will get expire, and overwritten by new data in the cache.

SELECT  @@servername AS INSTANCE
,[object_name]
,[counter_name]
, UPTIME_MIN = CASE WHEN[counter_name]= 'Page life expectancy'
          THEN (SELECT DATEDIFF(MI, MAX(login_time),GETDATE())
          FROM   master.sys.sysprocesses
          WHERE  cmd='LAZY WRITER')
      ELSE ''
END
, [cntr_value] AS PLE_SECS
,[cntr_value]/ 60 AS PLE_MINS
,[cntr_value]/ 3600 AS PLE_HOURS
,[cntr_value]/ 86400 AS PLE_DAYS
FROM  sys.dm_os_performance_counters
WHERE   [object_name] LIKE '%Manager%'
          AND[counter_name] = 'Page life expectancy'

Witch the query you can see how long time data will be in the cache/buffer.

Citrix XenApp failed to connect to Data Store

Today i have this problems on one of the Citrix XenApp servers, that the service IMA won’t connect to the Data store.

It failed with this events:

1. Citrix XenApp failed to connect to the Data Store. ODBC error while connecting to the database: S1000 -> [Microsoft][ODBC Microsoft Access Driver] Cannot open database ‘(unknown)’.  It may not be a database that your application recognizes, or the file may be corrupt.

2. Failed to load plugin C:\Program Files (x86)\Citrix\System32\Citrix\IMA\SubSystems\ImaPsSs.dll with error IMA_RESULT_FAILURE

3. Failed to load plugin C:\Program Files (x86)\Citrix\System32\Citrix\IMA\SubSystems\ImaRuntimeSS.dll with error IMA_RESULT_FAILURE

4. Failed to load initial plugins with error IMA_RESULT_FAILURE

5. The Citrix Independent Management Architecture service terminated with service-specific error 2147483649 (0×80000001).

 

But all my others servers in the farm was working just fine, so it must be a locally problems.
The Local Host Cache database, is used to allow a Citrix server in the Citrix Farm to pursue working if the server loses acces to date store temporay. The Local Host Cache database, is an Microsoft Access database, named lmalhc.mdb, and it store ind the Independent Mangement Architecture folder, located: <ProgramFiles>\Citrix\Independent Management Architecture\

 

So the solution to this problems must be to recreate the LHC database, this can be done with this command

dsmaint recreatelhc

But first check that

The datastore is available and function okay, and that the Citrix IMA Service is down :).

The command performs these actions:

Rename the existing Local Host Cache database, create a new one, and the setting PSRequired in registry to 1. Under HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\Runtime\

Setting thise key to, force the server to connect to the data store, so that the Local Host Cache database, can be recreated.