【茶包射手專欄】SQL 2005 SP2安裝失敗

最近跟SQL的Hotfix很有緣,話說為了因應KB956391會造成SSRS無法列印報表的問題,跟同事逐一為手上的SQL及SSRS主機上Patch。

不過,其中一台SQL升級時卻遇到SP2無法安裝的情況,依據提示,查看了C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix下的幾個Log檔案:

Summary.txt中出現:

Product                   : Database Services (MSSQLSERVER)
Product Version (Previous): 1399
Product Version (Final)   :
Status                    : Failure
Log File                  : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KB921896_sqlrun_sql.msp.log
Error Number              : 29528
Error Description         : MSP Error: 29528  The setup has encountered an unexpected error while Installing performance counters. The error is: 當檔案已存在時,無法建立該檔案。(英文原文為Cannot create a file when that file already exists)

Hotfix.log中看到

10/31/2008 13:02:39.738 Registry: Opened registry key "Software\Policies\Microsoft\Windows\Installer"
10/31/2008 13:02:39.738 Registry: Cannot read registry key value "Debug"
10/31/2008 13:10:17.525 MSP Error: 29528  The setup has encountered an unexpected error while Installing performance counters. The error is: 當檔案已存在時,無法建立該檔案。

用13:10:17當索引去查SQL9_Hotfix_KB921896_sqlrun_sql.msp.log:

<Func Name='LaunchFunction'>
Function=Do_sqlPerfmon2
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='T' GetLastError='203'>
Doing Action: Do_sqlPerfmon2
PerfTime Start: Do_sqlPerfmon2 : Fri Oct 31 13:10:16 2008
<Func Name='Do_sqlPerfmon2'>
<EndFunc Name='Do_sqlPerfmon2' Return='183' GetLastError='183'>
PerfTime Stop: Do_sqlPerfmon2 : Fri Oct 31 13:10:16 2008
Gathering darwin properties for failure handling.
MSI (s) (04!D8) [13:10:17:478]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:478]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:525]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:525]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:525]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:525]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:525]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:525]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:525]: Note: 1: 2262 2: Error 3: -2147287038
Error Code: 183
MSI (s) (04!D8) [13:10:17:541]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:541]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:572]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:588]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:588]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:588]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:588]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:588]: Transforming table Error.

MSI (s) (04!D8) [13:10:17:588]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (04!D8) [13:10:17:588]: Product: Microsoft SQL Server 2005 -- Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: 當檔案已存在時,無法建立該檔案。

Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: 當檔案已存在時,無法建立該檔案。

由這些線索看來,應與Performance Counter安裝失敗有關,但是哪一個Counter安裝失敗,並無進一步的訊息。我再去找了Event Log,看到了以下兩則訊息:

13:10:16 LoadPerf Error 3009
為 SQLSERVERAGENT 安裝效能計數器字串時失敗。 錯誤碼為記錄資料的 DWORD 0。

13:10:17 MsInstaller Error 10005
Product: Microsoft SQL Server 2005 -- Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: 當檔案已存在時,無法建立該檔案。

看起來SQL Agent Performance Counter的嫌疑很大,於是我切到C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn,下了以下指令移除幾個可疑的Performance Counter:

lodctr /R:perf-MSSQLSERVERsqlagtctr.ini
(我還一併移除了sqlagtctr.ini, sqlctr.ini, perf-MSSQLSERVERsqlctr.ini,但以上的我覺得最可疑)

再試一次,SP2安裝成功! 運氣真好~~~

歡迎推文分享:
Published 31 October 2008 03:55 PM 由 Jeffrey
Views: 8,379



意見

沒有意見

你的看法呢?

(必要的) 
(必要的) 
(選擇性的)
(必要的) 
(提醒: 因快取機制,您的留言幾分鐘後才會顯示在網站,請耐心稍候)

5 + 3 =

搜尋

Go

<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
 
RSS
創用 CC 授權條款
【廣告】
twMVC

Tags 分類檢視
關於作者

一個醉心技術又酷愛分享的Coding魔人,十年的IT職場生涯,寫過系統、管過專案, 也帶過團隊,最後還是無怨無悔地選擇了技術鑽研這條路,近年來則以做一個"有為的中年人"自許。

文章典藏
其他功能

這個部落格


Syndication