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

Setting Alert on Performance "Lock Timeouts (timeout > 0)/sec

$
0
0

I have a couple questions about this. I am using SQL Server 2014.  The database that has problems is less the 100 MB.  I will get how busy the server is later.

Background.  I am helping someone identify the source of intermittent timeouts.  My understanding is that their .Net applications are running fine most of the time.  But then the application begins timing out.  I haven't established yet whether this is a connection time out or whether the query times out (that will come later).  I am toying with the following approach.

I create an alert on Lock:Lock Timeouts (timeout > 0)/sect on instance _total, if counter > 0.

The response is to run a job that runs a script that will dump the current connections, their waiting status, whether they are head blocker, etc (I can build this) into a table.

Next for Options, I want to set the Delay between responses to 4 minutes.

Questions:

1) What performance issues can I anticipate?  Is there no risk, moderate risk or high risk of this alert causing performance problems in a scenario of moderate work load, high work load (100 transactions per second, a number I pulled out of my hat).

2) My second question I think that I can test.  But off the top of your head, does an ADO.Net command cause a timeout that this alert can listen to.

 


Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com


Compare database scripts

$
0
0
Hi all,

My requirement is to move the database objects changes done in Testing DB to the Production DB (only the structual changes, not the data).

What is the best way to achieve it?

Website throwing error that user cannot login to database

$
0
0

Hi, I created a SQL database on Azure. I am able to connect from SQL Server management studio from my local machine as well from the SQL database portal online.

However, when my web site (web application) tries to start up and connect to the database, Azure throws an error that login by user failed. I've added the IP address of the azure web application to the firewall as well, and configured access by Azure services to True. In my web.config, I'm using the same connection string that Azure provided me (with my password included of course)

What else should I be doing? Any help will be appreciated.

Query performance - SQL server

$
0
0

Hi All,

Can you please suggest how to reduce the clustered index cost and operation from scan to seek.

SystemUserID column is primary column in table with unique identifier data type.

Cannot send mails to mail server. (The operation has timed out.)

$
0
0

HI Everyone,

  IF anyone faces this issue with Database mail  on SQL 2012 SP3? it used to work till yesterday and all of sudden stopped receiving mail alerts from SQL and found this. 

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2016-04-03T17:32:25). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Any help or workaround is greatly appreciated. 

Thanks


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

Database Index Rebuild Job suggestions for 24x7 live application dataabase.

$
0
0

Hi, 

 I am looking for best practices and suggestions for the 24x7 live application Database Maintenance. 

Have one application database on SQL 2012 which 24x7 live application. I am running rebuild job when i get maintenance window. But the problem i am facing is when I run this job its get locked with users transaction and run for infinite time until i manually kill the maintenance job. Steps i am running is

1) Kill Database connections

2) Run Index rebuild job. 

Even though killing all connection at first step rebuild job get locks up with users connection. So while I am running Index Rebuild job manually I have to kill all users connections manually. Index Rebuild job is set through maintenance plan and HAve added first step to kill database connections. 

Any best suggestion , workaround or best practices will help to solve this . 

Thank you. 


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

Linked servers and ODBC/SQR

$
0
0

I am attempting to write an SQR (it will run from PeopleSoft) that updates a linked server.  It fails with the following error:

 

(SQR 5528) ODBC SQL dbexec: SQLExecute error 7412 in cursor 2:
   [Microsoft][SQL Native Client][SQL Server]OLE DB provider "SQLNCLI" for linked server "DUL41" returned message "No transaction is active.".
(SQR 5528) ODBC SQL dbexec: SQLExecute error 7391 in cursor 2:
   [Microsoft][SQL Native Client][SQL Server]The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "DUL41" was unable to begin a distributed transaction.

Error on line 58:
   (SQR 3735) Could not execute SQL.

SQR for PeopleSoft: Program Aborting.

--------------------  Details ------------------------------

 

- The code is simply doing a delete right now.   delete from linkedserver.db.dbo.table where column = 1

- The SQL runs fine from Query Analyzer, so I think MSDTC must be setup correctly everywhere, and the linked servers must be defined correctly.  My QA test is using the same ID (sa) as my SQR.

- If I just write a select statement in the SQR, it works fine.

- in this example, SQR is connecting via ODBC, using SQL Native Client driver.

 

------------------  Environment --------------------------

 

- Main server:  Win2003, SQL2005sp2, active/passive cluster.  MSDTC is setup on the cluster.

- Linked server:  Win2003, SQL2000sp4, not a cluster.   (I also tried a SQL2005 server just to test)  This is the DUL41 server referenced in the error message.  MSDTC is running.

- Everything is running from a different Win2003 box, that connects to the main server using ODBC/SQL Native client

 

Thanks for any help or ideas.  Even any way to get better error messages, or a better way to test this.

 

timeout - how to find problem query

$
0
0

Hi all.

