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

Disabling RC4 and DES in Win2012 Production SQL Servers.

$
0
0

Hi,

The customer have SQL production servers n windows 2012. 

They came with the question will there be any effect for SQL Servers if we disable both RC4 and Des. 

I am not sure what can happen to the application if we disable this both. I dont have any idea on these. Please can anyone guide how to disable if these both will not impact the SQL Server. 

Thanks,

Jo


pols



SQLDump.mdmp Erreur sqllang!CSsXmlNsResolver::GetCurrentElement

$
0
0

Hi,

We have an error generating SQLDump.mdmp. A WinDbg stack shows sqllang!CSsXmlNsResolver::GetCurrentElement.

We're using XML path functions such as xml.exist or xml.value, and the error seems to occur when running those xml functions.

Have you seen this error ?

Thks

INT math is slow in SQL server, but only under VMware - really weird!

$
0
0

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??? )
-- 9227 ms,  AWS RDS 14.0.3035.2
-- 7733 ms,  very old physical machine, 10.50.6220.0, very old
-- 13666 ms,  my really old desktop, physical, 13.0.4446.0
-- 6346 ms,   desktop of my colleague, physical, 14.1000.169

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



Want to Calculate Database Growth but not based on Database Backups? Please help.

$
0
0

Hi All,

Is there any way can find database growth from last few months..?

We have around 23 databases on a SQL instance and only few (2-3) are getting backed up. 

I found few queries which do this but those are based on backup and we don't take backup of all our database.

Is there any way can find the growth of my SQL instance? 

I found this but not much useful. 

https://www.mssqltips.com/sqlservertip/6158/how-to-check-monthly-growth-of-database-in-sql-server/

--SECTION 1 BEGIN
;WITH BackupsSize
     AS (SELECT TOP 1000 rn = ROW_NUMBER() OVER(
                         ORDER BY DATEPART(year, [backup_start_date]) ASC, 
                                  DATEPART(month, [backup_start_date]) ASC), 
                         [Year] = DATEPART(year, [backup_start_date]), 
                         [Month] = DATEPART(month, [backup_start_date]), 
                         [Backup Size GB] = CONVERT(DECIMAL(10, 2), ROUND(AVG([backup_size] / 1024 / 1024 / 1024), 4)), 
                         [Compressed Backup Size GB] = CONVERT(DECIMAL(10, 2), ROUND(AVG([compressed_backup_size] / 1024 / 1024 / 1024), 4)), 
                         [database_name]
         FROM msdb.dbo.backupset
         WHERE 1 = 1
               AND [type] = 'D'
               AND backup_start_date BETWEEN DATEADD(mm, -1, GETDATE()) AND GETDATE()
         GROUP BY [database_name], 
                  DATEPART(yyyy, [backup_start_date]), 
                  DATEPART(mm, [backup_start_date]), 
                  [database_name]
         ORDER BY [Year], 
                  [Month]) 
     --SECTION 1 END

     --SECTION 2 BEGIN
     SELECT b.Year, 
            b.Month, 
b.[database_name],
            b.[Backup Size GB], 
            0 AS deltaNormal, 
            b.[Compressed Backup Size GB], 
            0 AS deltaCompressed
     INTO #PerDatabaseGrowth
     FROM BackupsSize b
     WHERE b.rn = 1
     UNION
     SELECT b.Year, 
            b.Month, 
b.[database_name],
            b.[Backup Size GB], 
            b.[Backup Size GB] - d.[Backup Size GB] AS deltaNormal, 
            b.[Compressed Backup Size GB], 
            b.[Compressed Backup Size GB] - d.[Compressed Backup Size GB] AS deltaCompressed
     FROM BackupsSize b
          CROSS APPLY
     (
         SELECT bs.[Backup Size GB], 
                bs.[Compressed Backup Size GB]
         FROM BackupsSize bs
         WHERE bs.rn = b.rn - 1
     ) AS d
     ORDER BY 1, 
              2
