Quantcast
Channel: SQL Server Database Engine Forum
Viewing all 15872 articles
Browse latest View live

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


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.

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 - 

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

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.

Query to validate update table

$
0
0

Hi

I have made encryption for sensitive data in table column. I am looking for a query to check multiple table/column values to check whether the encryption completed fine. Since its encryption the value doesn't remain the same. is there any way we can find other than manual check

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


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

how to get the borders if page data continued to next page

$
0
0

hi all,

 i'm getting weird problem with borders.

i enabled borders but my tablix borders are cutting

the output preview..firstpage accountnumber data  is continued to next page then the tablix bottom border is cutted,it looks weird .in second page also when second accountnumber started then lot of gap between the borders ..please check the images..help is urgent..thanx inadvance..


lucky

Query on SQL server Datetime

$
0
0

Hi All,
we have few tables that are already partitioned based on date column like 2014, 2015,2016,2017, etc. and we are using this date column in our SQL queries (in where condition as inuput parameter/or declared variable).

Now we have to add one more condition (input variable) in our queries that is time. I want to know from SQL Server experts, is there any modifications required on below partition function to use time value.

NOTE: after implementing table partition on date column we are able to see good performance

Our query:
declare @FromDate datetime
declare @ToDate datetime
/*Today we have modified query with below variables*/
declare @FromTime time 
declare @ToTime time

set @Fromdate='2015-01-01'
set @Todate='2016-01-01'
set @FromTime='00:00'
set @ToTime='07:30'

select a.col1,b.col1
from tab a join tab b on a.id=b.id
where a.[date] >= Convert(VARCHAR(24), (@FromDate) + ' ' + (@FromTime), 113)
and b.[date] <= Convert(VARCHAR(24), (@ToDate) + ' ' + (@ToTime), 113)

Existing PF definition:
CREATE PARTITION FUNCTION VisitorsPerYear(datetime)
AS
RANGE RIGHT FOR VALUES 
('2012-01-01', '2013-01-01', '2014-01-01',
 '2015-01-01', '2016-01-01',2017-01-01)
GO

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

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.

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

Implementing Transparent Data Encryption on replicated Databases

$
0
0

Hi All,

We have transactional replication in place for many databases in our environment. The requirement now is to implement TDE for whole database. I request you to share your thoughts and insights about considerations for TDE.

Is there any impact on replication. If i apply TDE in publisher DB will there be any impact on subscriber DB?

In our case we are going to implement it in both publisher db and suscbriber Db.

Is compressed backup possible after applying TDE?

We have SAN backups for our prod systems, anything that needs to be taken care in that front( can we expect increase in backup duration, backup size )

Thanks

Udhayan

Cannot start SQL Server Service Broker on Database Could not start Service Broker for database id: 13

$
0
0

Dear Team,

I am getting below error in event log

Cannot start SQL Server Service Broker on Database Could not start Service Broker for database id: 13

could you please help me to understand what does the above error mean and how can we resolve it.

Appreciate your input.

Regards

ChetanV

Viewing all 15872 articles
Browse latest View live


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