Quantcast
Channel: SQL Server Manageability forum
Viewing all 1519 articles
Browse latest View live

SQL Server 2016 memory pressure response flushing plan cache

$
0
0

I posted this in the connect feedback yesterday, but it might be useful here as well. There is a recent similar post, but my thoughts are in a different direction.

The specific situation details are as follows. SQL Server 2016 EE RTM+cu2 build 2164. On Windows Server 2012 R2 Standard Edition. Hardware is HP ProLiant DL380 Gen9 2-socket 18-cores per socket Xeon E5-2699 v3, 2.3GHz, HT disabled (36 physical core and 36 logical processors total), no VM. System memory is 512GB, SQL Server Max memory is 494GB (506,000MB), 20GB page file. LPIM is set. Storage is All-Flash, local PCI-E SSDs. Environment does use availability groups with 2 local nodes and 1 DR node.

Typical operating conditions are SQL Server at or near target memory (489 of 494GB), OS has 9GB available physical memory, 25GB available page file (implying 4GB of page file in use?). There is very low disk IO to the data files even during full transaction load periods. The plan cache is 14GB, well under the 75% of first 4GB, 10% of 4-64GB and 5% of memory over 64GB limit, will works out to just over 30GB. The plan cache split is about 3.5GB Adhoc, 7.6GB prepared (probably from Entity-Framework parameterized SQL) and 3.2GB procedures. Most of the Adhoc SQL plans (90%) are single use, more than half of prepared plan (57%) are single use. Only a tiny fraction of procedure plans are single use.

Virtual address space reserved is 2.4TB after SQL Server has been running 60-70 days, but growth appears to be in spurts, not steady. VAS committed is never observed at more than 496GB. There are no home growth CLRs, but there is infrequent light use of spatial geography STDistance function. Most EF calls specific a network packet size of 4096 or 8000 bytes, but there might be infrequent older .Net Framework clients that do not specify network packet size, hence defaulting to 8192 bytes. Does anything else make direct OS VAS allocations instead of using the buffer pool?

Whatever is the source of the VAS reserved (over permanent allocated to the buffer pool) it is probably short lived, hence the VAS committed has not been observed to be above 496GB.

On Microsoft web site, it is stated that when operations need to make memory allocation via the OS VAS while SQL Server is at the target memory limit, it will allow this, temporary exceeding the specified memory limit, then gradually release memory elsewhere.

The problem experienced is intermittent occasions when the plan cache is forced down for unknown reasons, getting as lows as 100MB. This results in a majority of queries requiring a compile, greatly increasing system overall CPU (from 20-30% to near 100%?) as many procedures involve complex SQL. An even worse occurrence is compiles being block. Perhaps whatever the memory pressure that caused this results in SQL Server taking a lock on the entire plan cache to force out plans?

It is not certain, but suspected that SQL Server did not flush out data pages from the buffer cache. The 14GB of plan cache flushed by the memory pressure event had severe negative consequences. It is thought the flushing out 14GB of data pages probably would only resulted in a minor increase in disk IO, and even that would be far below what the Flash storage could have supported. Also, just flushing the single use Adhoc and prepared plans would have reduced plan cache by 50% (7GB) with probably minor impact.

The question is: what is the SQL Server internal strategy for responding to memory pressure. Does it automatically flush plan cache? Which would not be a good choice. Does it also consider whether to flush data pages? In this particular case with disk IO normally being low, and storage on all-flash, it would be my preferred course of action. 


jchang




SSMS adding Role to SSRS

$
0
0

I am using SSMS v17.7 and when I am connected to a Reporting Services instance I can add a Role but SSMS crashes afterwards. The Role does get created and with all privileges I assigned but SSMS crashes and restarts.

Where should I be positing SSMS Bug/Features?

TIA,

Andrew

SQL System DB movements in sql 2016 which is configured for Allways on

$
0
0

Hi

I have an sql 2016 setup in which Allwyas on is configured . 

we have plans to move the system DB's in primary server , where it is presently located in C drive  to another drive. 

