SQL server Uninstall Fails

If the removal process fails, review the SQL Server SetupLog Files to determine the root cause.

SQL Server Setup creates log files in a dated and time-stamped folder within %programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log by default, where nnn are numbers that correspond to the version of SQL that’s being installed. The time-stamped log folder name format is YYYYMMDD_hhmmss. When Setup is executed in unattended mode, the logs are created within %temp%\sqlsetup*.log. All files in the log folder are archived into the Log*.cab file in their respective log folder.

FilePath
Summary.txt%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log
Summary_<MachineName>_Date.txt%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\YYYYMMDD_hhmmss
Detail.txt%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\YYYYMMDD_hhmmss
Datastore%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\YYYYMMDD_hhmmss\Datastore
MSI Log Files%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\YYYYMMDD_hhmmss\<Name>.log
ConfigurationFile.ini%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\YYYYMMDD_hhmmss
SystemConfigurationCheck_Report.htm%programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log\YYYYMMDD_hhmmss
For unattended installations%temp%\sqlsetup*.log

The numbers in the path nnn correspond to the version of SQL being installed. In the above picture, SQL 2017 was installed, so the folder is 140. For SQL 2016, the folder would be 130, and for SQL 2014 the folder would be 120.

SQL server setup completes three basic phases:

  1. Global Rules verification: validates basic system requirements
  2. Component update: checks to see if there are any updates available for the media being installed
  3. User-requested action: allows the user to select and customize features

This workflow produces a single summary log, and either a single detail log for a base SQL Server installation, or two detail logs for when update, such as a service pack, is installed along with the base installation.

Additionally, there are datastore files that contain a snapshot of the state of all the configuration objects that are being tracked by the setup process, and are useful for troubleshooting configuration errors. XML dump files are created for each execution phase and are saved in the Datastore log subfolder under the time-stamped log folder.

The following sections describe SQL Server Setup log files.

Summary.txt file

Overview

This file shows the SQL Server components that were detected during Setup, the operating system environment, command-line parameter values if they are specified, and the overall status of each MSI/MSP that was executed.

The log is organized into the following sections:

  • An overall summary of the execution
  • Properties and the configuration of the computer where SQL Server Setup was run
  • SQL Server product features previously installed on the computer
  • Description of the installation version and installation package properties
  • Runtime input settings that are provided during install
  • Location of the configuration file
  • Details of the execution results
  • Global rules
  • Rules specific to the installation scenario
  • Failed rules
  • Location of the rules report file

Location

The summary.txt is located within %programfiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\.

To find errors in the summary text file, search the file by using the “error” or “failed” keywords.

Summary_<MachineName>_YYYYMMDD_HHMMss.txt file

Overview

The summary_engine base file is similar to the summary file and is generated during the main workflow.

Location

The Summary_<MachineName>_YYYYMMDD_HHMMss.txt file is located at %programfiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\<YYYYMMDD_HHMM>\.

Detail.txt file

Overview

Detail.txt is generated for the main workflow such as install or upgrade, and provides the details of the execution. The logs in the file are generated based on the time when each action for the installation was invoked. The text file shows the order in which the actions were executed, as well as their dependencies.

Location

The detail.txt file is located within %programfiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\<YYYYMMDD_HHMM>\Detail.txt.

If an error occurs during the Setup process, the exception or error is logged at the end of this file. To find the errors in this file, first examine the end of the file followed by a search of the file for the “error” or “exception” keywords

MSI log files

Overview

The MSI log files provide details of the installation package process. They are generated by the MSIEXEC during the installation of the specified package.

Types of MSI log files:

  • <Feature>_<Architecture>_<Interaction>.log
  • <Feature>_<Architecture>_<Language>_<Interaction>.log
  • <Feature>_<Architecture>_<Interaction>_<workflow>.log

Location

The MSI log files are located at %programfiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\<YYYYMMDD_HHMM>\<Name>.log.

At the end of the file is a summary of the execution, which includes the success or failure status and properties. To find the error in the MSI file, search for “value 3” and review the text before and after.

ConfigurationFile.ini file

Overview

The configuration file contains the input settings that are provided during installation. It can be used to restart the installation without having to enter the settings manually. However, passwords for the accounts, PID, and some parameters are not saved in the configuration file. The settings can be either added to the file or provided by using the command line or the Setup user interface. For more information, see Install SQL Server 2016 Using a Configuration File.

