SQL server tự động stop

Các bác giúp em với ạ,
VPS của em cài SQL server, trong SQL manager, services.msc đều đặt start/top là manual mà nó chạy tầm 15-30phút là tự động tặt (phải bật tay lại). nên em fix tam bằng cách cài phần mềm thứ 3 để tự động start mỗi khi nó stop. Mỗi lần nó stop là tài khoản sa bị reset mật khẩu, phải vào SQL studio để đặt lại mật khẩu, Web server thì chạy bình thường mỗi, cái cái SQL server lại bị vậy ( Nó không báo lỗi, Event log của windows cũng không có lỗi) nó muốn tắt lúc nào là nó tự tắt :sob: help me, please

Hi there,

Cậu cần nhiều thông tin hơn để biết vấn đề. Event log của Windows có lẽ không hữu ích lắm, nhưng error log của SQL server có thể cho cậu thêm thông tin.
Cậu có thể làm theo hướng dẫn này để lấy error log, và cung cấp thêm thông tin đó được không?

1 Like

Dạ log đây a

2021-01-26 08:21:35.21 Server      Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (Intel X86) 
	Jun 28 2012 08:42:37 
	Copyright (c) Microsoft Corporation
	Express Edition with Advanced Services on Windows NT 6.1 <X86> (Build 7601: Service Pack 1) (Hypervisor)

2021-01-26 08:21:35.22 Server      (c) Microsoft Corporation.
2021-01-26 08:21:35.23 Server      All rights reserved.
2021-01-26 08:21:35.23 Server      Server process ID is 7448.
2021-01-26 08:21:35.23 Server      System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
2021-01-26 08:21:35.23 Server      Authentication mode is MIXED.
2021-01-26 08:21:35.23 Server      Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2021-01-26 08:21:35.23 Server      This instance of SQL Server last reported using a process ID of 5748 at 1/26/2021 8:01:21 AM (local) 1/26/2021 1:01:21 AM (UTC). This is an informational message only; no user action is required.
2021-01-26 08:21:35.23 Server      Registry startup parameters: 
	 -d c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf
	 -e c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
	 -l c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2021-01-26 08:21:35.24 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2021-01-26 08:21:35.24 Server      Detected 2 CPUs. This is an informational message; no user action is required.
2021-01-26 08:21:35.28 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2021-01-26 08:21:35.47 Server      Node configuration: node 0: CPU mask: 0x00000001:0 Active CPU mask: 0x00000001:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2021-01-26 08:21:35.57 spid7s      Starting up database 'master'.
2021-01-26 08:21:35.64 spid7s      15 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
2021-01-26 08:21:35.66 spid7s      0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
2021-01-26 08:21:35.66 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2021-01-26 08:21:35.73 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 08:21:35.87 spid7s      Starting up database 'mssqlsystemresource'.
2021-01-26 08:21:35.90 spid7s      The resource database build version is 10.50.4000. This is an informational message only. No user action is required.
2021-01-26 08:21:36.52 spid7s      Server name is 'ROOT-PC'. This is an informational message only. No user action is required.
2021-01-26 08:21:36.52 spid9s      Starting up database 'model'.
2021-01-26 08:21:36.90 Server      A self-generated certificate was successfully loaded for encryption.
2021-01-26 08:21:36.91 Server      Server is listening on [ 'any' <ipv6> 1433].
2021-01-26 08:21:36.94 Server      Server is listening on [ 'any' <ipv4> 1433].
2021-01-26 08:21:36.95 spid9s      Clearing tempdb database.
2021-01-26 08:21:36.96 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2021-01-26 08:21:36.96 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\sql\query ].
2021-01-26 08:21:37.10 Server      Dedicated administrator connection support was not started because it is disabled on this edition of SQL Server. If you want to use a dedicated administrator connection, restart SQL Server using the trace flag 7806. This is an informational message only. No user action is required.
2021-01-26 08:21:37.10 Server      The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2021-01-26 08:21:37.10 spid12s     A new instance of the full-text filter daemon host process has been successfully started.
2021-01-26 08:21:37.13 Server      SQL Server is now ready for client connections. This is an informational message; no user action is required.
2021-01-26 08:21:37.32 spid7s      Starting up database 'msdb'.
2021-01-26 08:21:37.98 spid9s      Starting up database 'tempdb'.
2021-01-26 08:21:37.99 spid7s      48 transactions rolled forward in database 'msdb' (4). This is an informational message only. No user action is required.
2021-01-26 08:21:38.21 spid7s      0 transactions rolled back in database 'msdb' (4). This is an informational message only. No user action is required.
2021-01-26 08:21:38.27 spid7s      Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
2021-01-26 08:21:38.35 spid12s     The Service Broker protocol transport is disabled or not configured.
2021-01-26 08:21:38.35 spid12s     The Database Mirroring protocol transport is disabled or not configured.
2021-01-26 08:21:38.38 spid12s     Service Broker manager has started.
2021-01-26 08:21:38.38 spid7s      Recovery is complete. This is an informational message only. No user action is required.

