Quantcast
Channel: SQL Server Database Engine forum
Viewing all 15930 articles
Browse latest View live

Memory Management for Multiple Instances on a Cluster

$
0
0


I am looking  for recommendations for configuring memory settings for  Three  instances of SQL running on a Two server Failover Cluster. ( SQL 2012)

 

Scenario

Hardware: 32 Logical, 16 Physical Cores, 64GB RAM

Server: 1, 2

SQL Instance: A, B, C

  

I want to ensure enough memory is available to the OS, even when all SQL Server instances are running on 1 node. (This not the normal behavior, but will get us by while the other node is offline).

I could configure Max Memory on each SQL Instance so that when in this scenario the OS has at least 4GB*

For example: SQL Instance A gets 32GB RAM,  B gets 16GB, C gets 12GB, leaving 4GB available to OS.
(assume that the memory allocations are balanced for each instance's workload)

 

However, when instances are running on different servers, I want the instances on that server to use as much of

the available RAM  as needed (still leaving at least 4GB for the OS). 

For Example:  A is running on server 1, B & C are running on server 2

The memory allocation could be:  Server 1) A gets 60GB ,  Server 2) B gets 32GB, C gets 28GB

(leaving 4GB available to OS on each server)

Looking at the documentation:

"When you are running multiple instances of the Database Engine, there are three approaches you can use to manage memory:

  • Use max server memory to control memory usage. Establish maximum settings for each instance, being careful that the total allowance is not more than the total physical memory on your machine. You might want to give each instance memory proportional to its expected workload or database size. This approach has the advantage that when new processes or instances start up, free memory will be available to them immediately. The drawback is that if you are not running all of the instances, none of the running instances will be able to utilize the remaining free memory.

 

  • Use min server memory to control memory usage. Establish minimum settings for each instance, so that the sum of these minimums is 1-2 GB less than the total physical memory on your machine. Again, you may establish these minimums proportionately to the expected load of that instance. This approach has the advantage that if not all instances are running at the same time, the ones that are running can use the remaining free memory. This approach is also useful when there is another memory-intensive process on the computer, since it would insure that SQL Server would at least get a reasonable amount of memory. The drawback is that when a new instance (or any other process) starts, it may take some time for the running instances to release memory, especially if they must write modified pages back to their databases to do so."

It appears this is recommending just setting the Min server memory and not setting a Max limit.

However the article also states that

"SQL Server is not guaranteed to allocate the amount of memory specified in min server memory. If the load on the server never requires allocating the amount of memory specified in min server memory, SQL Server will run with less memory."

 

Which means that even though a min memory is set, it is not going to force it to grab that much memory on start up.
Also, from my experience with SQL 2008R2 it tends to be greedy with memory. Left unbounded it with leave very little available for the OS.

 

A Potential Solution:

Create a SQL Job that runs on startup of each of the SQL Server  instances.

This job would start jobs on each of the SQL Server instances including itself,  that determines the server  the instance is currently running on and which other instances are also running on that server, then set its max memory setting for that scenario.

 

I am not sure the best way to do each of those steps yet, but before I pursue that solution, I wanted to see if there are better options out there.

 

Thanks,

 

I am basing my 4GB memory available to the OS on this article

(I tried to link to the documentation I was referencing but it will not allow be to post links).


Windows 2008R2 SP1 and SQL2008R2 RTM and Numa and Hyperthreading and Maxdop

$
0
0

Hi,

I have read the advice about maxdop and numa but I am still confused if you have hyperthreading. We have an HP DL380 G7 that has 2 sockets with 6 hyperthreaded cores on each that are split into 2 numa groups. So SQL sees 24 cpus. According to KB articles I see that for our OLTP system we should not set maxdop to higher than the number of cores ina numa group. We currently have maxdop set to 8 as this is a recommended setting for OLTP on a server with more than 8 cores. With our situation should this be set to 6 because thats how many hyperthreaded cores we have in each node?

Thanks

Chris

 

SQL Server 2008 crashing with high probability on long running querys and index creations

$
0
0
Specs:

Microsoft SQL Server Enterprise Edition (64-bit)
Microsoft Windows NT 5.2 (3790)
NT x64
10.0.1600.22

5 databases, largest about 4GB. Total size 5GB.

SQL server is crashign with about 1/4 probabilty on index creation or long runnign queries (minutes). The database is dbcc checkdb error free. The error logs are:

