I have a website running on a Windows 2008 R2 server, using a SQL Server Express 2008 R2 database, and I have been experiencing some pretty nasty memory issues the last several days.
Here's the server stats:
It's a Rackspace Cloud Server
Windows Server 2008 R2 Enterprise SP1 x64
Quad-Core AMD Opteron 2.34GHz
2GB RAM
SQL Server 2008 R2 Express Edition with Advanced Services x64
Full text indexing is being used
The website has been running good for a few months now, but all of a sudden I've been seeing errors related to SQL Server running out of memory. Here are the most common exceptions I've seen:
Warning: Fatal error 9001 occurred at Oct 22 2011 5:02AM. Note the error and time, and contact your system administrator.
There is insufficient system memory in resource pool 'internal' to run this query.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Error: 4060, Severity: 11, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped. Error: 18456, Severity: 14, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
Error: 3980, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
The website still seems to respond for the most part. The pages that seem to be affected the most are the ones that write to the database.
I have tried restarting the sqlexpress service as well as restarting the server. Both solutions fix the symptoms, but the problem comes back within about 10 to 15 hours.
When these errors occur, Task Manager reports that around 1.8GB of memory is being used. After I restart the service, the used memory drops back down to about 600MB used and very slowly climbs backup until the exceptions start showing up again.
All help will be greatly appreciated... thanks!
The ERRORLOG will contain some important information about the memory allocation pattern when things started to degrade. The lines will look similar to this:
MEMORYCLERK_SQLGENERAL (node 1) KB
---------------------------------------------------------------- --------------------
VM Reserved 0
VM Committed 0
AWE Allocated 0
SM Reserved 0
SM Commited 0
SinglePage Allocator 136
MultiPage Allocator 0
(7 row(s) affected)
Search your ERRORLOG files for such occurrences, the follow the guidance from How to use the DBCC MEMORYSTATUS command to monitor memory usage on SQL Server 2005, since the output of DBCC MEMORYSTATUS and the output in the ERRORLOG due to OOM status is quite similar.
Related
All of a sudden one day (on my DEV PC) my Microsoft SQL Server 2012 instance (installed as instance name "SQL2012") would not start (all my other installed instances did). Trying to start it manually under Services failed. I don't recall making any recent changes prior to this. The cause of the failure was a mystery.
On inspecting Event Viewer, under System it showed a rather amusing error message [emphasis mine]:
The SQL Server (SQL2012) service terminated with the following service-specific error:
WARNING: You have until SQL Server (SQL2012) to logoff. If you have not logged off at this time, your session will be disconnected, and any open files or devices you have open may lose data.
checking under Application Event Log, I found these 2 error messages (preceded by a number of MSSQL$SQL2012 informational messages):
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 200, state 7, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
followed by:
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
Fearing having lost my system databases (and not having a backup of them to restore - who makes backups of their system dbs anyway??) and needing to access the instance, and attached databases - I was willing to try anything. Even the possible restore of the system databases: Restoring the SQL Server Master Database Even Without a Backup - but that looked quite complex.
Fortunately, I was eventually able to start the instance (thank you to this answer: https://stackoverflow.com/a/59676743/4993856 which I trusted, because Pinal Dave also mentions that particular switch in: SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step msdb110_upgrade.sql encountered error 926, state 1, severity 25) if I ran:
net start mssqlserver$SQL2012 /T902
This pointed to some issue with the upgrade script... (Remember SQL is installed with instance name: SQL2012, hence the mssqlserver$SQL2012 used above for the named instance).
After some more searching I discovered this post: Installing service pack / cumulative update on SQL Server 2016 / 2017 breaks database engine (not exactly the same SQL version as mine) which pointed to the following possible Region Settings setting (Control Panel [when viewed by 'icons'] > All Control Panel Items > Region > Administrative > "Change system locale..."):
"Beta: Use Unicode UTF-8 for worldwide language support" in Region Settings
THAT WAS IT!!! After de-selecting that option (and possibly restarting my computer), the MSSQL Server 2012 Instance started up without any issue, and I was able to access all my previously attached databases.
I assume the pending upgrade scripts ran successfully. Thinking back about it now, it is possible that I agreed to installing a SQL Update, and never bothered to test access to the instance afterwards.
I also don't recall exactly why I chose to enable that specific setting under Region Settings, possibly due to some Linux compatibility, but it looks like it has become defaulted 'on' in recent Windows builds.
I got the same problem SQL2017 after update Windows Patch Hotfix3391(KB5001228)
after restart server MSSQL Fail to start and event viewer shown error below
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 200, state 7, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
Solution
Fix by remove Beta:Use Unicode UTF-8 for Worldwide lang.. in the Region Settings
Then it require restart server. After restart MSSQL can start as normal.
The problem is the msdb_110.sql update script, the script is a bit of a mess, with mixed tabs and spaces (wtf?).
It tries to run a couple of procedures that fail, on startup of sql-server. They fail when the code-page is 65001 (usually because the BETA utf-8 code page option has been selected) and so SQL server fails to start.
This appears to happen any time a SQL Server update is installed. I only experience this error with SQL Server 2017, not 2019
Why?
Don't know? The script is a mess.
Solution
Deselect the use utd-8 code page option
Restart the machine
Start sql server and let it run the script
(optional) reselect the use utd-8 code page option
Restart machine again and sql server
(optinal but recommended) uninstall windows, install a unix and run postgres
I used to send mails from SQL server using the sp_send_dbmail with attachments.
But for the past 10 days the mails are not triggered. I checked the procedure and tried it without the attachments and it works. If an Excel or a PDF attachment is there, the procedure throws the below error...
Location: SpcAlloc.cpp:914
Expression: pPage->IsType (Page::TEXT_MIX_PAGE)
SPID: 89
Process ID: 2108
Msg 3624, Level 20, State 1, Procedure sp_send_dbmail, Line 449
A system assertion check has failed. Check the SQL Server error log for details. Typically,
an assertion failure is caused by a software bug or data corruption. To check for database
corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during
setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft
in the latest Service Pack or in a QFE from Technical Support.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Any Suggestions ?
you will see more details in sqlserver error log and errorlog points out to dump location as well..
Right now,here are your options
1.Try checking if you are on the latest version of sqlserver and if you are not try upgrading to latest CU or SP
2.If you get this error even after upgrading to latest CU or SP,try contacting microsoft support
IF you are latest version of sqlserver,you will have more luck as it has some extensions like SQL Server Diagnostics (Preview) .Once you are done installing this extension, you will provide below screen to upload dump
after uploading,SSMS will analyze the dumps for you and present relevant KB's like below
I occasionally get this error message on a Tridion 2011 SP1 development machine:
There is insufficient system memory in resource pool 'internal' to run this query.
Unable to save Schema (tcm:0-0-0). A database error occurred while executing Stored Procedure "EDA_ORG_ITEMS_FINDUNIQUENESSCONFLICTS".EDA_ORG_ITEMS_FINDUNIQUENESSCONFLICTS
Searching for the error message here on StackOverflow suggests rewriting the stored procedure to not use temporary tables. Without doing that, does anyone know how to get rid of this error message?
Although it is hard to be certain that the upgrade fixed it, the problem hasn't occurred anymore after upgrading SQL Server 2008 R2 to SP1.
SQL Server has encountered 1 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\MSSQL\DATA\%file_name%] in database [%DB_name%] (2). The OS file handle is 0×00000838. The offset of the latest long I/O is: 0×000000ebdc0000
Has anyone encountered and solved this?
Please see this - you may have IO issues - and physical drive issues
http://blogs.msdn.com/chrissk/archive/2008/06/19/i-o-requests-taking-longer-than-15-seconds-to-complete-on-file.aspx
I am for the first time trying to setup transactional replication. This is from an sql 2000 server sp3a to an sql 2005 server which I believe should work.
I did a quick test on my local machine (sql 2005) using it as both the publisher and subscriber and had no trouble setting it up. I repeated a similar process for the real servers using enterprise manager for the 2000 publisher parts and management studio to setup the PULL subscriber. This all seemed to work and the publisher logs seem to be indicating it was preparing the initial data however I am not getting anything coming over as of yet. I checked the logs and am getting an os error 3. I have included the two log sections I think are important below.
2009-07-21 21:37:42.043 The process could not read file 'D:\Program Files\Microsoft SQL Server\MSSQL\ReplData\unc\DOMINO_qlsdat_DOMINO qlsdat to PONGOSQL\20090721164816\enbhostname_1.sch' due to OS error 3.
Message
The replication agent encountered an error and is set to restart within the job step retry interval.
See the previous job step history message or Replication Monitor for more information.
Looks to me like I need to give share permission to the replication data, should I have setup the replication data to go to a share using unc path.
OS Error 3 is no a permission problem, is a path correctness problem: Error code: (Win32) 0x3 (3) - The system cannot find the path specified.. A permission problem would be error 5: Error code: (Win32) 0x5 (5) - Access is denied..
The path D:\Program Files\Microsoft SQL Server\MSSQL\ReplData\unc\DOMINO_qlsdat_DOMINO qlsdat to PONGOSQL\20090721164816\enbhostname_1.sch is incorrect on the server that executes it. Usually one has to use UNC paths in replication, I can't know for sure if that is the problem, but it likely is.