--SECTION 2 END

--SECTION 3 BEGIN
SELECT pdbg.Year, 
       pdbg.Month, 
       SUM(pdbg.[Backup Size GB]) / 1000.00 AS [Backup Size GB], 
       SUM(pdbg.deltaNormal) AS deltaNormal, 
       SUM(pdbg.[Compressed Backup Size GB]) AS [Compressed Backup Size GB], 
       SUM(pdbg.deltaCompressed) AS deltaCompressed
FROM #PerDatabaseGrowth pdbg
GROUP BY pdbg.Year, 
         pdbg.Month
ORDER BY 1, 
         2


Thanks Shiven:) If Answer is Helpful, Please Vote

Application jobs are taking more time than expected and DB server CPU utilization is high

$
0
0
Application performance is degraded from 18-Nov-2019. We suspected windows patching ,but even after uninstalling the patches also issue remains.


Kiran


database performance degradation

$
0
0

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

SQL Server 2012 SP4 (+hotfixes) TLS 1.2 - The client and server cannot communicate because they do not possess a common algorithm

$
0
0

We have a new server that, for the moment, has to be on W2012R2/SQL2012. I have patched SQL Server right up to the latest levels and the server has been hardened to use TLS1.2 only. Most things are fine, but SCOM is failing to communicate and also the 'syspolicy_purge_history'  job is failing on the 'Erase Phantom System Health Records' step. Both are failing with 'The client and server cannot communicate because they do not possess a common algorithm'.

As this is such an old version, is this expected? Do we have to accept the fact that we have to enable TLS1.0 for now? Responses appreciated, many thanks.

 

Machine Learning Services 2019: Managing AppContainers

$
0
0

Hi,

From SQL Server 2017 to SQL Server 2019 one of the changes was that ML services started to use the AppContainers windows API (also called Sandbox(?)).

It's great for security, however, what about R scripts having access to files in the disk? The security is completely isolated, I already discovered that giving permission to the group SQLRUsers (a name like this :-) is not enough, doesn't solve the problem.

After a lot of research and attempts in the wrong direction, I discovered that each appcontainer uses its own SID. This is needed to give permissions the the R script to read and write files to/from the disk.

Of course, after understanding app containers, I can assign the permission to the SID of "ALL Application Containers", but this is more than I need, in some ways, a security flaw.

So, the questions:

1) How can I discover the SID of the app containers created by the launchpad ? I found out that they behave as a user, creating a user profile folder with their SID, but it should have a better way them running a lot of R scripts to ensure launchpad will use all app containers and them look the user profile folder.

2) Does R and Python use the same app container, the same set of SIDs, or are there different sets of SIDs for each one?

3) Raising the bar of something already complex, there is no way to set different permissions for each language, R and Python for example, as long as they share the same SIDs and we have no control of it, right?

Thank you in advance !

Dennes