Date,Source,Severity,Message
08/17/2009 15:40:23,spid110,Unknown,There is insufficient system memory in resource pool 'default' to run this query.
08/17/2009 15:40:23,spid110,Unknown,Error: 701<c/> Severity: 17<c/> State: 123.
08/17/2009 15:40:22,spid89,Unknown,There is insufficient system memory in resource pool 'default' to run this query.
08/17/2009 15:40:22,spid89,Unknown,Error: 701<c/> Severity: 17<c/> State: 123.
08/17/2009 15:40:22,spid60,Unknown,There is insufficient system memory in resource pool 'default' to run this query.
08/17/2009 15:40:22,spid60,Unknown,Error: 701<c/> Severity: 17<c/> State: 123.
08/17/2009 15:40:22,spid83,Unknown,There is insufficient system memory in resource pool 'default' to run this query.
08/17/2009 15:40:22,spid83,Unknown,Error: 701<c/> Severity: 17<c/> State: 123.
08/17/2009 15:40:22,spid107,Unknown,There is insufficient system memory in resource pool 'default' to run this query.
08/17/2009 15:40:22,spid107,Unknown,Error: 701<c/> Severity: 17<c/> State: 123.
08/17/2009 15:40:22,Server,Unknown,Server TCP provider has stopped listening on port [ 1434 ] due to a failure. Error: 0x2747<c/> state: 1. The server will automatically attempt to reestablish listening.
08/17/2009 15:40:22,Server,Unknown,Error: 26040<c/> Severity: 17<c/> State: 1.
08/17/2009 15:40:22,spid72,Unknown,There is insufficient system memory in resource pool 'default' to run this query.
08/17/2009 15:40:22,spid72,Unknown,Error: 701<c/> Severity: 17<c/> State: 123.
08/17/2009 15:40:22,spid72,Unknown,Failed Virtual Allocate Bytes: FAIL_VIRTUAL_RESERVE 65536
08/17/2009 15:40:21,spid20s,Unknown,UpdateUptimeRegKey: Operating system error 1450(failed to retrieve text for this error. Reason: 1815) encountered.
08/17/2009 15:40:21,spid20s,Unknown,Error: 17053<c/> Severity: 16<c/> State: 1.
08/17/2009 15:38:21,spid5s,Unknown,Warning: The available page file space has dropped below 4Mb.

(deleted many meaningless lines like:
08/17/2009 15:40:22,spid72,Unknown,CACHESTORE_XMLDBATTRIBUTE (node 0)               KB<nl/>---------------------------------------- ----------<nl/>VM Reserved                                       0<nl/>VM Committed                                      0<nl/>Locked Pages Allocated                            0<nl/>SM Reserved                                       0<nl/>SM Committed                                      0<nl/>SinglePage Allocator                              8<nl/>MultiPage Allocator                               0
)

how can i stop it from crashing.

Access SQL Server 2012 FileTable Share from non-domain computer

$
0
0

I've tried to find this out on my own but am hitting a couple of dead ends.  I'm excited for the opportunity to use a UNC path to a SQL Server FileTable that I've set up with non-transacted access set to Full.  Everything works great on the local SQL Server.  However, from a second server that is not part of the domain (and for which it would obviously have zero permissions), I would like to access that share.  Is there such a thing as an anonymous access to a FileTable's UNC share such that it doesn't prompt for a user login?  Note that providing the user credentials of a valid Windows (not SQL user) to the login prompt allows me to do everything I need to do with that share.  

I thought that perhaps the share would show up in the usual place on a Windows Server 2012 box but it does not.  The only evidence of the shares existence is when I type "net share" at the command prompt on the local server.  I tried tinkering with the Security settings on the Filestream's root folder to allow anonymous and everyone read-only access but that doesnt get me past the Windows login dialog prompt when trying to access that share from the second server.

Is this not possible with a non-domain server?  Would I just need to look at using a managed service domain account to set this all up and be forced to join that second server to the domain?

Thanks for your insight.


In-memory database in SQL Server ??

$
0
0

I am already ask this question on private news group but I am not satisfied with answers. I believe that I am not only one how recognize in-memory database potential. Current situation is that on market we can find really good solutions with this technology implemented.
Question? Is there any plan to implement in-memory database concept in SQL Server (some future versions)? Also any discussion on this topic is welcome

Thank you


Jasmin Azemovic PhD candidate , SQL Server MVP, MCT