i need your  pointers to  perform this activity . Is there any pointers we need to focus since its configured in allways on. 

or is it same as that of an stand alone system , in which we move the system db's 


hemadri

SQL Server 2017 Linux backup to URL

$
0
0

I've setup SQL Server 2017 on Ubuntu and everything seems to be working ok, with the exception of backups to Azure blob. I create a credential in Sql Server, then try to do a backup to URL, and I get the following error:

Msg 3292, Level 16, State 6, Line 1
A failure occurred while attempting to execute Backup or Restore with a URL device specified. Consult the operating system error log for details.
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

When I check my server logs, I see this:

2018-07-03 11:04:03.66 Backup      Error: 3041, Severity: 16, State: 1.
2018-07-03 11:04:03.66 Backup      BACKUP failed to complete the command BACKUP DATABASE MyTestDatabase. Check the backup application log for detailed messages.

When I run through the exact same steps on my local db (on Windows), it runs just fine.


You are not database owner or system administrator

$
0
0

Hi,

Customers complain regularly that this message appears when they for example create a table: "you are not logged on as the database owner or system administrator". The warning is actually correct, they are not db_owner, they have db_writer, db_reader and db_ddladmin. 

This issue is already known for years: https://connect.microsoft.com/SQLServer/feedback/details/467582/db-ddladmin-role-doesnt-allow-use-of-design-functions-in-ssms and Microsoft appears to do nothing at all.

Is there any workaround?

I tried the suggested workaround to grant VIEW DEFINITION, but it doesn't solve it. It is a hosted environment and we don't want users to be able to change quota settings. This is the primary reason we don't give them DB_OWNER rights. As it are all contained databases they already are limited to their own database, so granted them DB_OWNER would not be as harmfull (we think).

Is there a way to avoid a dbowner to change quota settings? Or is there another workaround know the get around those annoying warnings? I would doubt it as also large hosting companies as GoDaddy appear to have the issue...

The version we are using is 12.0.4449.0 (SQL 2014 SP 1 CU6).

Thanks!

Non Unique Non Clustered Index storing Cluster Key in the Includes

$
0
0

Fellow SQLers,

I ran into an alternate index on a clustered table. Looks like the developer added the cluster key to the include. I know that was not necessary in that the cluster key is carried under the covers of the index.

Is it correct that SQL ignores that field if it is in the Includes?

So far a test I did on a test-table showed the index size did not increase if I added the key to the Include.

Can someone cofirm this?

Thx
MG

Reg. sql user permission .

$
0
0

Is there any way to not to allow a “SQL user” to drop object or truncate table  but user should still be able to alter SP, sp_helptext, take profiler output and debug etc.


hemadri

SQL Server is not releasing the space occupied in memory tables in RAM

$
0
0

Hi

I am using sql 2016 & in which i use the in memory table features. The purpose of the table is to add few rows in the run time and then clear the same once the entire process is completed. The approximate no of rows which it loads during the process is around 20K rows. 

Actually speaking , it is not releasing the space occupied once the transanction is done . 

what should i do to ensure that the memory tables releases the space once the transanction is done . I have even included delete command at least to ensure that there are no records in the memory table, but the space is still not released. 

suggest me the right way please. 


hemadri


How to rectify .mdmp dump issue in MS SQL 2008 R2

$
0
0

Hi,

We are facing issue related to .mdmp dump file and its consuming all space in the drive. We have multiple drives for logs, db etc.

Need assistance. We are using MS SQL Server 2008 R2 edition on Windows 2008 Server with 8 GB RAM.

Regards,

Vinoth Kumar.

SQL Server 2012 Management - MenuBar are not displayed

$
0
0

SQL Server 2012 Express with tools on Windows 10 running .NET 4.7

After starting it, all of the Menu System is not displayed, but it's like they are hidden...

I can click on where they should be and then that Menu Bull-down will display..

See image below...

SSMS On Workstation

$
0
0

