Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15889 articles
Browse latest View live

There is insufficient system memory in resource pool internal to run this query

$
0
0
Hi,
We are getting the following error. Please help on this issue.
There is insufficient system memory in resource pool 'internal' to run this query.
SQL 2012(SP1)

Error Log:
2018-12-11 05:07:51.44 Server      Error: 17300, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.44 Server      Error: 17312, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.44 Server      Error: 18054, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.45 Server      Error: 9602, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.45 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.45 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.46 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.46 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.46 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.46 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.46 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.46 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.46 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.46 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.46 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.46 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.47 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.47 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.47 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.47 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.47 spid20s     Error: 701, Severity: 17, State: 132.
2018-12-11 05:07:51.47 spid20s     There is insufficient system memory in resource pool 'internal' to run this query.
2018-12-11 05:07:51.96 Server      Error: 17300, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.96 Server      Error: 17312, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.96 Server      Error: 18054, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:51.96 Server      Error: 9602, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:56.95 Server      Error: 17300, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:56.95 Server      Error: 17312, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:56.95 Server      Error: 18054, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:07:56.95 Server      Error: 9602, Severity: 16, State: 1. (Params:). The error is printed in terse mode because there was error during formatting. Tracing, ETW, notifications etc are skipped.
2018-12-11 05:19:07.88 spid59      Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
2018-12-11 05:19:07.89 spid59      Configuration option 'Ole Automation Procedures' changed from 0 to 1. Run the RECONFIGURE statement to install.
2018-12-11 05:19:07.93 spid59      Configuration option 'Ole Automation Procedures' changed from 1 to 0. Run the RECONFIGURE statement to install.
2018-12-11 05:19:07.94 spid59      Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.
2018-12-11 05:19:07.95 spid59      Configuration option 'show advanced options' changed from 0 to 0. Run the RECONFIGURE statement to install.
2018-12-11 05:48:53.09 Server       Failed allocate pages: FAIL_PAGE_ALLOCATION 1
2018-12-11 05:48:53.09 Server     

Creating and deleting file groups dynamically inside Sliding Window partitioning

$
0
0

We are creating a new Database which has very less disk space . we have two tables where the data loads frequently. Retention period for this data is five years.

We have created monthly partitions for this table. and have created 12 file groups which will  be reused by new partitions.

We created a process which delete the partitions with data older than 5  year and  new partitions for the next month is created .This process runs every month.

we need to create a new process when ever there is a warning for low disk space. we need to delete the oldest partition with data.

But we  really missed out the point that deleting partition wont free  the disk space.So we have thought of creating file groups dynamically for each month and assigning this file groups to the respective partition of that month.When we delete the partition the file should also be deleted along with it.

I just need need to know is there any problem in doing this?

i didn't find any related links which do the same.Can anyone give an input on how to handle this inside a sliding window partitioning Logic..


Use of Application

$
0
0

Greetings Developers 

Hope you are well 

I have an interesting request 

Is there a way or a code that looks at the following 

1. What application is reading the DataBase? E.g. Power BI etc

2. If it Reads The Database which Tables/Views and Columns is it reading at?

if you need more understanding please feel free to ask 

thanks 

SQL Server service does not autostart on Windows Server 2019 DC

$
0
0

Hi,

I've installled SQL Server 2017 Developer on a Windows Server 2019.
The Windows Server is also a domain controller (it is my developer machine).

Now if I start the server, the SQL Server service for all instances does not start automatically.
Event log says that the service could not be started because of wrong username or password.

If I start the service manually without changing anything the service is starting without errors.

While researching the problem I've found several tasks, which all did not solve the problem.
Delayed start is not an acceptable option.

Now I installed SQL Server 2017 on a Windows Server 2016, which is also a domain controller.

The service starts without any problems.

Any ideas, why I have that problem only on a Windows Server 2019 DC ?

THX for any help or ideas ...

how can i see the partition function on a certain table in ssms?

$
0
0