Join tables that have data mixed in the columns

$
0
0

Hi everybody!

I need help of you to solve this problem:

I have three tables:

table1: id, name, class, type, case, SM, gac (124000 records)

table2: Gac, id, name, case, date (35000 records)

table 3: id, name, date (31000 records)

table 1table 2table 3

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

id: 250000id: 250000id:250000

name: tablename: NULLname: table

class: NULLclass: NULLclass: wood

type: gardentype: gardentype: NULL

in all the record in every table id match but, the columns have data mixed between the tables (someone inserted information selecting tables in random mode)

How can I join all the data in one table avoiding duplicated record and without loosing information, replacing the NULL spaces with data (if there is data in any of the tables)

thanks for the help

update statement deadlocks

$
0
0

We have a table.  It has lots of complex indexes with include fields.  We have an update statement.  It has two columns in the where clause.  It's in a short SP with a couple of other update statements.  The SP is only run from an interactive app a few times an hour, but still sometimes runs in a couple of sessions at the same time.  Our app calls the SP inside of a transaction, though that does not seem to be the issue.  The sessions are both read committed.  When it runs normally it runs in under a tenth of a second. 

In other words it's about as vanilla as it comes.

The same statement caused four deadlocks over two days.

The deadlock I have the most info on, each session was updating different rows, two rows in one session, one row in the other.  I presume the other deadlocks were very similar.

Looking at several discussions on this forum, apparently it is known that SQL Server has this ugly behavior.  To make a long story short, it seems that not even running serialized connections will avoid it.  Erland recommended to one person the use of an app lock:

http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/ef9217a9-0b7d-48ef-9a7e-5e9f710824f2

I can certainly slap one in here, but OMG do we have to do this with every update in the system?

FWIW this server is running SQL 2008 Standard 64bit SP1, four cores maxdop 1, under VMWare.  It has oodles of RAM and is generally lightly loaded.

Thanks,

Josh

Database curruption

$
0
0

Hi, 

CHECKDB found quite some errors on a database. The error messages are like:

Msg 8909, Level 16, State 1, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:3817323) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).

Msg 8909, Level 16, State 1, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:3817324) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).

Msg 8909, Level 16, State 1, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:3817325) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).

Msg 8909, Level 16, State 1, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown), page ID (1:3817326) contains an incorrect page ID in its page header. The PageId in the page header = (0:0).

To make things worse, I cannot find a good backup copy of the db. Any idea about repairing this would be greatly appreciated. 



Hi,

$
0
0
Can anybody let me know what is the main component used in database mail for sending mail to the operator  in sql when an alert rises? is it service broker or SMTP?

SQL 2012 CLR and XMLSerialaztion - Is UNSAFE still required for CLR's That Call Web Services

$
0
0

I'm learning to create a CLR assembly the "hard way" - Code the dll then use the Create Assembly T-SQL command.

In many of the 2005 and 2008 samples I've seen, there mention of using Sgen to create XMLSerialization code for dlls that call web services. Is the UNSAFE security switch still required in SQL 2012 for registering dlls that have separate XMLSerialization dlls created by the .Net Sgen component?


DJ Baby Anne's Biggest Fan................

set maxdop > # logical processors?

$
0
0
Is there a way to set maxdop to a value greater than the number of schedulers on the system?  I've got a VM with 4 vCPU that has a fairly low user concurrency but the queries that are run require lots of IO so the threads typically spend most of their time in IO wait.  There is a fairly large group of SSDs behind the LUNs for this VM and I'd like to be able to throw a lot more threads at it without having to allocate gobs of vCPU just to see the CPU utilization at 5%.

Alert Deadlocks on SQL server caused by SP Indexing Server

$
0
0

I'm far from a DBA, but I'm getting some alerts. Anybody seen these before?

Subject: SQLdm Alert (Warning) - A deadlock occurred on server SPSQLServer on SPSQLServer

3/29/2013 12:29:15 AM, Deadlock on SPSQLServer is Warning.

A deadlock occurred on server SPSQLServer .  Full details are available in the SQLdm Desktop Client.

The deadlock victim was spid 56 with application name 'Windows SharePoint Services' by user 'network\SPAdmin' on host 'SPIndexServer'. 

Last command issued:

Proc [Database Id = 30 Object Id = 1170103209]   

Deadlock: A deadlock occurred on the monitored server.  This alert requires the Query Monitor to be running.