So i finally got a simple 2 node WFC cluster up and a 2 node SQL cluster configured. I would like to install SSMS 17.8.1 on a laptop and connect to the DB engine. Windows integrated auth was chosen during SQL installation. I get the following error when using SSMS from a laptop to connect to the SQL cluster DB engine with windows auth:

I have set remote connections to true, in ssms connection tab has trust cert checked, and enabled TCP on both nodes. I can ping the servers and the virtual object and i have windows firewall turned off on both nodes.

https://docs.microsoft.com/en-us/sql/database-engine/install-windows/configure-sql-server-on-a-server-core-installation?view=sql-server-2017#BKMK_ConfigureRemoteAccess

Maybe i need to give the user access on the SQL servers? I know at least 1 user name i tried has access when ssms is installed on the SQL servers


SQL Server Agent on Public Shared Server

$
0
0

Hello,

         How Can we use SQL Server Agent to Schedule Jobs on Public Shared On-Premises Server , where there is no direct access of Agent provided with the Database.

Thanks

SQL SERVER AGENT DASHBOARD and Monitoring system

$
0
0

Hi

we are shopping around for a SQL SERVER management system where users that are not familiar with SQL can monitor Jobs and Job steps. Users will be able to see when a job failed and restart the job (if allowed) or call DBAs if needed based on instructions.

does anybody know of such a tool that would help operations peform their job?

thanks

eddy


eddy.a

Management Studio frame construction issue

$
0
0

n exception was encountered while constructing the content of this frame.  This information is also logged in "C:\Users\me\AppData\Roaming\Microsoft\AppEnv\14.0\ActivityLog1.xml".

Exception details:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

I have two systems that I have tried to get Management Studio 2014, 2016 and 17 working.  I keep getting the frame construction error.

I originally had this issue on my old workstation, so I waited till now when I got a new workstation to try and install it again and I get the same error.

I have tried to uninstall and reinstall SSMS in all the versions listed.

I have uninstalled Visual Studio 2012 and BIDS 2012 and then reinstalled and I still get the same error.

The xml error log says

<record>100</record><time>2017/05/11 16:49:18.753</time><type>Error</type><source>VisualStudio</source><description>Construction of frame content failed.&#x000D;&#x000A;Frame identifier: ST:0:0:{53544c4d-5c18-11d3-ab71-0050040ae094}&#x000D;&#x000A;Frame caption: &#x000D;&#x000A;Exception details:&#x000D;&#x000A;System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid&amp; packageGuid, Int32 reason, Guid&amp; context)&#x000D;&#x000A; at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()&#x000D;&#x000A; at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()</description></entry></activity>

I notice on Connect that the issue is active but unresolved there too..

Thanks for your help.

having an error launching SSMS - registration service not found

$
0
0

Trying to launch SSM 2016 or 2017 version, i receive the following error. Have checked the requirement for .net, vc++ and all criteria is met

TITLE: Microsoft SQL Server Management Studio

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

Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)

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

BUTTONS:

OK

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

Please advise 


Determine Plan Execuction counts

$
0
0

Fellow SQLers,

So, lets say we have a simple paramertized prepared sql statment - not an sp.

There are a number of dmvs I used to determine usage, counts, etc for reviewing poor performing queries.

Two of them are:

sys.dm_exec_query_stats - which has a field "execution_counts" which BOL indicates is "Number of times that the plan has been executed since it was last compiled."

sys.dm_exec_cached_plans - which has a field "usecounts" which BOL indicates is "Number of times this cache object has been used since its inception.

Obviously the big difference is the definition.

I have come across a scenario where the usecount is 112 and the execution count is 1.

The query is something like this:

select count(1) from V_customer

where  (  ( status1 = @P1 )

AND (changed_date >= @P2 and changed_date < @P3 ) AND (proj = @P4 )  )                                 

Why would the numeric differnce occur?  Am I incorrect to interpret that the cached object in the definition for  usecounts is the plan?

thanks 
MG



Error accessing xp_msver in SQL Server 2016

$
0
0

Hi, we're having an issue when attempting to manage properties for SQL Server.  The scenario is as follows:

1. Two servers in a cluster (using AOAG) - let's call them server 001 (primary) and 002 (secondary).

2. RDP into server 002 and launch SSMS - make connections in object explorer to server 001 and 002 as a sysadmin user (windows auth or SQL auth - we tried both).

3. Right-click on server 001 and select properties - properties dialog opens fine.

4. Right-click on server 002 and select properties - receive an error regarding a transaction failure.

5. I ran a profiler trace and found that the properties dialog was failing on a call to extended proc xp_msver.

6. I then ran 'exec xp_msver' in a query window and received the following error:

            Error in running xp_msver: Load resource string failed

7. Next, I tried the same thing in a query window for server 001 and it produced a results grid table with all the server properties.

I have exhausted google searches looking for a possible solution / explanation for this behavior.  Does anyone have a clue?

thanks,

pete

SQL Server 2012 Service Pack Upgrade

$
0
0

Dear Sir,

My database is running to SQL Server 2012 SP2. I want to upgrade it to SP4. Can I go it directly from SP2 to SP4.

Or first I need to upgrade it to SP3. Please Confirm.

Regards,

Deepak

Need Script for SQL Instance when services down or restart

$
0
0

Hi ,

I need your help for SQL Instance down i should get mail for when restart the service or stop get the alert.

Please help me to get batch or power shell script.

when server/service down should get alert.

Thanks in Advance

Vijay



SQL Server 2017 Configuration Manager throwing Error message "Cannot connect to WMI provider. You do not have permission or the server is unreachable.

$
0
0

Hi,

I just installed Microsoft SQL Server Management Studio 2017. When I try to open "SQL Server 2017 Configuration Manager" service I am getting the following error message.

"Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. Invalid namespace [0x8004100e]".

I tried the steps mentioned at -- https://support.microsoft.com/en-in/help/956013/error-message-when-you-open-sql-server-configuration-manager-in-sql-se

I opened command Prompt in "Run as Administrator" mode, then I executed the statement --mofcomp "C:\Program Files (x86)\Microsoft SQL Server\140\Shared\sqlmgmproviderxpsp2up.mof".

The following is the output I got.

==============================================================

Microsoft (R) MOF Compiler Version 6.1.7600.16385
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.

usage: mofcomp [-check] [-N:<Path>]
               [-class:updateonly|-class:createonly]
               [-instance:updateonly|-instance:createonly]
               [-B:<filename>] [-P:<Password>] [-U:<UserName>]
               [-A:<Authority>] [-WMI] [-AUTORECOVER]
               [-MOF:<path>] [-MFL:<path>] [-AMENDMENT:<Locale>]
               [-ER:<ResourceName>] [-L:<ResourceLocale>]
               <MOF filename>

   -check                    Syntax check only
   -N:<path>                 Load into this namespace by default
   -class:updateonly         Do not create new classes
   -class:safeupdate         Update unless conflicts exist
   -class:forceupdate        Update resolving conflicts if possible
   -class:createonly         Do not change existing classes
   -instance:updateonly      Do not create new instances
   -instance:createonly      Do not change existing instances
   -U:<UserName>             User Name
   -P:<Password>             Login password
   -A:<Authority>            Example: NTLMDOMAIN:Domain
   -B:<destination filename> Creates a binary MOF file, does not add to DB
   -WMI                      Do Windows Driver Model (WDM) checks, requires -B s
witch
   -AUTORECOVER              Adds MOF to list of files compiled during DB recove
ry
   -Amendment:<LOCALE>       splits MOF into language neutral and specific versi
ons
                             where locale is of the form "MS_4??"
   -MOF:<path>               name of the language neutral output
   -MFL:<path>               name of the language specific output
   -ER:<ResourceName>        extracts binary mof from named resource
   -L:<ResourceLocale>       optional specific locale number when using -ER swit
ch

   Example c:>mofcomp -N:root\default yourmof.mof

===============================================================

After this is tried to open "SQL Server 2017 Configuration Manager", but now alsoI am getting the same error message.

Please help me to resolve this error.


Viewing all 1519 articles
Browse latest View live


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