Hi we run 2016 enterprise.  I know this one table is partitioned but cant figure out how to see by what column it is partitioned.  So far I've scripted it as a create,  looked at properties, poked around in tools and customize but cant seem to generate the ddl that must have been used initially.   I ran the query below and from the scheme and func names I can guess but would really like to see the ddl used to define the partition.

select distinct
	table_name = o.name,
	partition_index_name = i.name,
	partition_index_type = i.type_desc,
	partition_scheme = ps.name,
	partition_function = pf.name
from sys.partitions p
join sys.objects o on o.object_id = p.object_id
join sys.indexes i on p.object_id = i.object_id and p.index_id = i.index_id
join sys.data_spaces ds on i.data_space_id = ds.data_space_id
join sys.partition_schemes ps on ds.data_space_id = ps.data_space_id
JOIN sys.partition_functions pf on ps.function_id = pf.function_id

  

CPU Restriction for particular user

$
0
0

Hello everyone,

I just wonder if you could help me?

I have handover SQL server management from the guy that just left.

It is SXL Server 2012:

Microsoft SQL Server Management Studio          11.0.3156.0

Microsoft Analysis Services Client Tools                11.0.3130.0

Microsoft Data Access Components (MDAC)      6.3.9600.17415

Microsoft MSXML                                                           3.0 6.0

Microsoft Internet Explorer                                       9.11.9600.19155

Microsoft .NET Framework                                         4.0.30319.36468

Operating System                                                           6.3.9600

It always was a problem with this server as it was running slow and hang very often.

I did some investigation to find out what the problem actually is and found out that server is timing out because it runs out from memory and CPU.

First think I did was to check memory limit and it has been setup to 2500TB (WTF!?), I have change it to 8GB so usage dropped to around 80%.

I have fixed loads of indexes on tables as well (don’t ask J)

The last problem I have is that server runs out with CPU. Again I did some investigation and found out that CPU is used by one user called “Reporter”.

This user is used to run all reports created by previous guy… long story short, I wanted to cry when I have seen how those queries has been written… tens of temp tables, data copied across the tables several of times etc.

So basically each of his queries are very expensive, and there is over hundred different reports that can be run by several of people…

What I should do is to delete all those reports and rebuild them properly, unfortunately due to amount I can’t do that, new server, CRM system and reporting system will be implemented in March, so there is no point to spend weeks rebuilding the reporting system that will be replaced week later.

That means that I need to somehow survive 3,5 months with that what I have. I’m looking for to somehow restrict CPU usage for this particular user, or to lower the priority for queries run by this user.

I don’t care is report will run one hour or one day as long as CRM system will able to use DB without any problems.

I can’t use Resource Governor as it’s available in Enterprise edition only L

Have anybody have any idea how could I do this? I know it’s a bit challenging, but maybe?

lckmgr.cpp line=10028 Failed Assertion = 'removedEntry != NULL'

$
0
0

When we run tests where we stress sqlserver , over time it will eventually fail with errors and after that restarting doesn't help, we end up having to reboot and sometimes that doesnt help and we have to  uninstall sql server and re installing it to get things working without errors. we will eventually get errors like the following. we get this from sqlserver 13.0.5153  and have also seen it in sqlserver 2017.

any ideas on what would be the problem.

thanks

scott

12/10/2018 14:46:22,spid51,Unknown,SQL Server Assertion: File: <lckmgr.cpp><c/> line=10028 Failed Assertion = 'removedEntry != NULL'. This error may be timing-related. If the error persists after rerunning the statement<c/> use DBCC CHECKDB to check the database for structural integrity<c/> or restart the server to ensure in-memory data structures are not corrupted.

12/10/2018 11:52:53,spid29s,Unknown,SQL Server Assertion: File: <lckmgr.cpp><c/> line=10028 Failed Assertion = 'removedEntry != NULL'. This error may be timing-related. If the error persists after rerunning the statement<c/> use DBCC CHECKDB to check the database for structural integrity<c/> or restart the server to ensure in-memory data structures are not corrupted.