Thanks,

Scott

Thread count increase monitoring (sys.dm_os_threads)

$
0
0

Hi,

I am monitoring the number of threads consumed by sqlservr.exe process. The thread count remains constant between 300-400 threads. Sometimes, I see that it jumps to 680+ threads and I am wondering what could be the reason for this increasing number of threads. I can see in sys.dm_os_threads that it creates around 300 threads in less than 1 second, but I do not find a way to follow up what created these threads. The thread count stays around 680 for 30 minutes. Then it goes back to 300 threads in some seconds. The database running on the server is an OLTP database that faces constant load in business hours between 07.00AM and 06.00PM. If the thread count increases, it is always in business hours. No maintenance jobs are running in that time. 

It happened this morning and it happened yesterday afternoon; before that, the threads remain constant for more than 2 weeks.

Server: SQL Server 2008 R2 (x64) Standard, SP2 installed

Does anyone have an idea, how to find out what is causing this thread increase?

Thanks,

Bernd



Keep Alive and Keep Alive Interval properties in SQL Server 2012

$
0
0

hi all,

Can anybodya explain "Keep Alive" and "Keep Alive Interval" properties in SQL Server 2012 database?

Are these propeties are useful keep uninterrupted connection from front end application (vb.net) to database even application is idle for long time?                                      

instances

$
0
0

Hi all,

what is the advantage of the multiple instances in ms sql server....?



Couple of questions

$
0
0

Hi All,

I have 3 questions. Some one kindly answer those.

1) If a table of size 50GB, having no indexes if we create an clustered index on that then what will be the size of that index?

2) If a table is published in replication and i want to modify one of the columns data type char(50) to Char(100). What is the procedure to do it?

3)To read the error logs from SQL server, we use XP_READERRORLOG apart from this any other query



The operating system returns error 665(The requested operation could not be completed due to a file system limitation)

$
0
0

During our weekly maintenance jobs for database integrity (DBCC CheckDB() ) I receive the following error when one of my DBs is getting checked.  I manually ran DBCC on the DB and it ran without error.

The environment here is a 150Gb DB the drive has 1500gb available for use, this a SAN drivethat disk fragmentation is low if none existent.  So, I am guessing that the DB snapshots itself to run this DBCC and then drops it and its causing some sort of space issue? Where would this snapshot be, TempDB or hiden somewhere by the SQL engine?

Adding configuration file in a job using command line option in the JOB Properties

$
0
0

Hi,

I need to add multiple configuration files to an SSIS Job using Command line option in the JOB Properties.

/File "C:\temp\Package.dtsx" /CONFIGFile "C:\temp\ssisoptions.dtsconfig"

the above method works for single configfile.

But i need to add multiple config files..how can this be done??

Resource database update time

$
0
0

Hi everybody,

I just queried Resource database update time on my SQL Server 2008 by using

SELECT SERVERPROPERTY('ResourceLastUpdateDateTime'); GO

and the result is

2012-06-28 10:36:40.883

I am a little confused as I use the system everyday. I created database, table, etc.... Can anybody help me to understand the meaning of ResourceLastUpdateDateTime? 

Thank you!

LogMgr::LogWriter: Operating system error 1117(The request could not be performed because of an I/O device error.) encountered.

$
0
0

SQL Server
Version: Microsoft SQL
Server 2012 (SP1) - 11.0.3000.0 (X64) Oct 19 2012 13:38:57 Copyright (c)
Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.2 <X64>
(Build 9200: )
<o:p></o:p>

Windows
Version: Windows
Server 2012 Standard
<o:p></o:p>

SQL Server
Installation: 5 node
active/active multi instance Failover Cluster
<o:p></o:p>

Problem statement:
We recently migrated to SQL Server 2012 on 5 node failover cluster. Just yesterday
(April 03 ,2013) we received twice the subjected error. SQL Server instance do
not allow any access to production database when subjected error occurs. After some
while start allowing access after performing DBCC checkdb (without errors). In addition
to above SQL Server error, we are also observing MPIO errors and warnings in
windows event log since March 08, 2013<o:p></o:p>

windows event log error and Warning

Warning: \Device\MPIODisk9
is currently in a degraded state. One or more paths have failed, though the
process is now complete.<o:p></o:p>

Error: Afail-over on \Device\MPIODisk9 occurred.<o:p></o:p>


Viewing all 15930 articles
Browse latest View live


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