Còn đây là file ERRORLOG.1

2021-01-26 08:20:23.68 spid52      Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (Intel X86) 
	Jun 28 2012 08:42:37 
	Copyright (c) Microsoft Corporation
	Express Edition with Advanced Services on Windows NT 6.1 <X86> (Build 7601: Service Pack 1) (Hypervisor)

2021-01-26 08:20:23.68 spid52      (c) Microsoft Corporation.
2021-01-26 08:20:23.68 spid52      All rights reserved.
2021-01-26 08:20:23.68 spid52      Server process ID is 5748.
2021-01-26 08:20:23.68 spid52      System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
2021-01-26 08:20:23.68 spid52      Authentication mode is MIXED.
2021-01-26 08:20:23.68 spid52      Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2021-01-26 08:20:23.68 spid52      The error log has been reinitialized. See the previous log for older entries.
2021-01-26 08:20:24.16 spid52      AppDomain 4 (msdb.dbo[runtime].3) created.
2021-01-26 08:20:24.65 spid21s     AppDomain 5 (msdb.dbo[ddl].4) unloaded.
2021-01-26 08:20:26.51 spid52      Unsafe assembly 'mssqlinterface, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil' loaded into appdomain 4 (msdb.dbo[runtime].3).
2021-01-26 08:21:01.99 spid52      Unsafe assembly 'mssqlinterface, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil' loaded into appdomain 2 (master.dbo[runtime].1).

Hi @bamice

Log ở trên có vẻ không hữu ích lắm:

  • Log đầu tiên là log ở thời điểm 2021-01-26 08:21, trong vòng vài giây. Tớ nghĩ đây là thời điểm cậu bắt đầu khởi tạo server và chạy MS SQL.
    Log này không cho thấy server restart MSSQL lần nào.
  • Log thứ 2 xảy ra trước thời điểm trên 1 phút (2021-01-26 08:20).

Đây là toàn bộ log cậu có trên server phải không? :smile:

2 Likes

Em tìm thấy bấy nhiêu log đây a

ERRORLOG.6

2021-01-26 10:09:20.52 Server      (c) Microsoft Corporation.
2021-01-26 10:09:20.52 Server      All rights reserved.
2021-01-26 10:09:20.52 Server      Server process ID is 5984.
2021-01-26 10:09:20.52 Server      System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
2021-01-26 10:09:20.52 Server      Authentication mode is MIXED.
2021-01-26 10:09:20.52 Server      Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2021-01-26 10:09:20.52 Server      This instance of SQL Server last reported using a process ID of 8120 at 1/26/2021 9:39:42 AM (local) 1/26/2021 2:39:42 AM (UTC). This is an informational message only; no user action is required.
2021-01-26 10:09:20.52 Server      Registry startup parameters: 
	 -d c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf
	 -e c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
	 -l c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2021-01-26 10:09:20.53 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2021-01-26 10:09:20.53 Server      Detected 2 CPUs. This is an informational message; no user action is required.