12/10/2018 11:17:05,spid55,Unknown,A system assertion check has failed. Check the SQL Server error log for details. Typically<c/> an assertion failure is caused by a software bug or data corruption. To check for database corruption<c/> consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup<c/> a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.

12/10/2018 11:17:05,spid55,Unknown,SQL Server Assertion: File: <xactrm.cpp><c/> line=4898 Failed Assertion = 'notifyList.IsEmpty ()'. This error may be timing-related. If the error persists after rerunning the statement<c/> use DBCC CHECKDB to check the database for structural integrity<c/> or restart the server to ensure in-memory data structures are not corrupted.

12/10/2018 10:19:13,spid58,Unknown,SQL Server Assertion: File: <qxcntxt.cpp><c/> line=1267 Failed Assertion = 'cref == 0'. This error may be timing-related. If the error persists after rerunning the statement<c/> use DBCC CHECKDB to check the database for structural integrity<c/> or restart the server to ensure in-memory data structures are not corrupted.

12/10/2018 10:18:49,spid58,Unknown,A system assertion check has failed. Check the SQL Server error log for details. Typically<c/> an assertion failure is caused by a software bug or data corruption. To check for database corruption<c/> consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup<c/> a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a Hotfix from Technical Support.

12/10/2018 10:18:49,spid58,Unknown,SQL Server Assertion: File: <lckmgr.cpp><c/> line=10028 Failed Assertion = 'removedEntry != NULL'. This error may be timing-related. If the error persists after rerunning the statement<c/> use DBCC CHECKDB to check the database for structural integrity<c/> or restart the server to ensure in-memory data structures are not corrupted.

In the database log we will get errors like this:

Microsoft SQL Server 2016 (SP2-CU2) (KB4340355) - 13.0.5153.0 (X64) <nl/>
Process 0:0:0 (0x1ef4) Worker 0x000001BF4728A160 appears to be non-yielding on Scheduler 35. Thread creation time: 13188985944346. Approx Thread CPU Used: kernel 171 ms<c/> user 23685750 ms. Process Utilization 11%. System Idle 84%. Interval: 29709971 ms.
Process 0:0:0 (0x940) Worker 0x000001BF476F6160 appears to be non-yielding on Scheduler 38. Thread creation time: 13189015307588. Approx Thread CPU Used: kernel 0 ms<c/> user 199656 ms. Process Utilization 22%. System Idle 69%. Interval: 250745 ms.
Process 0:0:0 (0x4788) Worker 0x000001BF45B60160 appears to be non-yielding on Scheduler 14. Thread creation time: 13189020839392. Approx Thread CPU Used: kernel 0 ms<c/> user 189093 ms. Process Utilization 22%. System Idle 69%. Interval: 235025 ms.
OS Error :Terminating system thread due to exception in ProcessWorker
OS Error :Terminating worker due to exception in ProcessTasks
DoMiniDump () encountered error (0x80004005) - Unspecified error
External dump process return code 0x20000001.<nl/>External dump process returned no errors.
Stack Signature for the dump is 0x000000002E762113
00007FFCCFAEEFC1 Module(ntdll+000000000006EFC1)
00007FFCCDB51FE4 Module(KERNEL32+0000000000011FE4)
00007FFCA5FF1F28 Module(sqldk+0000000000021F28)
00007FFCA5FF10E7 Module(sqldk+00000000000210E7)
00007FFCA5FF1CA0 Module(sqldk+0000000000021CA0)
00007FFCA5FF1C08 Module(sqldk+0000000000021C08)
00007FFCA5FD55A4 Module(sqldk+00000000000055A4)
* Short Stack Dump
* -------------------------------------------------------------------------------
* *******************************************************************************
*       Rip: 00007FFCA5FD55A4:  41EFD141407D8B45  02B6CE850F01E783  0000001198BB8300  8B480001C00F840F 000303E8CB8B48D6  850FC085F08B4400
*       R15: 0000000000000000:
*       R14: 00007FFCA61E4590:  0000000000000000  0000000000000000  00007FFCA61E6678  00007FFCA61E3AB0 0000000000000005  00007FFCA61E6678
*       R13: 0000000000000000:
*       R12: 0000000000000000:
*       R11: 000000744B2FFA80:  0000000000000000  00007FFCA61E4590  000001BF46297468  0000000000000000 000001BF46297468  00007FFCA5FD5586
*       R10: 0000000000000000:
*        R9: 000000744B2FF7E0:  00000000000001AF  0000000000000000  0000000000000002  000000B32FB29FE0 0000000000000000  FFFFFFFFFFFFFFFF
*        R8: 0000000000000000:
*       Rdi: 000001BF46297468:  0000000000000000  0000000000000000  0000000000000000  0000000000000000 0000000000000000  0000000000000000



























































































