Dennes [http://bufaloinfo.cloudapp.net] Inscreva-se em meu treinamento on-line de T-SQL - [http://bufaloinfo.cloudapp.net/Cursos/linguagemsql.aspx]


igraph png not working on SQL Server 2019

$
0
0

Hi,

I made some tests with Graph Databases and was trying to use R services do create an image file of the graph. I'm not an R specialist but I was able to write an R script to create the image, it works very well on SQL Server 2017.

The R script:

exec sp_execute_external_script @language = N'R', 
@script = N'
require(igraph)
g <- graph.data.frame(graphdf)
V(g)$label.cex <- 2
png(filename = "c:/R/plot1.png", height = 1200, width = 1200, res = 100); 
plot(g, vertex.label.family = "sans", vertex.size = 40)
dev.off() ', 
@input_data_1 = N'select LikeMember.MemberName as LikeMember,    LikedMember.MemberName as LikedMember         from dbo.ForumMembers as LikeMember,  dbo.ForumMembers as LikedMember,  Likes
        where Match(LikeMember-(Likes)->LikedMember)', 
@input_data_1_name = N'graphdf'
GO

It works perfectly in SQL Server 2017 but I couldn't make it work in SQL Server 2019. The error message is:

Error in png(filename = "c:/R/plot1.png", height = 1200, width = 1200,  : 
  unable to start png() device
Calls: source -> withVisible -> eval -> eval -> png
In addition: Warning messages:
1: In png(filename = "c:/R/plot1.png", height = 1200, width = 1200,  :
  unable to open file 'c:/R/plot1.png' for writing
2: In png(filename = "c:/R/plot1.png", height = 1200, width = 1200,  :
  opening device failed

Error in execution.  Check the output for more information.
Error in eval(ei, envir) : 
  Error in execution.  Check the output for more information.
Calls: runScriptFile -> source -> withVisible -> eval -> eval -> .Call
Execution halted

Although the error message seems obvious, I already checked the permissions on the folder, the user of the services (SQL Server and Launchpad) and even used the audit over the folder but could not identify how to solve this problem.

Any idea?

Thank you!

Dennes


Deadlock when using SqlBulkCopy to concurrently insert rows into a single non-empty table

$
0
0
Hi!

Unfortunately, we encounter a deadlock situation when using the SqlBulkCopy class to insert rows into a single table using multiple machines / processes concurrently.

In order to achieve best database write-out performance we use the SqlBulkCopy class with SqlBulkCopyOptions.TableLock. According to the msdn documentation SqlBulkCopy will "obtain a bulk update lock for the duration of the bulk copy operation" . Reading about bulk update locks it is stated that "Bulk update (BU) locks allow multiple threads to bulk load data concurrently into the same table while preventing other processes that are not bulk loading data from accessing the table."

Investigating our deadlock graph I can see that 2 processes are holding a BU lock on the destination table while both processes now request an exclusive X lock on that table. Hence, the deadlock situation. The destination table is a heap so there should not be any index update problems.

After some more investigation using the official Microsoft SqlBulkCopy sample from Adventureworks I realized that performing a bulkcopy operation to an empty table leads to an acquisition and release of a BU lock (on that table). Hence, no concurrency issue here.

However, performing a bulkcopy operation on a non-empty table leads to a BU lock (on that table) followed by an X (exclusive) lock. Hence the pattern I see in my deadlock graph.

Does anyone know why SqlBulkCopy obtains an X lock during bulk-insert in case the destination table is not empty?
How can I concurrently bulk-insert data in a single non empty table using multiple threads in a safe way?

I think originally we used the default row level locking but also ran into conversion deadlock issues when threads were escalating their row locks to page and table level concurrently.

Any insights and help is greatly appreciated.

Thanks!
Stefan
Stefan

SQLServer 2019 Polybase - External access operation failed because the location URI is invalid. Revise the URI and try again.

$
0
0

All,

I tried to create an External Data Source against another SQLServer (2016) from a SQLServer 2019 server but I get the below error:

<<External access operation failed because the location URI is invalid. Revise the URI and try again.>>

NYCSQL10.nydomain.net is a SQLServer 2016 server

Configure PolyBase to access external data in SQL Server

What am I missing?

Thanks,

rgn

   CREATE EXTERNAL DATA SOURCE PolyBaseSQL
    WITH ( 
    LOCATION = 'sqlserver://NYCSQL10.nydomain.net\ACT:1488',
    -- PUSHDOWN = ON | OFF,
      CREDENTIAL = SQLServerCredentials
    );
    GO


No OK button to press

$
0
0

Hi,

I don't know what is going wrong, as there is no "OK" button below, after I've selected .bak file, within Sql server 2012 management studio.


Many Thanks & Best Regards, Hua Min

Reclaim SQL server space after deleting document content from Database

$
0
0

Hi,

We have deleted some document content from the Database. how to reclaim the SQL Server space.

Thanks,


Database log file growth control for Simple and Full recovery Model

$
0
0

Hi

I have many databses on single instance (having recovery model simple and full) SQl Server 2012. Database are almost not used by application.

They are used for Application search/refrence only. My few database logfile size are 5 GB to 120 GB. I am thinking to shrink it. But it might grow again? is there any best way to control this growth without changing application logic etc.

Regards,

Deepak



is Active Directory - Password a valid authentication mode for determining if our service account has login etc rights

$
0
0

Hi we run 2017 STD. Its sometimes expensive for us to spin up the scheduling tool we have to determine if the service acct we use in that tool has new rights we attempted to give it via addition to an nt group. 

So as a shortcut we tried logging into the server (via ssms) we thought we just gave it rights to.  And chose Active Directory - Password as the auth mode.  We know the service acct's password.  But we got the error below. 

Is logging in this way a valid way of testing that the permissions we thought we gave have been accomplished?  Of course we would have selected from target tables once we got further.  If such an "impersonation chain" capability is something that perhaps we don't have but our dba does, how do we ask him if he has it before we waste his time asking him to try it? 


Full backup took longer time than usual

$
0
0

Hi All,

We have a sql backup job which usually takes less than 10 min to complete. But today it has taken more than 2 hours to complete. How to find the root cause & how to fix it.


MICROSOFTSQLSERVERSTANDARDEDITION 2019 SNGL OLP 1LICENSE NOLEVEL

$
0
0

Hi, I bought a 2019 sql license, I want to install the 2017 version and can I do it?
if yes, how can I do it?

thank

SQL Server 2019 snapshot agent error

$
0
0

Hello,

I was trying to configure an SQL Server 2019 transactional replication, but the snapshot agent returns the following error:

Error messages:
Message: An unspecified error had occurred in the native SQL Server connection component.
Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowConnectionFailureException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.InitializeNativeBcpOutProvider(LogMessageCallback logMessageCallback, String strName, String strApplication, String strHost, String strServer, String strNetwork, Int32 encryptionLevel, String strDatabase, SecurityMode securityMode, String strLogin, SecureString strPassword, Int32 bcpBatchSize, Int32 loginTimeout, Int32 queryTimeout, Int32 packetSize, DeadlockPriority deadlockPriority, String strRowDelimiter, String strFieldDelimiter, Byte syncMethod, Boolean forceOdbcBcp, Boolean forceOleDbBcp, Boolean enableMultipleActiveResultSets, Boolean useReadPastHint, Boolean usePageLockHint, Boolean securePassword)
   at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotProvider.InstantiateBcpOutProviderWorker(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.InstantiateBcpOutProvider(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.Initialize()
   at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
   at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQL_REPL, Error number: MSSQL_REPL55012)
Get help: http://help/MSSQL_REPL55012

Any idea why?

Best regards,

José Cruz

DBCC skipping one database during integrity check

$
0
0

Hi,

we are running DBCC Integrity command using for user databases and sometime it's skipping one database.

No error message.

last few days, user databases we have 6 DB and DBCC when running every night, one DB not running DBCC integrity check but other databases running so couldn't understand why one DB not checked by DBCC command.

There are no information or any error message in log.

This kind of behavior happens on another server also randomly during nightly backup, one or two DBs getting skipped sometimes and it's not happening everyday but sometimes. 

Connect to Sql Server default instance with non-standart port

$
0
0

Hello,

I have the following problem while connecting sql server instance:

I installed new instance with non-standard port like 1986:



but I can connect to instance without port, I just write hostname in connection string,

at the same time 'hostname,portnumber' is working. 

I want to note that firewall is off and antivirus is not configured in the server,

How must I change the default port(1433) to non-standart port that it is not able to connect  without assigning port number in connection string?

Viewing all 12963 articles
Browse latest View live