Location

The ConfigurationFile.ini is located at %programfiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\<YYYYMMDD_HHMM>\.

SystemConfigurationCheck_Report.htm file

Overview

The system configuration check report contains a short description for each executed rule, and the execution status.

Location

The SystemConfigurationCheck_Report.htm is located at %programfiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\<YYYYMMDD_HHMM>\.

SQL Server Uninstallation

Today we are discussing about uninstall a stand-alone instance of SQL Server. By following the steps, you also prepare the system so that you can reinstall SQL Server.

Considerations :

  • For Successful uninstall of SQL Server, you must have a local administrator with permissions to log on as a service.
  • If your computer has the minimum required amount of physical memory, increase the size of the page file to two times the amount of physical memory. Insufficient virtual memory can result in an incomplete removal of SQL Server.
  • On a system with multiple instances of SQL Server, the SQL Server browser service is uninstalled only once the last instance of SQL Server is removed. The SQL Server Browser service can be removed manually from Programs and Features in the Control Panel.
  • Uninstalling SQL Server deletes tempdb data files that were added during the install process. Files with tempdb_mssql_*.ndf name pattern are deleted if they exist in the system database directory.

Preparation :

  1. Back up your data. Either create FULL Backup of all databases, including system databases, or manually copy the .mdf and .ldf files to a separate location. The master database contains all system level information for the server, such as logins, and schemas. The msdb database contains job information such as SQL Server agent jobs, backup history, and maintenance plans. The files that you must save include the following database files:
    • master.mdf
    • msdbdata.mdf
    • Tempdb.mdf
    • mastlog.ldf
    • msdblog.ldf
    • Templog.ldf
    • model.mdf
    • Mssqlsystemresource.mdf
    • ReportServer[$InstanceName]
    • modellog.ldf
    • Mssqlsustemresource.ldf
    • ReportServer[$InstanceName]TempDB

2. Stop all SQL Server services. We recommend that you stop all SQL Server services before you uninstall SQL Server components. Active connections can prevent successful uninstallation.

3. Use an account that has the appropriate permissions. Log on to the server by using the SQL Server service account or by using an account that has equivalent permissions. For example, you can log on to the server by using an account that is a member of the local Administrators group.

Uninstallation ( Win 2008 – Win 2012 R2 ):

To uninstall SQL Server from Windows Server 2008, Windows Server 2012 and Windows 2012 R2, follow these steps:

  1. To begin the removal process, navigate to the Control Panel and then select Programs and Features.
  2. Right-click Microsoft SQL Server (Version) (Bit) and select Uninstall. For example, Microsoft SQL Server 2012 (64-bit).

3. Select Remove on the SQL Server dialog pop-up to launch the Microsoft SQL Server installation wizard.

4. On the Select Instance page, use the drop-down box to specify an instance of SQL Server to remove, or specify the option to remove only the SQL Server shared features and management tools. To continue, select Next.

5. On the Select Features page, specify the features to remove from the specified instance of SQL Server.

6. On the Ready to Remove page, review the list of components and features that will be uninstalled. Click Remove to begin uninstalling

7. Refresh the Programs and Features window to verify the SQL Server instance has been removed successfully, and determine which, if any, SQL Server components still exist. Remove these components from this window as well, if you so choose.

Uninstallation ( Win 2016 – Win 2019) :

To uninstall SQL Server from Windows 10, Windows Server 2016, Windows Server 2019, and greater, follow these steps:

  1. To begin the removal process navigate to Settings from the Start menu and then choose Apps.
  2. Search for sql in the search box.
  3. Select Microsoft SQL Server (Version) (Bit). For example, Microsoft SQL Server 2017 (64-bit).
  4. Select Uninstall.

5. Select Remove on the SQL Server dialog pop-up to launch the Microsoft SQL Server installation wizard.

6. On the Select Instance page, use the drop-down box to specify an instance of SQL Server to remove, or specify the option to remove only the SQL Server shared features and management tools. To continue, select Next.

7. On the Select Features page, specify the features to remove from the specified instance of SQL Server.

8. On the Ready to Remove page, review the list of components and features that will be uninstalled. Click Remove to begin uninstalling

9. Refresh the Apps and Features window to verify the SQL Server instance has been removed successfully, and determine which, if any, SQL Server components still exist. Remove these components from this window as well, if you so choose.