Unaccounted memory and System.outofMemoryException issue

$
0
0

I am facing an memory issue as pointed out by application person as they get below error on their application interface, this erorr appears when reports are being run and system is starved our of memory so the reports crash is what is putforward

-------------------

Error -Exception of type 'System.outofMemoryException' was thrown
at String.CtorCharCount
Last DataFactory error : 
Stack Trace :
At System.String.CtorCharCount(Char c,Int32 count)
at Microsoft.VisualBasic.compilerservices likeoperator matchrange(string source,Int32)

---------------

On the SQL server below can be observed on querying dm_os_process_memory, the max server memory on this SQL2014 ENT core editon (4 cores) is set to 90GB and we have total OS server memory as 100GB.

Memory_usedby_Sqlserver_MBLocked_pages_used_Sqlserver_MBTotal_VAS_in_MBprocess_physical_memory_lowprocess_virtual_memory_low
910189025813421772700

When i query buffer descriptors i can see below utilisation that comes close to 73 G B , on task manager i can see SQL server.exe using 726,728K .

What confuses is where is the remaining memory between 73 GB to 90GB getting into as i cant see if SQL uses that much internally. 

db_namedb_buffer_pagesdb_buffer_MBdb_buffer_percent
X729977457029NULL
Y1632451275NULL
Z1352311056NULL
tempdb26670208NULL
msdb298623NULL
A184214NULL
B5914NULL
master2021NULL
C190NULL
model130NULL



dbcc loginfo show vlf status = 2 always

$
0
0

Hi Guys,

I found one database have status = 2 in dbcc loginfo, and it never clears.

The log file was 40GB, and log backup runs every 15 minutes, I can see in last 2 weeks, the largest log backup is 14GB, normally 30MB.

Those are fine, the strange thing is, when DBCC SQLPERF(LOGSPACE); it shows the usage percentage is 4%. in shrink log dialog, it shows 38GB out of 40GB are free!  dbcc loginfo still shows status is 2 for all vlfs, btw log_reuse_wait_desc shows nothing:

select log_reuse_wait_desc from sys.databases where name = 'ContainerSubscriptionService'

I decided to shrink log file from 40gb to 30gb, and it worked!

 checked dbcc loginfo still shows status = 2 for all vlfs.

I manually made several log backups, log_reuse_wait_desc shows nothing, dbcc loginfo shows 2 for all. I did shrink again, now it goes to 20GB.

I manually made several log backups, log_reuse_wait_desc shows nothing, dbcc loginfo shows 2 for all. I did shrink again, now it goes to 10GB.

from now on, I cannot shrink the log file anymore even log_reuse_wait_desc shows nothing, dbcc loginfo shows 2 for all, no matter how many log backups I do.

any ideas?

Version:

Microsoft SQL Server 2014 (SP2-CU4) (KB4010394) - 12.0.5540.0 (X64) 
Jan 27 2017 03:40:25 
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

Thanks in advance!

Regards,

Albert

Best way to store the sql server errors into text file

$
0
0

What is the best way to export the SQL server errors in catch block to text file.I also  need to export some custom errors too for failures of any conditions in the try Block?

We will not be able to use CLR functions or OLE automation procedure.

Is it a good thing to execute SSIS package inside the Stored procedure and load into text File.I will be forced to write the package execution for every place where there is a condition failure?

