最近跟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安裝成功! 運氣真好~~~


Comments

Be the first to post a comment

Post a comment


65 - 24 =