2021-01-26 10:09:20.61 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2021-01-26 10:09:20.64 Server      Node configuration: node 0: CPU mask: 0x00000001:0 Active CPU mask: 0x00000001:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2021-01-26 10:09:20.69 spid7s      Starting up database 'master'.
2021-01-26 10:09:20.77 spid7s      22 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
2021-01-26 10:09:20.77 spid7s      0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
2021-01-26 10:09:20.77 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2021-01-26 10:09:20.80 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 10:09:20.82 spid7s      Starting up database 'mssqlsystemresource'.
2021-01-26 10:09:20.85 spid7s      The resource database build version is 10.50.4000. This is an informational message only. No user action is required.
2021-01-26 10:09:21.51 spid9s      Starting up database 'model'.
2021-01-26 10:09:21.53 spid7s      Server name is 'ROOT-PC'. This is an informational message only. No user action is required.
2021-01-26 10:09:21.59 Server      A self-generated certificate was successfully loaded for encryption.
2021-01-26 10:09:21.64 Server      Server is listening on [ 'any' <ipv6> 1433].
2021-01-26 10:09:21.69 Server      Server is listening on [ 'any' <ipv4> 1433].
2021-01-26 10:09:21.74 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2021-01-26 10:09:21.76 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\sql\query ].
2021-01-26 10:09:21.77 Server      Dedicated administrator connection support was not started because it is disabled on this edition of SQL Server. If you want to use a dedicated administrator connection, restart SQL Server using the trace flag 7806. This is an informational message only. No user action is required.
2021-01-26 10:09:21.77 Server      The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2021-01-26 10:09:21.82 Server      SQL Server is now ready for client connections. This is an informational message; no user action is required.
2021-01-26 10:09:22.12 spid12s     A new instance of the full-text filter daemon host process has been successfully started.
2021-01-26 10:09:22.26 spid7s      Starting up database 'msdb'.
2021-01-26 10:09:22.32 spid9s      Clearing tempdb database.
2021-01-26 10:09:22.82 spid9s      Starting up database 'tempdb'.
2021-01-26 10:09:22.85 spid7s      48 transactions rolled forward in database 'msdb' (4). This is an informational message only. No user action is required.
2021-01-26 10:09:22.89 spid12s     The Service Broker protocol transport is disabled or not configured.
2021-01-26 10:09:22.89 spid12s     The Database Mirroring protocol transport is disabled or not configured.
2021-01-26 10:09:22.90 spid7s      0 transactions rolled back in database 'msdb' (4). This is an informational message only. No user action is required.
2021-01-26 10:09:22.90 spid7s      Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
2021-01-26 10:09:22.90 spid12s     Service Broker manager has started.
2021-01-26 10:09:22.92 spid7s      Recovery is complete. This is an informational message only. No user action is required.
2021-01-26 10:50:26.36 spid52      Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
2021-01-26 10:50:26.41 spid52      Using 'xpstar.dll' version '2009.100.1600' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
2021-01-26 10:50:49.20 spid52      Starting up database 'MOBILESHOP'.
2021-01-26 10:50:54.29 spid52      Starting up database 'MOBILESHOP'.
2021-01-26 10:51:15.78 spid53      Starting up database 'MOBILESHOP'.
2021-01-26 11:07:41.64 spid74      Configuration option 'clr enabled' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:41.84 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:42.99 spid74      Setting database option TRUSTWORTHY to ON for database master.
2021-01-26 11:07:43.27 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:45.12 spid74      Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:45.27 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:45.35 spid74      Configuration option 'xp_cmdshell' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:45.52 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:45.91 spid74      Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:46.27 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:46.51 spid74      Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:46.68 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:46.94 spid74      Configuration option 'default trace enabled' changed from 0 to 0. Run the RECONFIGURE statement to install.
2021-01-26 11:07:46.99 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:47.18 spid74      Configuration option 'Ole Automation Procedures' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:47.21 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:47.26 spid74      Configuration option 'Agent XPs' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:07:47.38 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:07:51.01 spid74      Attempting to load library 'odsole70.dll' into memory. This is an informational message only. No user action is required.
2021-01-26 11:07:51.03 spid74      Using 'odsole70.dll' version '2009.100.1600' to execute extended stored procedure 'sp_OACreate'. This is an informational message only; no user action is required.
2021-01-26 11:08:57.35 spid74      Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:10:49.44 spid74      Configuration option 'allow updates' changed from 1 to 1. Run the RECONFIGURE statement to install.
2021-01-26 11:10:49.78 spid74      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2021-01-26 11:12:00.54 spid74      Attempting to cycle error log. This is an informational message only; no user action is required.

Mấy log kia ngắn với tương tự ERRORLOG.1 nên em không chụp :cold_sweat:

Cậu để ý dòng này:

2021-01-26 11:07:41.64 spid74      Configuration option 'clr enabled' changed from 1 to 1. Run the RECONFIGURE statement to install.

Như tớ hiểu, có ai đó đã sửa configuration của MS SQL. Thường, khi sửa config, cậu cần restart lại MSSQL để config đó được thay đổi.
Cậu có biết ai đã làm việc đó không? :smile:

3 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?