Is there any disadvantage for using cmdshell?

Long query takes time - but - redirected to # Table then read is faster - what is issue here please?

$
0
0
Dear All - Some of the long SQL Queries having multiple joins takes time to display complete data to SQL Server Management Studio BUT the same if redirected to # Temp table and then data is read from # Temp table it is working very fast.  What can be the issue here?  Is it related to Network Latency OR what else to check for understanding the issue and fix please.  Thanks.

Raghavendra Narayana

Self signed cert used for one connection only, rest of connections not encrypted

$
0
0

One SQL 2016 prod database VM is being used by users for querying data, analytics, reporting, etc. users are in same domain and not using SSL. However, one database in another data center will query regularly one of the database on this first server. In order to use SSL, I can configure self-signed cert to protect communications between db servers in these 2 data centers.

AFAIK, if I force encryption on the instance, just encrypted connections are allowed, which is not what I need. or I need to separate this database into a separate instance just for this. I do not have a spare dev where to test this.

Can I enable SSL encryption that will be used by the remote server only, while regular users will not use SSL on same instance?

Thank you,



SQL Agent Schedule

$
0
0

I have many SQL Server Agents Jobs. Many were scheduled at the same time. Say 1:00 am. In the schedule lists they are duplicates. I want to delete most of them and just keep one and then I want those Agent jobs to share the schedule if these jobs are going be scheduled at that time.

How can I delete these schedules? Thanks.

SQL Server 2017 Error 926

$
0
0

Hi there,

I am getting following error msg : 

Database 'msdb' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information. (Microsoft SQL Server, Error: 926)

Please help me to resolve the issue.

Tried already starting & stopping the service but no Luck.

Regards,

TFS Queries

Random performance on SQL Server 2017 when running the same view during the day

$
0
0

We have an SQL view extracting fixed data during the day which runs in 3mn with 4'000 records even after updating index and after half an hour or less it produces the same results in 1 sec. The performance difference seems not linked to the load of the server. The server is a VM under VM Ware running Windows 2012 R2 Standard with 48 GB memory and SQL Server 2017 14.0.3035.2.

The VM Ware team has applied physical processes to that Server. The doubt comes from the SQL engine or the VM.



TSQL Query

$
0
0
Hi All,

Table Name: Audit
Column name: CreatedON datetime

I am looking way to find the count of records that are created in every 30 minutes based on CreatedON column. At the end of the day i will run T-SQL select script and I need output like below.

Case_Count                CreatedON
10                               12/12/2018 9:00:00
12                               12/12/2018 9:30:00
18                                12/12/2018 10:00:00
.
.
.
.
200                          12/12/2018 23:30:00

Can help me how to accomplish above task using T-SQL script.

Thanks in advance.

SQL error 5171

$
0
0
I'm getting an error while operating the SQL server. It displays as SQL server error 5171. I'm not able to resolve this error. Please, somebody, help me get out of this.

Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgment

$
0
0

Hi,

I am able to connect SQL server till yesterday. But today I am unable to login into SQL server.

Didn't changed anything.

SQL 2012 SP1

Thanks,

Ramaraju

Automatically connect to multiple DB Engines when opening Management Studio

$
0
0

Every time I open SQL Mgmt Studio, I am required to manually connect to each of the server I used daily.

 

Is there a way to configure Mgmt Studio to automatically connect to the server I use all the time rather than having to reconnect every time I open Mgmt Studio?

 

Any help will be GREATLY appreciated.

 

Query Store Blocking

$
0
0

I am seeing blocking on my database caused by these two processes:

Excerpt from sp_who2

20   BACKGROUND                   sa  .  .CMSQUERY STORE ASYN78012/12 11:22:15                                             20   0    

127  BACKGROUND                   sa  .20   CMSQUERY STORE BACK116852296136205012/10 22:58:09                                             127  0    

Has any body else experienced this and have a solution ? This is preventing the transaction log cleanup on the database.

Thank you

Ajay


AJAY

Viewing all 15889 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>