SQL Server database startup process details and analysis and solutions to problems that cannot be started

Source: Internet
Author: User
Tags sql error

SQL Server database startup process details and analysis and solutions to problems that cannot be started

Currently, as an excellent RDBMS of Microsoft, the SQL Server database has very few problems when it is started. When we use it at ordinary times, we seldom pay attention to the startup process, or you rarely know the underlying running process. Most of the processes only focus on a series of internal applications such as tables, stored procedures, views, and functions, however, one day when it runs normally, it suddenly fails to be started. At this time, it is helpless. What it can do may only be Reinstallation, configuration, and restoration, however, this process is actually a very time-consuming process, especially when we are faced with a large production database, it may be at this very pressing moment, you cannot re-build an environment.

Therefore, as a qualified database user, we need to understand the startup and running processes of the database. Once a problem occurs, we can promptly locate and solve the problem.

Let's start with the topic in this article.

SQL Server stores a Windows service, and each server corresponds to a sqlserver.exe process. This is an executable file, which is stored in the installation directory of SQL Server by default. When we start the file, it is called directly and then started the service.

Part 1: SQL Server instance startup methods and Problems

SQL Server instances can be started in the following ways:

(1) manual or automatic startup (default) in the Windows service console. This is also the most common method.

(2) The second method is the startup method provided by SQL Server itself. Here we can start it manually.

(3) manually start SQL Server SSMS. This method is generally used for manual restart.

(4) In the Windows Command window, run the 'net start' command to start the instance manually.

All of the preceding methods can start SQL Sever and are recorded in SQL log information.

 

------------------------------------------------------------ Domineering split line -----------------------------------------------------------------------

Part 2: detailed process of SQL Server instance startup and Related Problems

Step 1. Check the registry key

When a sqlserver.exe file starts to be started, the first thing to do is to check its configuration information for the value items stored in the registry.

The following key values are important:

Here

AuditLevel: in fact, it is how SQL records user logon records;

LoginMode: indicates the identity authentication method of the SQL Server;

BackupDirectory: default backup path and other information;

For more information about the registry, do not make any modifications. Of course, these values can be set in SQL Server by default:

If the registry is not modified, the startup sequence of this step is generally normal. Of course, there is usually no way to solve the problem, and most of the solutions are only reinstalled.

However, the following two problems can be solved in this step:

<1> account startup Permissions

If the account used to start the SQL Server process does not have the permission to read the registry, then this service cannot be started. Generally, even SQL error logs cannot be generated at this time.

How can we find out at this time? Although it cannot create SQL error logs at this time, it leaves traces on the Windows layer. Let's look at it:

Set the Service Startup account to the gust Guest account to start the service.

The following error message is generated:

An error log is also generated in the Windows Log information:

Here, access denied refers to access to the registry information.

Solution:

The solution to this problem is simple. You only need to escalate the privilege of the user to the startup account of the SQL Server service. The Elevation of Privilege is also simple, you only need to add the startup Service Group of the local user to SQL.

Of course, you can also directly log on to a higher-level user. Generally, the super Administrator account is used by default.

<2> access logs and folders are faulty.

By default, when SQL Server is started, a startup log file will be created to record all the correct log information, including the error log information. If the path of this log information cannot be found at this time, or a log already exists, but the log is locked (some anti-virus software of NB is good at doing this). At this time, this service cannot be started, and the log file of SQL Server cannot be created, at this time, we have to solve the problem by using the Windows platform itself.

The log file path created by SQL Server startup also exists in the registry key. Let's look at this parameter:

Here we intentionally change it to an incorrect path to start it:

The following error occurs:

System Error Log Information

The error description is clear.

Solution:

This problem is easy to solve. You only need to check the path to ensure that the file under the path is correct.

However, when SQL Server is not started, check the system logs on the Windows platform for some error messages.

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.