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

Management Data Warehouse question on Query Statistics.

$
0
0

Greetings. I know that by default this tool has a built in algorithm to show only the worst performing queries for each snapshot collected. However, I'm not sure I want to use that default collected info. What I'd really like is to collect/ upload all queries taking >= X seconds, depending on the server.

Questions:

  1. Is there a way to modify the default Query Stats Collection/ Upload? If so, how? I read a link that said not to, but am still curious.
  2. I know I can create a trace in Profiler and save it for a Custom Collection Set. What would be really cool is to then "link" that data to the other Collections from MDW in the Server Activity and Disk Usage tabs. I realize I could figure out the sprocs that are being called behind the scenes, and have them also query the snapshots.trace_data table where my Custom Collection Set info is retained. What I've looked for online, and been unable to find, is someone else that's already doing this. I really do't want to reinvent the wheel.

Thanks!

 

Thanks in advance! ChrisRDBA


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.

Truncation warning

$
0
0

I just execute a package and it took about 12 minutes which I didn't expected. when I look @ the report I found this.

DFt_Load_Tempa: Warning: Truncation may occur due to inserting data from data flow column "ac" with a length of 120 to database column "ac" with a length of 3.

is this may be one of the reason for the slow running package? Help me out.

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.

Issue with Full-Text (FTS) master merge on SQL Server 2012 SP2

$
0
0

Hi,

On my current project we have really annoying issue with master merge process that occurs after Full Population of FTS Index.

Let me describe our process: we have continuous build that setup environment and run unit tests after each commit in our source control. For each run we create new DB (on the same SQL Server) then fill it with test data and run unit tests. Sometimes unit tests failed because FTS Index population cannot finish in time.

We have constantly seeing in [sysprocesses] table lots of sessions with wait type FT_MASTER_MERGE that block our tests

In FTS log we have following error:

The master merge started at the end of the full crawl of table or indexed view [TABLENAME] failed with HRESULT = '0x80000049'. Database ID is '45', table id is 706101556, catalog ID: 5.

Here is an example of how we create FTS catalog and add table to it (As you can see it's created with auto change tracking together withindex update in background):

-- Create FTS catalog
EXEC sp_fulltext_catalog 'WilcoFTSCatalog', 'create'

EXEC sp_fulltext_table 'Users', 'create', 'WilcoFTSCatalog', 'PK_Users' EXEC sp_fulltext_column 'Users', 'UserId', 'add' EXEC sp_fulltext_column 'Users', 'Name', 'add' EXEC sp_fulltext_table 'Users', 'activate' EXEC sp_fulltext_table 'Users', 'start_change_tracking' EXEC sp_fulltext_table 'Users', 'start_background_updateindex'

Does anybody know what is the root cause of this issue and what should be done to avoid it?

Thank you in advance,

Olena Smoliak


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?


Licensing of a Test SQL Server

$
0
0

Hi,

My question is regarding the use of SQL in a Development Environment. We have a VL Agreement. We have a Historical server using SQL in a 2 server cluster with a SAN. We purchased a SQL 2012 Standard Server for each server plus CAL's for all devices and users. For testing, a single server with local storage is used to develop and test changes before changing the production cluster. We have 2 Developers that will use the test server and 2 Developer Licenses were purchased. We used the production version of the SQL media to create the test server instead of the Dev version of the media. Are we compliant?

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?


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 ?

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

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








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}'


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. 


Viewing all 12963 articles
Browse latest View live


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