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

Resource Reallocation

$
0
0

SQL Server process on DB Server is occupying almost 95% of the memory without any jobs or executing queries.

Unless and until the OS or process is restarted the memory space utilization is very high.

However, even after the process is restarted it again reaches to 95% with in 2-3 days.

I have also tried adjusting the value of 'Maximum Server memory' in 'Server properties' but could not help.

I doubt the memory allocated during the previous job executions are not recovered.

Can you help me how to recover the space without restarting the process?

Thank you.


Added RAM, now my CPU's are pegged

$
0
0

Good morning -

I've recently onboarded to a new project where one of the major complaints is application performance, which ties directly to SQL Server.  DB structure and query efficiency notwithstanding (trust me, I feel this is a multi-point problem), I'm simply trying to be sure the underlying hardware is positioned as well possible before challenging our dev team.

SQL was originally running in a VM with 4 CPU's, 8GB or RAM for an 80GB db.  I set up perfmon to gain some statistics to support some hardware changes.  I saw some numbers that indicated it's memory starved (which I knew without the stats, but needed them for justification) - so I had our datacenter increase the RAM to 64GB.  Now I see a very high buffer cache-hit ratio, which is good... but my CPU utilization has gone from near zero to > 90%.

So TL; DR - Is there a document that assists with determining how many CPU's a SQL Server should have?

--

I'm also adjusting some other settings, such as max deg of parallelism; and running queries to see the top cpu time offenders... etc.

Thanks.

What does it mean when DBCC LOGINFO returns many rows with status = 2 and DBCC OPENTRAN returns no active open transactions?

$
0
0
What does it mean when DBCC LOGINFO returns many rows with status = 2 and DBCC OPENTRAN returns no active open transactions? 

sql profiler - duration?!

$
0
0

Hi guys,

I was given a trace... and the captured information says that several queries ran for minutes (I know the value is in miliseconds).

I copy the query and execute it myself, and the query takes a few seconds... The only reasonable explanation I see, is blockings...

Do you guys can think of anything else?

Thanks!!

2012 SP 2 Issue

$
0
0

I have a warehouse that was running perfectly under 2012 SP1, it uses CDC with net enabled on the source tables to do incremental loads into the warehouse.

We migrated the databases over to a new SQL 2012 SP2 build (also later applied the hot fix for index rebuild), we are using SSIS and the CDC components for our integration.

So once we migrated a few of our tables were hanging on the CDC Source component beyond our timeout (around 10 minutes), typical CDC source time is 15 seconds.

I then tested the query output in the sis output in management studio and boom it works in under 15 seconds as expected,

I then did a Perlman on it and captured the real queries from SSIS, and the get_net_changes TVF call was wrapped in an sp_execute call, I copied it out and ran it in a SSMS window and it hangs, so I've eliminated everything but the query engine and how it behaves with sp_executesql, if I modify the sp_Executesql to include option (recompile) the sp_executesql for the TVF works in under 15 seconds as well.

Running a dbcc freeproccache just prior to running sp_executesql has no effect either.

What I'm believing is that either plan cache utilization or the plan being created is so horrid that the query never finishes, I've let ssms run for over 30 minutes and still not got a plan back.

Since I can't change the SSIS component to use option (recompile) nor is option recompile valid in a TVF (inline) as they are currently written, I'm more concerned that the behavior is the sign of a larger problem in the optimizer with SP2.

Any guidance in resolving this would be appreciated, at the moment we are considering downgrading the new box to SP1.

Additional information:

Tables giving us trouble are fairly wide, have fairly large PK (from a JDE system), and are fairly high volume change wise, if there are no records or very low records in the CT tables then the functions still perform fast, they also perform as expected when using the ALL instead of Net option.

Thanks

John


John Gooding

Terrible Performance of SQL Server Linked Server query over WAN

$
0
0

I have recently been testing performance of trying to access data over a linked server connection between SQL server databases over a WAN link. The distances are quite large.. between Sydney Australia, and London UK.

I have tested the through put when performing a simple select statement, over SSMS connected to the remote server and then via the linked server connection. I have also simulated the same data transfer via SSIS packages with a simple datapump.

For a detailed discussion of my findings you can read about it on my blog post here, Terrible Performance of SQL Server Linked Server query over WAN

The Linked server connection is terrible with its throughput capped at no more than 0.22Mbps, according to wireshark traces.

In short I found

1. A linked server connection based directly on SQL Native Client, "Microsoft OLEDB provider for SQL Server" performed terribly across the WAN with approx 300ms latency.

2. I found that things improved dramatically when I created a "System DSN" (using either native client or ODBC Driver 11 for SQL Server) and used "Microsoft OLEDB provider for ODBC Drivers" to create the linked server. 

The throughput increased to about an average of 3Mbps and peaked at over 6mbps (on my home ADSL2+ connection).
I repated this test at work on a dedicated WAN link and the same test went from a max of 0.4Mbps on the SQLNCLI Linked server to a peak 26Mbps on the ODBC System DSN linked sever version!!

What I would like to know is why the SQL Native Client is so terrible?

Is this a bug?

Are there any problems with using the System DSN and ODBC Linked server?