We are experiencing issues with a web application, in the log files for the application we see for example this error message:

System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

I've read about this and similar and figured out we need to check out the query causing this, we get the issue at peak hours when all users log in.

What is the most easy way to find the query, so I can start tuning it?

Im working as a dba, but I have good communication with the application developers.


how to take where clause condition based on 2 parameters

$
0
0

hi all,

 in my sp i have 2 parameters:

1-->crownnumber nvarchar(10)

2--->noofcrowns int

in report side, if crownnumber parameter value we take as 2 ,and no.ofcrowns as 3

each crown per page so, starting from crownnumber '2' since we gave parameter value as 2 ..it should give 3 pages result as 2,3,4(since no.ofcrowns are 3).


how can i give this logic in SP where clause............

where CrownNo BETWEEN  @CrownNumber AND @Noofcrowns doenot work for me..

 how can i acheive this..

pls help...



lucky

truncate_only' is not a recognized BACKUP option

$
0
0

Hello All,

I am able to run the below command in sql 2005 but in 2008 getting error : truncate_only' is not a recognized BACKUP option.


Back Up Log [DBName] with Truncate_Only 
dbcc shrinkfile([logFileName])

Thanks in Advance

Ashwin

SMSS New -> View very slow on first time

$
0
0

In SMSS on our SQL Server 2014 (12.0.4213.0) there are some maddening delays when we perform one particular function. When we right-click on View and choose New -> View. It can take from 30 to 60 seconds. Interestingly enough, when the new view comes up and we close it and create a new view immediately, it's fairly fast. It's down to about 3-4 seconds then. There's something that's happening at the first attempt but not subsequent attempts.

The delays don't seem to happen on our old SQL 2008 R2 server (10.50.6220). When we click New -> View to create a new view we always have the new view dialog box (Add Table) within 2 seconds.

Our new server is a screaming Dell PE 730 filled with SSDs and the DBs themselves between 20 and 400 GB with no more than 20 users for any of these servers. Nothing else seems to tax the server. Running applications are screaming fast.

The New -> Views function seems to be the one thing. I would love some way to  I need to tune/fix this to keep the primary DB manager happy with this server.

trc File Permissions Getting Stripped When Creating A Trace via SQL Server Agent

$
0
0

Hello Forum

Over the last few weeks I have been running some Traces on A Server.  On Friday 02-Apr we had to move the location to a Network share as the trace files were filling up the Drive.  The trc files have been created and populated in the Network Share but the permissions have been stripped; there appears to be no owner for the files.  The Domain Administrator can of course re-introduce the permissions but we are struggling to get it working as it should.

Our initial thoughts are of course AD permissions.  Note that both myself and the Domain Administrator have the required permissions on the file share: -

  • We can both create, edit and delete documents
  • We both have sys admin rights within the SQL Server Instance
  • We have set the Job to run as myself, the DA and as sa.  The Trace File is being created but without any permissions.

Has anyone seen this sort of behaviour before?

SQL Server 2008 R2 SP1 is in use.


Please click "Mark As Answer" if my post helped. Tony C.

SQL Server Service Terminated Unexpectedly

$
0
0

I have a production server that had the SQL Server service terminate unexpectedly.

My Server & SQL Server info is:

Current time is 3:55:01 04/04/16.                                                                              
=====================================================================                                            
       BugCheck Dump                                                                                            
=====================================================================                                            
                                                                                                                
This file is generated by Microsoft SQL Server                                                                  
version 11.0.6518.0                                                                                             
upon detection of fatal unexpected error. Please return this file,                                               
the query or program that produced the bugcheck, the database and                                                
the error log, and any other pertinent information with a Service Request.                                       
                                                                                                                
                                                                                                                
Computer type is Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz.                                                      
Bios Version is HP     - 1                                                                                      
I36                                                                                                             
72 X64 level 8664, 2 Mhz processor (s).                                                                         
Windows NT 6.2 Build 9200 CSD .                                                                                 
                                     
Memory                               
MemoryLoad = 96%                     
Total Physical = 393087 MB           
Available Physical = 12031 MB        
Total Page File = 395135 MB          
Available Page File = 10767 MB       
Total Virtual = 134217727 MB         
Available Virtual = 131146694 MB     
**Dump thread - spid = 0, EC = 0x000002EBE2015D70                                                               
***Stack Dump being sent to ...\MSSQL\LOG\SQLDump0001.txt  
* *******************************************************************************                                
*                                                                                                               
* BEGIN STACK DUMP:                                                                                             
*   04/04/16 3:55:01 spid 5645                                                                                  
*                                                                                                               
* ex_terminator - Last chance exception handling                                                                
*                                                                                                               
* Input Buffer 255 bytes - 

Connect SSMS 2014 to AWS instance

$
0
0

