Thursday, March 28, 2013

Converting IIS logs time from UTC to local time

If you notice that the time logged in IIS logs does not match your server's local time, this is because IIS logs time in UTC (GMT) to conform with the W3C log format so if you are in a different time zone for example UTC -3 you will find the time 3 hours ahead in the logs.

To change that, you can choose a different log format from the IIS manager or you can convert the log file using Log Parser.

Download and install Log Parser then run the following command

LogParser.exe "SELECT DATE,TO_LOCALTIME(time) AS time,s-ip,cs-method,cs-uri-stem,cs-uri-query,s-port,cs-username,c-ip,cs(User-Agent),sc-status,sc-substatus,sc-win32-status,time-taken INTO c:\ayman\output.log FROM c:\ayman\input.log" -i:IISW3C -o:W3C

 

Wednesday, March 27, 2013

Check for TempDB PAGELATCH waits

SELECT

session_id,

wait_type,

wait_duration_ms,

blocking_session_id,

resource_description,

ResourceType = CASE

WHEN PageID = 1 OR PageID % 8088 = 0 THEN 'Is PFS Page'

WHEN PageID = 2 OR PageID % 511232 = 0 THEN 'Is GAM Page'

WHEN PageID = 3 OR (PageID - 1) % 511232 = 0 THEN 'Is SGAM Page'

ELSE 'Is Not PFS, GAM, or SGAM page'

END

FROM ( SELECT

session_id,

wait_type,

wait_duration_ms,

blocking_session_id,

resource_description,

CAST(RIGHT(resource_description, LEN(resource_description)

- CHARINDEX(':', resource_description, 3)) AS INT) AS PageID

FROM sys.dm_os_waiting_tasks

WHERE wait_type LIKE 'PAGE%LATCH_%'

AND resource_description LIKE '2:%') AS tab;

Tuesday, March 26, 2013

This Web Part requires at least Microsoft Internet Explorer 7.0

After installing internet explorer 10, PWA broke with this error message

This Web Part requires at least Microsoft Internet Explorer 7.0. For more information, contact your Project Server Administrator.


Adding the website to the compatibility view list solves the problem. Tools -> Compatibility view settings