Can't connect to sql instance from laptop SSMS but can connect from different servers via RDP

$
0
0

I am pretty sure there is a firewall etc. issue going on , here is what I am seeing:

While i am RDP'ed to different database servers, I can use their SSMS & I can connect to the sql instance in question. So, connecting to the instance from RDP is not a problem. The issue which I am seeing is that I cannot connect to the instance via SSMS on my local machine. Anyone else in the company can also not access that instance from their local laptop SSMS.

--

SSMS Error Message:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

--

The firewall is open on the database server for the TCP port of sql. I have tried various sqlinstance name combinations (like using ip address, port # etc) - nogo.

Please let me know, i think it is something for our windows OS sys admins to look into, but before I approach them let me know if I am missing something. Thanks!


D








memory usage

$
0
0

Dear all,

Can we know the memory usage, CPU, I/O used by sql server and sqlagent for past 3 months without setting windows performance counter? (for sql server 2014 and windows server 2012) Thx a lot

Thanks and regards,
Wallace



SQL Server Total Memory used and free & CPU Utilization

$
0
0

Hi Friends,

Please help me I saw lot of script over internet but useless , as I am searching for query to find total memory allocated to sqlserver,  and how much being used utilized as wel cpu utilization percentage . 

thank you.


asad

Can't restore - SQL Server 2012 thinks I am out of space

$
0
0

Our vCloud setup is a little odd, in that D: is a very small physical drive with virtual directory links to D:\SQL Data and D:\SQL Logs, each of which reside on much larger separate volumes (don't ask me why).

The result is that even though D:\SQL Data has beaucoups of empty space on it, D:\ only has a few hundred MB free.

All of which brings me to my problem.  I go to restore a database, foobar.bak, but I get an error because rather than looking at how much free space I have on D:\SQL Data, it's looking at how much free space I have on D:\ .

Is there a way I can configure it to look at the available space in the actual target folder D:\SQL Data, rather than the parent directory D:\?


PBS

Cannot Connect to Remote Named Instance of SQL Server

$
0
0

We have 3x instances of SQL Server 2012 installed on a single remote server - there's the default MSSQLSERVER instance, then \INSTANCE01 and \INSTANCE02. I can remotely connect to the default MSSQLSERVER instance through SSMS, but I cannot connect to either of the additional named instances (\INSTANCE01 or \INSTANCE02). 


For example, if I try to connect to "sql.domain.com", I can successfully access the default instance on the remote server. If I try to connect to "sql.domain.com\INSTANCE01", I get an error stating"A network-related or instance-specific error occurred while establishing a connection to SQL Server".HOWEVER - if I try to connect to "sql.domain.com\INSTANCE01, 49301" (where 49301 is the TCP Port for the TCP/IP Protocol for this SQL Server instance), I am able to successfully connect.


This leads me to think that there's a communication issue with the SQL Server Browser service running on the remote SQL Server and my workstation. 


The following items have been verified:

  1. SQL Server Browser is running on the remote SQL Server
  2. Windows Firewall has been disabled on the SQL Server
  3. TCP Ports 1433, 1434, 1954, and 49301 have been opened up on the remote destination's firewall
  4. UDP Port 1434 has been opened up on the remote destination's firewall


Thoughts? Did I miss something?


Always On New Availability Group - Full backup is required

$
0
0

Just trying to create a New Availability Group for AlwaysOn , I see the database is listed, in the status it says: "Full backup is Required. The database is AdventureWorks2012, i have taken a full backup, but still see the message. I did an attach using .mdf/ldf files for this db, it is full mode.

Created a test db and did a full backup, this shows up ok as "meets prerequisites". Just curious what wrong with the AdventureWorks2012 db from MS.


Ranga

Updating SQL DB fields with multiple target records

$
0
0

Hi,

I am trying to multiple update records in Table B from a single record in Table A.  To identify the records that need to be updated I used this:

Select

Table1.cfirstnameas'Table 1 First',Table1.clastnameas'Table 1 Last',Table1.ifamilyid,CR.icontactid,CR.lLiveswithStudent,


Table2.cfirstnameas'Table 2 First',Table2.cLastNameas'Table 2 Last',Table2.ilocationidas'Table 2 Location',Table1.iLocationIDas'Table 1 Location'


fromTable1

JoinTable3CRonTable1.istudentid=CR.istudentid

JoinTable2onCR.icontactid=Table2.iContactID


whereCR.lLivesWithStudent=1andTable1.ifamilyid>0andTable1.ilocationid<>Table2.iLocationIDandTable1.lCurrent=1

I need to update the ilocationid from Table 1 to all Table 2 records related to Table 1but there is no direct relation from Table 1 to Table 2.  I needed Table 3 to make the connection from Table 1 to 2

Thank you

How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?

$
0
0

How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?

Let's say the SQL Server and Oracle Database are in the same Company Internet Network.

I have the code, but I do not know how to use it. Such as what is System DSN Name? Where could I get it. What does it look like?

Do I need to install any Oracle Client Software in order to link from SQL Server to Oracle? Or SQL Server has the built-in drivers installed already that I can directly create a Linked Server from SQL Server to Oracle?

I need to know details. Thanks.

USE master
go

EXEC sp_addlinkedserver
     @server  = '{Linked Server Name}'
    ,@srvproduct = '{System DSN Name}'
    ,@provider  = 'MSDASQL'
    ,@datasrc  = '{System DSN Name}'

EXEC sp_addlinkedsrvlogin
     @rmtsrvname = '{Linked Server Name}'
    ,@useself  = 'False'
    ,@locallogin = NULL
    ,@rmtuser  = '{Oracle User Name}'
    ,@rmtpassword = '{Oracle User Password}'


High Disc Write latencies on 3 servers simultaneously

$
0
0

Hello,

I would like to share an issue which is bothering our company's environment. We have a SQL Sentry monitoring tool (freshly set-up), and we're currently monitoring 5 instances on 4 servers.

3 servers are virtual (Windows 2012), 1 SQL Server 2012 and two SQL Server 2008 - only these 3 are suffering from the issue
1 server is physical (Windows 2008), SQL Server 2008

All servers share the same SAN.

For some reason, I am getting alerted on High Disk latencies on 3 of the servers once a day in exactly the same time on all 3 of virtual servers them. 

Here is a shot from SQL Sentry dashboard:



And here a shot from Disk Activity screen for the same period:

As you can see, there is a significant activite in TempDB log and also outside of the SQL Server datafiles (the white "Other" file).

However when I inspect TopSQL queries, I can see none with such write activity. I even ran a quicktrace during the period, and I still haven't found anything with comparable numbers in terms of writes.

Maybe I am missing something, does anyone have any ideas? The fact that it happens simultaneously on all 3 servers once per day (usually between 7:50 to 8:15, this slightly varies, but its always the same across all 3 servers on a given day), would suggest that it might be something in a SAN, but I want to be 100% sure its not inside SQL Server before I run to my SAN admin.

I did pose a general question "are you running something significant in SAN during that period" before, and answer was negative.

Many thanks for any hints on how to solve this mystery of mine.






Msql installation sucessfuly, Sql running sucessfully ,I want change server network ip ,what will impact ?

$
0
0
I have mssql 2008 enterprise 2008 r2 edition, Some reason i want change network ip.Any suggestion ?

Timeout when remote debugging

$
0
0

Hi, 

I'm trying to debug stored procedures on a 2008R2 instance from SSMS 2014 but I'm getting a timeout error after setting a breakpoint and pressing F11. 

On the server/instance I'm connect to I've checked the Windows firewall and it does not appear to be blocking within the domain, in fact the Windows firewall is off.  I've checked with systems team and no other firewalls are in operation (they think). 

I can execute procedures on this server from SSMS no problems, just not debug them.  Does the debugger use a different port? 

I've followed this example to configure the Firewall using this link

Any ideas. 


Linked server set in Cluster Environment

$
0
0

Need to set up a linked server in two node SQL Cluster pointing to a standalone SQL thru security setting "be made using current login's security context". It's double hop Kerberos setup. Cluster uses a domain account, so we manually set SPNs for that account with both instance name and protocol as well (set up these SPNs with SQL virtual name only). Also, constrained delegation has been  set to that stand alone SQL services (MSSQLSvc).

Both SQL cluster and standalone servers are in same domain, cluster service account is domain account and standalone SQL uses default SQL local service account.

Coming to SQL, when I create linked server, sometimes it lets me create without issues and sometime it throws this below warning and even if I create it won't work.

 Login failed for user 'NT AUTHORITY/ANANOMOUS LOGIN'.  Need help. thanks. Prabhu


Prabhu Boggavarapu

User created with FOR LOGIN and login does not exist?

$
0
0

I hope my question is clear.  For testing I made a group in Active Directory named MyDatabaseReadOnly with one user as a member.  Ido not have a login in SQL Server by the same name.  I created a database user with the following script.

USE [MyDatabase]
GO

CREATE USER [MyDatabaseExec] FOR LOGIN [MyDomain\MyDatabaseReadOnly]
GO

The script created the user MyDatabaseExec in MyDatabase.  I gave the user MyDatabaseExec permission to execute one stored procedure.  I then logged in as the lone member of the MyDatabaseReadOnly group and was able to execute the stored procedure in SSMS.

How does this work since there is no login MyDomain\MyDatabaseReadOnly? I understand (I think) that you can create database userswithout a login but I don't understand how I'm able to run the proc.


Kevin


Need a query/function to handle subsidiaries in a company tree

$
0
0

Hi, not sure this is the right forum category but here you go:

I have a holding tree with more than 200 companies, and several layers. Each company is defined by:

- a unique ID

- a direct parent ID --> the company immediately above in the tree

- an ultimate parent ID --> the company that owns the entire tree, it is the same for all

Now I am looking for a function that returns the list of all companies below a given one in the tree, and there could be several layers underneath. Doing that for the ultimate parent is easy because all companies now who their ultimate parent is, but I am struggling to build a function that works for an intermediary parent in a dynamic way.

I am sure I am not the first one trying to solve this problem ;-)


Thanks for your tips.

Viewing all 15264 articles
Browse latest View live


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