I'm using SSMS (SQL Server Management Studio) 2014 and trying to connect to an AWS instance which has SQL Server Express running. OS is Windows Server 2012 R2. All updates have been applied.

What I've done:

  • Opened ports 1433, 1148 in AWS Security Group (firewall opened on inbound ports also on server)
  • Enabled client protocols (TCP/IP, Named Pipes, Shared Memory) on server
  • Remote server access enabled for database (server -> properties)
  • SQL Server Browser enabled (server service)
  • Public/Elastic IP assigned (ping works fine)
  • Able to log into database on server just fine

The error I'm receiving:

  • Cannot connect to MYIPADDRESS\SERVERNAME,1148
  • The wait operation timed out

Any help would be greatly appreciated.

Zack


FILESTREAM shared folder can not be accessed using listener name

$
0
0

I have AlwaysOn configured in SQL Server 2014 and enabled Filestream in both nodes (node 1 and node2) as shown here:

Enable and Configure FILESTREAM (MSDN Library)

I have named the shared folder name "MYSHAREDSQLFILES".

I can access the folder using below path whenever node 1 is Primary

\\**node1**\MYSHAREDSQLFILES

But I want to access it using listener name, because user will not know which one is PRIMARY node. what is the best practise.

I have gone through the prerequisites but still it does not work MSDN 



Many Thanks Deepak


Error AppDomain 22 (SSISDB.dbo[runtime].27) is marked for unload due to memory pressure.

$
0
0

AppDomain 22 (SSISDB.dbo[runtime].27) is marked for unload due to memory pressure.

AppDomain 22 (SSISDB.dbo[runtime].27) unloaded.


ABDUL HAFEEZ MCSE MCITP

SQL Agent not starting up

$
0
0
2016-04-04 13:13:00 - ? [100] Microsoft SQLServerAgent version 11.0.6020.0 (X64 unicode retail build) : Process ID 4848
2016-04-04 13:13:00 - ? [495] The SQL Server Agent startup service account is XXXX\XXXXService.
2016-04-04 13:13:00 - ! [150] SQL Server does not accept the connection (error: 233). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
2016-04-04 13:13:00 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start
2016-04-04 13:13:00 - ! [298] SQLServer Error: 233, Shared Memory Provider: No process is on the other end of the pipe. [SQLSTATE 08001]
2016-04-04 13:13:00 - ! [298] SQLServer Error: 233, Client unable to establish connection [SQLSTATE 08001]
2016-04-04 13:13:00 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)
2016-04-04 13:13:00 - ? [098] SQLServerAgent terminated (normally)

SQL 2012 CU2 After SP3

Can I access the file stream shared folder using Listeners in case of AlwaysOn cluster environment?

$
0
0

One of the most effective ways to extend your SQL Server Integration Services (SSIS) control flow is to use a Script task to write custom code that perform tasks you cannot perform with the built-in components.But it's not straight forward in case of AlwaysOn configured nodes

Below is my current environment setup which helps you to understand the problem.

My environment

  • I am having NODE 1 and NODE 2 as cluster configured
  • SQL Server always on and availability group configured
  • SQL Server file stream is enabled on both node 1 and node 2 entitled as MYSHAREDNAME
  • Internal load balancing Listener configured and entitled as MYACTIVENODE

Problem Statement One of the node among cluster (node 1 or node2) can be down any time. We will not sure which one will become PRIMARY. I am trying to access the shared folder as follow

\\NODE1\MYSHAREDNAME - Works if NODE 1 is primary node

\\NODE2\MYSHAREDNAME - Works if NODE 2 is primary node

But it's difficult to hard code above path as any node can go down. So I used LISTENER name so that it can automatically detect the PRIMARY node to do the desired job as shown below

So I used LISTENER name so that it can automatically detect the PRIMARY node to do the desired job as shown below

  \\MYLISTENERNAME\MYSHAREDNAME  

But I am not able to access it

How can I fix it? Ports 1433, 5022, 59999 are enabled.

Extract from https://msdn.microsoft.com/en-in/library/dn385720.aspx

AlwaysOn Availability Groups are supported as long as you do not add new database files to the primary database. If a database operation requires a new file to be created in the primary database, first disable AlwaysOn Availability Groups in the secondary node. Then, perform the database operation on the primary database and backup the database in the primary node. Next, restore the database to the secondary node, and enable AlwaysOn Availability Groups in the secondary node. Note that AlwaysOn Failover Cluster Instances is not supported when using the SQL Server Data Files in Windows Azure feature

But I did not understand what does above statement means?



NUMA doubts

$
0
0

Hi SQL Experts,

Can anyone help in below queries.

What is NUMA? Why NUMA ? How it is related/affects SQL Server Performance?
How it affects the MAXDOP setting.

Please don't paste urls/links. I just wanted to understand in simple layman terms or short descriptions.

Thanks,

Sam

Viewing all 15264 articles
Browse latest View live