Recently, while applying SQL Server 2012 Service Pack 3, encountered the following error and SQL Patch failed to upgrade.
"The patch installer has failed to update the following instance: MSSQLSERVER. To determine the reason for failure, review the log files"
For troubleshooting the same ( or any patching ), I had to check a sequence of folders to identify the root cause. Thought it would be useful to document the list of files and folders to check if one encounters errors during patching or installation1) "\SQLVersion number\Setup Bootstrap\Log\"
2) "\SQLVersion number\Setup Bootstrap\Log\Timestamp"
3) "\SQLVersion number\Setup Bootstrap\Log\Timestamp\MSSQLSERVER"
is the installation path - Example "C:\Program Files\Microsoft SQL Server\"
SQLVersion number - 90 for SQL 2005, 100 for 2008, 110 - 2012, 120 - 2014,130 - 2016
Step 1:
\SQLVersion number\Setup Bootstrap\Log\summary.txt" Look for summary.txt to know the activity was a success or failure.
On the same folder, locate the folder with the timestamp of your activity.
Open the folder for more details on the error. "Summary_*.txt" would be similar to the file read on log "\SQLVersion number\Setup Bootstrap\Log\summary.txt" . Identify the
component that failed. It can be "Database Engine" / "Replication" or any other component of SQL Server
Step 2:
Open \SQLVersion number\Setup Bootstrap\Log\Timestamp\ and look at the following files for more info
1) Detail.txt - Search using keywords like "Error" or "Failed" to quickly get to the issue
2) SQLServer_ERRORLOG_*.txt
3) Summary_*.txt
Step 3:
If still no clue, Open \SQLVersion number\Setup Bootstrap\Log\Timestamp\MSSQLSERVER. Open "Detail.txt". Search for keywords like "Error" or "Failed" This should help one figure out what actually caused the error.
Besides these, "InstallationDir>\SQLVersion number\Setup Bootstrap\Log\Timestamp\MSSQLSERVER" also contains one file for each component patched. you may search thro them if the root cause is still not clear from above files.
In my case, the issue was related to permissions on "C:\Windows\System32\". The error message was 0
Failed to version-copy file '\MSSQL11.MSSQLSERVER\MSSQL\Binn\hadrres.dll' to 'C:\Windows\system32\hadrres.dll'. Exception data is: System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open.
The Error message was found from InstallationDir>\SQLVersion number\Setup Bootstrap\Log\Timestamp\MSSQLSERVER\Detail.txt. After granting permissions on the file, issue was fixed and patch was reran and it updated successfully.