What could change the "Agent XPs" configuration setting to 0 and leave no trace in the default trace or sql error log? Also is there another way to see who/what changed it?
Platform is Microsoft SQL Server 2012 (SP3-CU4)
Chuck
What could change the "Agent XPs" configuration setting to 0 and leave no trace in the default trace or sql error log? Also is there another way to see who/what changed it?
Platform is Microsoft SQL Server 2012 (SP3-CU4)
Chuck
Hi we run 2017 std. I didn't know whether to post this in the ssis forum or here. The bottom line is that my test service acct has permissions to read on my sql server after we added it to the appropriate nt group. We proved this by having a dba with sa execute as 'domain\newacct' select...
The acct's creds originate in a 3rd party scheduling product. The scheduler executes a powershell script on a different server. That script executes a proc on sql server a which runs some ssis on sql server a that (amongst other things) contacts sql server b. we see from the log on b that the login was as nt authority\anonymous logon. the login failed because token-based server access validation failed with an infrastructure error.
Can someone explain what is happening and if there is a low footprint way to get around this? there are actually 12 servers that the ssis on server a tries to connect to.
Its as if i'm getting at most 1 sql hop retaining my service acct's creds before they "get lost". I wouldn't really want to store the acct's creds in ssis but I suppose if that's a last resort and ssis has a fool proof way of doing that, maybe it would work.
I can say this. The ssis errors show that ssis knew the service acct was who ssis was running as.
from a connection standpoint, the powershell script specifies nothing more than sql server a's name and the database where the proc is to be run from.
On 20/11 starting from 8:00 A.M the application got "Timeout expired" error messages.
We noticed database performance degradation.
The DB was up, accepting connections but most of the queries (on different tables) were running very slow. (e.g: 3 minutes instead of several seconds)
During this time, the CPU was less than 40%, memory was stable ~ 85%.
There were no locks, nor load on the database.
The problem was solved after restarting the SQL Service.
No error messages detected in the Cluster, the virtual host, SQL logs and in the server event viewer.
Please guide us how can we find the root cause of the problem,
how to avoid it, and what else can we check if we hit the same problem again.
Configuration
==========
WIndows cluster on hyper-V
OS Name: Microsoft Windows Server 2016 Standard
OS Version: 10.0.14393 N/A Build 14393
Each cluster server has 16 CPU, 64G Ram
SQL Server version: Microsoft SQL Server 2017 (RTM-CU11) – 14.0.3038.14
Kiran
A new client has reached out to me because an application that they had written for them many years ago, running on SQL Server 7, circa 1998, has recently died. They have the MDF and LDF files. The goal at this point is to be able to access the data, even without their application, so it can be ported to a new application that uses a current database.
Any attempts I make to ATTACH the MDF files fail. I am on SQL Server 2019 (currently Express), though I have tried on 2016 Standard as well.
Does anyone know how far back I need to go to get a version of SQL Server that will read the files from SQL Server 7? Or if there are any tools out there that will read files in those formats? The ones I see all stop at SQL Server 2000.
If I can get access to the database / tables, I should be fine extracting the data they need.
Thanks in advance for any suggestions.
Jeffrey Rosenberg
Hi Fellows,
In PROD SQL server environment couple of days ago I notices 600 NDF files got created,
I have no idea how it happened,
please advise what are the possibilities this could happen,
the size is 64 MB and 128 MB,
Regards
k
Hi,
How to script schedule in sql server 2005. When I click on script option in manage schedule, there is message ' there is no action to script'. So my question is how to create script for these schedule?
Thanks
All,
The link says that the files that Polybase support are of the following format:
Delimited TextDoes this mean that other formats such as Excel File (xls and xlsx) are not supported?
Thanks,
rgn
I am getting the following error randomly while connecting to the sqL server 2014 database, any suggestion on how we can overcome the error?
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response.
The connection has been closed.".)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.fico.dm9.db.TestDB.test(TestDB.java:31)
at com.fico.dm9.ps.BatchProcess.run(BatchProcess.java:71)
at com.fico.dm9.ps.BatchExecutor.execute(BatchExecutor.java:113)
at com.fico.dm9.ps.BatchLauncher.main(BatchLauncher.java:35)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response. The connection has been
closed.".
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1533)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1042)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 6 more
Caused by: java.io.IOException: SQL Server returned an incomplete response. The connection has been closed.
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:607)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:664)
at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:656)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:851)
at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:839)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1483)
Srinivas
pols
Hi, I have a Linked Server and use Synonyms to abbreviate a 4part table reference. Recently I noticed the delete statement on a specific table is very slow. Using the full 4part name instead of Synonym executes normally. How can I fix this or are Synonyms
just unusable? Execution plans for Synonym and 4part queries are quite different. Thank you. A.
Kiran
HI,
We are using MS SQL server 2014 Std. on Win 2012 Std. Srvr .... <o:p></o:p>
Sometimes procedures are not getting executed thoroughly and getting exit in between without raising any errors. We used Begin Trans, rollback and try,catches... Surprisingly nothing works and later some time it works as normal.
but same solution is working in other servers whose OS is Win 2012 R2 and SQL Server 2014 Std. only differance is R2?
does it have this much impact?
thanks and regards,
SIG_SQL
Trying to execute a sproc that reads a Windows directory using xp_cmdshell and getting error:
"A call to 'LogonUserW' failed with error code: '1385'."
What I've done so far:
1. Enabled the xp_cmdshell procedure
2. Created a Windows login for a non-sysadmin user: "mydomain\CmdShell_User". This user has public access toMaster.
3. GRANT EXECUTE ON xp_cmdshell TO [mydomain\CmdShell_User]
4. Created a proxy account: CREATE CREDENTIAL ##xp_cmdshell_proxy_account## with identity = 'mydomain\CmdShell_User', secret = 'somepassword'
The sproc executes successfully under my login, but other users get the above error.
Any suggestions would be welcome. Thanx!
SQL Server version:12.0.5579.0
Darrell H Burns
I have a web site that queries every 10 seconds for data via a restful call. Because I am logging after anywhere from 20 to 80 minutes I see this error/exception raisedTimeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. The code from C# has using
block and in theory all connections are closed up on exit. I added immediately after my data query a2nd query to return how many connections ... The VERY last time before the query hangs with the error I record Cnx details 44 - AAASupport -nos\AAAvm$ Total Connections: 1 I have had a coworker
log on to the server and run the query with SSMS and he just gets himself and one connection at same time I am on SSMS running same connection query. With the code paused ( in debug it runs as me not the virtual machine ) - so connection open - same
user - myself - I also query from SSMS and get just 1 connection. What have I misunderstood about this query ? Should be 2 !
select a.dbid,b.name, loginame, count(a.dbid) as TotalConnections
from sys.sysprocesses a
inner join sys.databases b on a.dbid = b.database_id
group by a.dbid, b.name, loginame
1.) The error is not consistent with the diagnostics - how can the pool be exhausted if only 1 is connected
2.) The query doesnt seem to work... If my connection is still open from code I should have at least 2 connections one from the code and one from my SSMS instance under the same user. And what of my coworker with different user id
I use Dapper ( microOrm )
using (Conn)
{
try
{
Conn.Open();
string theQueryName = SP_INPROGRESSTESTS;
var r1 = Conn.Query<CurrentTest>(theQueryName, null, commandType: CommandType.StoredProcedure);
inProg= r1.ToList();
// Adhoc connections states for diagnostics
string theQuery = $"select a.dbid,b.name, loginame, count(a.dbid) as TotalConnections from sys.sysprocesses a inner join sys.databases b on a.dbid = b.database_id
group by a.dbid, b.name, loginame";
lc = Conn.Query<ConnectionDetails>(theQuery).ToList();
// paused here so connection should be open still !
}
catch (Exception e)
{
Log.Logger.Error("GetInProgressTests " + e.Message);
}
}
Any ideas ?? Thanks !
andrew
Hi,
We have a Windows Server 2016 machine in Azure running SQL Server 2016. The server sends around 80 emails a day using DatabaseMail. These are all basically text or HTML emails with no attachments. They are very small emails.
Three days ago we started getting error events in event log related to DatabaseMail. Below are the four events that get raised in order.
Error Event 1:
Database Engine Instance=xxxxxxx;Mail PID=2744;Error Message:
1) Exception Information
===================
Exception Type: System.OutOfMemoryException
Message: Array dimensions exceeded supported range.
Data: System.Collections.ListDictionaryInternal
TargetSite: Boolean TryReadPlpUnicodeChars(Char[] ByRef, Int32, Int32, System.Data.SqlClient.TdsParserStateObject, Int32 ByRef)
HelpLink: NULL
Source: System.Data
HResult: -2147024882
StackTrace Information
===================
at System.Data.SqlClient.TdsParser.TryReadPlpUnicodeChars(Char[]& buff, Int32 offst, Int32 len, TdsParserStateObject stateObj, Int32& totalCharsRead)
at System.Data.SqlClient.TdsParser.TryReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.TryReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj, SqlCommandColumnEncryptionSetting columnEncryptionOverride, String columnName)
at System.Data.SqlClient.SqlDataReader.TryReadColumnInternal(Int32 i, Boolean readHeaderOnly)
at System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32 i, Boolean setTimeout, Boolean allowPartiallyReadColumn)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetSendMailItem(SqlDataReader itemReader)
at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandFactory.CreateSendMailCommand(DBSession dbSession)
at Microsoft.SqlServer.Management.SqlIMail.Server.Controller.CommandRunner.Run(DBSession db)
at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object obj)
Error Event 2:
Database Engine Instance=xxxxxx;Mail PID=2744;Error Message:The connection is not open.
Error Event 3:
Database Engine Instance=xxxx;Mail PID=2744;Error Message:
1) Exception Information
===================
Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
Message: The connection is not open.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void ValidateConnection()
HelpLink: NULL
Source: DatabaseMailEngine
HResult: -2146232832
StackTrace Information
===================
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.ValidateConnection()
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.ValidateConnectionAndTransaction()
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.CommitTransaction()
at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.ThreadCallBack.MailOperation(Object obj)
Error Event 4:
Database Engine Instance=xxxxx;Mail PID=2744;Error Message:The connection is not open.
---------------------------------------------------------------
This problem started about 3 days ago. Little has changed on this server. We can still send emails, it's just creating these events. However yesterday and the day before the databasemail service stopped and i had to restart it manually. I have also never seen this happen in all my years. I have two other similar servers without this issue.
I set up a loop that sent an email every 15 minutes yesterday and tested whether the service had automatically stopped and since i have done this the mail service has continued to run even though it's generating these errors. The fact that the service stopped two days in a row is what lead me to find these events.
I have noticed that the events are raised when the DatabaseMail server cycles i.e. "DatabaseMail process is started" step occurs at the same time that the error are being geneated.
I have no idea what is going on here. I have read everything i can find, i have restarted the server, their is plenty of memory, no big emails are trying to be sent.
My next step is to turn off the looping email and see if the service stops again. I am looking for assistance on what i can check next.
Regards.
Simon.
Hello,
we are using SQL Server 2016. Our requirement is to restrict DBA account from selecting or updating any user data.
DBA accounts have sysadmin privilige.
Please help how to restrict.
Thanks
Hi
I had noticed a really strangle thing. INT calculation is 2-3-5 times slower in SQL server running in VMware than on physical machines. From VMware side, I had eliminated all possible things: balooning, CPU overconsumption, "ready" time etc. INT CPU tests (link 'Pi' digits calculation programs) show the same performance, while SQL server math operations are MUCH slower.
Please check the test of few results on different machines. I am DBA for >20y, but I am really puzzled.
Test is simple, no parallelism, no IO, limited memory use (L2,L3 caching is irrelevant)
Results
-- 31403 ms, one PROD VM, SQL 13.0.5337 (why is it so slow??? )create function dbo.isPrime (@n bigint) returns int as begin if @n = 1 return 0 if @n = 2 return 1 if @n = 3 return 1 if @n % 2 = 0 return 0 declare @sq int set @sq = sqrt(@n)+1 -- check odds up to sqrt declare @dv int = 1 while @dv < @sq begin set @dv=@dv+2 if @n % @dv = 0 return 0 end return 1 end GO declare @dt datetime set @dt=getdate() select dbo.isPrime(1000000000000037) select datediff(ms,@dt,getdate()) as ms GO
We're using xml parameters to send a collection of data to stored procedure.
Typical (little simplified) use case would look like:
DECLARE @Values varchar(max) = '<Root><S>1</S><S>2</S><S>3</S></Root>', @h int
DECLARE @Val TABLE(ID smallint)
EXEC sp_xml_preparedocument @h OUTPUT, @Values
INSERT INTO @Val(ID)
SELECT DISTINCT ID FROM OpenXML(@h,'Root/S',8) WITH (ID smallint 'text()')
EXEC sp_xml_removedocument @h
SELECT * FROM @Val
We know we have to properly "pair" sp_xml_preparedocument /sp_xml_removedocument to avoid memory leaks.
Normally, our server works for months without any problems.
(I have to use external image because your portal is giving me "Body text cannot contain images or links until we are able to verify your account." error message) https://imgpile.com/i/I5kAUR
At some point in time we're able to observe a constant growth of xml parser memory usage.
Our system still works, but it appears as if no document is being properly "removed", so our memory
usage graph begins to steadily grow.
(I have to use external image because your portal is giving me "Body text cannot contain images or links until we are able to verify your account." error message) https://imgpile.com/i/I5kLYg
In the graph above 1.5K represents 1500MB. The only way to stop this endless growth is to restart
SQL Server service. After that it starts working just fine.
Is there a way to reclaim back all memory (some kind of overall xml parser memory "reset") without
rebooting the whole service?
Since our stored procedures are running pretty quickly (few seconds max.) is there a way to reclaim
all memory allocated by sp_xml_preparedocument which execution moment is older then some predefined time
(that would simply deallocate all "old" memory used by "old" xml documents)?
Any help would be very useful.
We're using version: Microsoft SQL Server 2014 (SP3-CU4) (KB4500181) - 12.0.6329.1 (X64) Jul 20 2019 21:42:29 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )
We also had identical problem with SQL Server 2012.