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

SQL TEMPDB sizing?

$
0
0

Hello,

I have the following query:

select sys1.Netbios_name0 , isc.NormalizedName AS [Product Name] , isc.NormalizedPublisher AS [Publisher] , isc.NormalizedVersion AS [Version] ,max(Case sql2017.PropertyName0 when 'SKUName' then sql2017.PropertySTRValue0 end) as [sql2017 Type] ,max(Case sql2017.PropertyName0 when 'SPLEVEL' then sql2017.PropertyNUMValue0 end) as [sql2017 Service Pack] ,max(Case sql2017.PropertyName0 when 'VERSION' then sql2017.PropertySTRValue0 end) as [sql2017 Version] ,max(Case sql2017.PropertyName0 when 'FILEVERSION' then sql2017.PropertySTRValue0 end) as [sql2017 CU Version] ,max(Case sql2017.PropertyName0 when 'INSTANCEID' then sql2017.PropertySTRValue0 end) as [sql2017 InstanceID] ,max(Case sql2016.PropertyName0 when 'SKUName' then sql2016.PropertySTRValue0 end) as [sql2016 Type] ,max(Case sql2016.PropertyName0 when 'SPLEVEL' then sql2016.PropertyNUMValue0 end) as [sql2016 Service Pack] ,max(Case sql2016.PropertyName0 when 'VERSION' then sql2016.PropertySTRValue0 end) as [sql2016 Version] ,max(Case sql2016.PropertyName0 when 'FILEVERSION' then sql2016.PropertySTRValue0 end) as [sql2016 CU Version] ,max(Case sql2016.PropertyName0 when 'INSTANCEID' then sql2016.PropertySTRValue0 end) as [sql2016 InstanceID] ,max(Case sql2014.PropertyName0 when 'SKUName' then sql2014.PropertySTRValue0 end) as [sql2014 Type] ,max(Case sql2014.PropertyName0 when 'SPLEVEL' then sql2014.PropertyNUMValue0 end) as [sql2014 Service Pack] ,max(Case sql2014.PropertyName0 when 'VERSION' then sql2014.PropertySTRValue0 end) as [sql2014 Version] ,max(Case sql2014.PropertyName0 when 'FILEVERSION' then sql2014.PropertySTRValue0 end) as [sql2014 CU Version] ,max(Case sql2014.PropertyName0 when 'INSTANCEID' then sql2014.PropertySTRValue0 end) as [sql2014 InstanceID] ,max(Case sql2012.PropertyName0 when 'SKUName' then sql2012.PropertySTRValue0 end) as [sql2012 Type] ,max(Case sql2012.PropertyName0 when 'SPLEVEL' then sql2012.PropertyNUMValue0 end) as [sql2012 Service Pack] ,max(Case sql2012.PropertyName0 when 'VERSION' then sql2012.PropertySTRValue0 end) as [sql2012 Version] ,max(Case sql2012.PropertyName0 when 'FILEVERSION' then sql2012.PropertySTRValue0 end) as [sql2012 CU Version] ,max(Case sql2012.PropertyName0 when 'INSTANCEID' then sql2012.PropertySTRValue0 end) as [sql2012 InstanceID] ,max(Case sql2008.PropertyName0 when 'SKUName' then sql2008.PropertySTRValue0 end) as [sql2008 Type] ,max(Case sql2008.PropertyName0 when 'SPLEVEL' then sql2008.PropertyNUMValue0 end) as [sql2008 Service Pack] ,max(Case sql2008.PropertyName0 when 'VERSION' then sql2008.PropertySTRValue0 end) as [sql2008 Version] ,max(Case sql2008.PropertyName0 when 'FILEVERSION' then sql2008.PropertySTRValue0 end) as [sql2008 CU Version] ,max(Case sql2008.PropertyName0 when 'INSTANCEID' then sql2008.PropertySTRValue0 end) as [sql2008 InstanceID] /* ,max(Case sql2005.PropertyName0 when 'SKUName' then sql2005.PropertySTRValue0 end) as [sql2005 Type] ,max(Case sql2005.PropertyName0 when 'SPLEVEL' then sql2005.PropertyNUMValue0 end) as [sql2005 Service Pack] ,max(Case sql2005.PropertyName0 when 'VERSION' then sql2005.PropertySTRValue0 end) as [sql2005 Version] ,max(Case sql2005.PropertyName0 when 'FILEVERSION' then sql2005.PropertySTRValue0 end) as [sql2005 CU Version] ,max(Case sql2005.PropertyName0 when 'INSTANCEID' then sql2005.PropertySTRValue0 end) as [sql2005 InstanceID] */ from v_r_system sys1 join v_GS_INSTALLED_SOFTWARE_CATEGORIZED isc on isc.ResourceID = sys1.ResourceID left join v_GS_EXT_SQL_2017_PROPERTY0 sql2017 on sys1.resourceid=sql2017.ResourceID left join v_GS_EXT_SQL_2016_PROPERTY0 sql2016 on sys1.resourceid=sql2016.ResourceID left join v_GS_EXT_SQL_2014_PROPERTY0 sql2014 on sys1.ResourceID=sql2014.ResourceID left join v_GS_EXT_SQL_2012_PROPERTY0 sql2012 on sys1.ResourceID=sql2012.ResourceID left join v_GS_EXT_SQL_2008_PROPERTY0 sql2008 on sys1.ResourceID=sql2008.ResourceID -- left join v_GS_EXT_SQL_2005_PROPERTY0 sql2005 on sys1.ResourceID=sql2005.ResourceID where sql2017.PropertyName0 in ('instanceid','SKUNAME','SPLevel','version','fileversion') or sql2016.PropertyName0 in ('instanceid','SKUNAME','SPLevel','version','fileversion') or sql2014.PropertyName0 in ('instanceid','SKUNAME','SPLevel','version','fileversion') or sql2012.PropertyName0 in ('instanceid','SKUNAME','SPLevel','version','fileversion') or sql2008.PropertyName0 in ('instanceid','SKUNAME','SPLevel','version','fileversion') /* or sql2005.PropertyName0 in ('instanceid','SKUNAME','SPLevel','version','fileversion') */ group by sys1.Netbios_name0, isc.NormalizedName, isc.NormalizedPublisher, isc.NormalizedVersion

Is it possible to evaluate the size of the temp files:

versus the size of the databases sizes:

I am asking about this because the query is running out-of-space after hours processing even with 132 GB free space so far. For now it is failing when reaching 18,000,000 KB per file...

the autogrowth for now is set as:

Do I need more free space? is yes how much?

Do I change the query?

Should I increase the autogrowth to speed up the processes? Percent or Size?

Thanks,
Dom


Security / System Center Configuration Manager Current Branch / SQL



Polybase DMV Execution Connection Error

$
0
0

On executing the the Polybase DMV's from Compute Node getting the following error, same queries are executing fine from Head Node

Msg 10061, Level 16, State 1, Line 34
TCP Provider: No connection could be made because the target machine actively refused it.


Where can I find prepared SQL statements (sp_prepare) in the system tables/views?

$
0
0

Environment: SQL Server 2014 on Windows Server 2012 R2.

Our application uses hibernate and the jTDS JDBC driver, so we are (by default) getting generated SQL statements coming through as sp_prepare and sp_execute.  Sometimes, I am able to find the prepared queries in the cache, but sometimes I'm not.  By cache, I mean sys.dm_exec_query_stats and sys._dm_exec_cached_plans.  What's strange is that even if they seem to be gone from the cache, the prepared statements execute successfully.  I'm wondering if there is some other location where I could consistently see/find the prepared statements, hopefully by their integer handle?

Thank you,

-Peter

SQL cluster server SQL memory dump generated .

$
0
0

Hi Team

We are facing the issue on SQL cluster 2016 servers . SQL services self stop and start after 2 or 3 days and finding only I/O related error in default logs location as well generate the memory dump after 4 or 3 days "N:\MSSQL13.SQL3B\MSSQL\LOG\SQLDump0018.mdmp"  . and no failover happens after services UP

And this issue is occurring our all production servers  .

SQL server 2016 SP 1 

Windows server 2012 

Regards

Dinesh

SQL Job not running but Job History showing in executing status

$
0
0

Hi All,

We got a server restart on the server, later some time we had checked for one SQL Job currently the job is not running but in SQL Job history the job is showing in execution status.

While tried to stop manually the "Stop Job" was grayed out.

Is any one faced like this scenario.

Thanks,

Satish Kumar.



Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)

No query plan when executing the script sp_whoisactive @get_plans =1, @get_additional_info = 1

$
0
0

Query plan is null when executing the query:

sp_whoisactive @get_plans

=1,@get_additional_info=1

Slow Running Query Execution Plan

$
0
0

SELECT creation_time

       ,last_execution_time

       ,total_physical_reads

       ,total_logical_reads

       ,total_logical_writes

       , execution_count

       , total_worker_time

       , total_elapsed_time

       , total_elapsed_time / execution_count avg_elapsed_time

       ,SUBSTRING(st.text, (qs.statement_start_offset/2)+ 1,

        ((CASE statement_end_offset

         WHEN-1THEN DATALENGTH(st.text)

         ELSE qs.statement_end_offsetEND

           - qs.statement_start_offset)/2) +1)AS statement_text

FROM sys.dm_exec_query_stats AS qs

CROSSAPPLY sys.dm_exec_sql_text(qs.sql_handle) st

ORDERBY total_elapsed_time / execution_count DESC;

executed the query with output:

What is the time conversion in Total elapsed time, total worker time and avg elapsed time?

Query Problems Implicit Transactions

$
0
0

Executing [dbo].[sp_blitzFirst] lists Query Problem and Implicit Transactions. I can find all the sessions in

sp_WhoIsActive @get_locks = 1, one of the locks

<

Databasename="X">

  <

Locks>

    <

Lockrequest_mode="S"request_status="GRANT"request_count="1"/>

  </

Is some of the transactions on? There are lot of sleeping sessions. Is this the issue why the Application is slow? What Can I do to fix this issue.

Locks>

</

Database>


how to monitor Longest Running Transaction using SQL Server Agent Alerts

$
0
0

hi there:

  I understand that this article has explained in details on how to monitor longest running transactions using agent alerts

https://www.sqlservercentral.com/articles/monitoring-longest-running-transaction-using-sql-server-agent-alerts

however, the author also put a note saying it only works for databases under read committed snapshot isolation level. 

Since most of my databases are not snapshot isolation level, is there still a way to use sql agent to detect longest running

transactions and send out alerts. 

 I fully understand how to complete this task using sql server schedule jobs but would prefer to use sql agent alerts as it puts less pressure on the job and gives me near real-time alerting . 

Thank you

Hui


--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

Log Shipping in SQLServer2019 error

$
0
0

Hi all,

I am trying to configure log shipping and getting following error in agent job history.(SQL Server 2019)

There was no problem with sql server 2017 and 2016 in same configuration.

The backup file was created normally but error message is logged.

----------------------------------------------------------------------------------------------------------------

2019-12-04 11:16:50.90 Starting transaction log backup. ID: '26c94b60-7380-4ddd-8dc7-ae2ae70630c7'

2019-12-04 11:16:50.90 *** ERROR: Unable to log history / error messages.(Microsoft.SqlServer.Management.LogShipping) ***

2019-12-04 11:16:50.90 *** error: Failed to convert parameter value fromSqlGuid to String.(System.Data) ***

2019-12-04 11:16:50.90 *** error: The object must implement IConvertible.(mscorlib) ***

2019-12-04 11:16:50.90 Retrieving backup settings ID: '26c94b60-7380-4ddd-8dc7-ae2ae70630c7'

2019-12-04 11:16:50.91 *** ERROR: Unable to log history / error messages.(Microsoft.SqlServer.Management.LogShipping) ***

2019-12-04 11:16:50.91 *** error: Failed to convert parameter value fromSqlGuid to String.(System.Data) ***

2019-12-04 11:16:50.91 *** error: The object must implement IConvertible.(mscorlib) ***

-----------------------------------------------------------------------------------------------------------------

Can anyone tell me what is the problem in this?

n addition, I found the following phenomena:

Column [last_backup_file], [last_backup_date] of msdb.dbo.log_shipping_primary_databases and msdb.dbo.log_shipping_monitor_primary table is not updated. It's NULL.

It seems to be related to the error message noted above.



Agent job executing proc fails with string or binary data truncated, runs without error when ran thru SSIS in agent job.

$
0
0
have a monthly sql agent job that executes a stored proc and it fails with string or binary data would be truncated error.. I restore the database and log files to a dev machine to get back to the point in time when the failure happens and the proc runs successful from SSMS. The proc will run successfully if ran as an execute sql task in SSIS via agent job.  I tried adding SET TEXSIZE -1 to see if it was failing due to the agent job itself but it still failed. This is on a 2008 R2 standard edition server. Anyone have any ideas?

Is mssql-jdbc-7.4.1.0.jre8.jar supported to run on Java 11?

$
0
0
The system requirements at https://www.microsoft.com/en-us/download/details.aspx?id=58505 state "mssql-jdbc-7.4.1.0.jre8.jar requires aJRE of 8 and supports the JDBC 4.2 API". What does "JRE of 8" mean? Can we claim that this is supported because of backward compatibility of JRE11 to JRE8? Our tests run successfully with mssql-jdbc-7.4.1.0.jre8.jar on JRE11, but we are wondering if this is endorsed by Microsoft.

Compatibility Issues

$
0
0

Hi experts,

I just clicked my setup.exe in order to install sql, and I get the below pop up:

This is

Windows Server 2012 R2 Standard

with this ISO I am using:

SW_DVD9_SQL_Svr_Developer_Edtn_2008_R2_English_MLF_X16-29684

I am trying to install SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) (64-bit)

I have clicked 'run the program without getting help' and I got this screen

Any clues?

ps: I know sql 2008 r2 in windows 2012 is not the ideal, but I have checked and it can support it.

Tempdb growth

$
0
0
Hello, we don't have a proper monitor to alert us on tempdb growth. We are using SQL 2016 Ent edition. We are not sure if tempdb growth alert will add any value. We already have disk space alerts. If tempdb grows, based on disk space alert we can see what's going on. Trying to decide if we need to monitor tempdb growth as well. Will it add any value? Thanks.

sqldev

SQL Server service account registering SPN weirdness

$
0
0

Hello.

We have stood up a new AD Site.  In that site we have some new SQL servers.

We've given the SQL Server service account permissions to Read ServicePrincipalName and Write ServicePrincipalName.  When SQL starts it does so.  SetSPN -L shows the SPNs are present.  However, trying to connect to SQL from a different AD Site fails with the "Cannot generate SSPI Context" error.

Here's the really weird part...

Running SetSPN -S on the same SQL Server service account using my Domain Admin account, comes back with "Updated object" and fixes the issue.  Then everything works fine.

Also, setting SQL to run as Local System works as well.

At this point just trying to understand what could be different with this new site.  Any ideas are welcome.

Thank you.



Windows 2019 + WSUS + SQL Server 2019 on Linux

$
0
0

Hello, I want to setup a WSUS server on a Windows Server 2019 server with a remote SQL Server 2019 database running on RHEL 7.7.

Both servers are up and running, I can connect to the SQL database from the Windows Server with SSMS using SQL Server Authentication.

However, I am unable to setup the WSUS as I don't know how to tell him to use the SQL Server Authentication instead of Windows authentication. I don't think the issue comes from the Linux part but from the fact I do not have an Active Directory.

Can anyone help me ? I don't have much Windows or SQL Server knowledge.

Thanks

-- Eric.

SQL 2014 Applying SP3 Failed with "Cannot find the login '##MS_SSISServerCleanupJobLogin##' because it does not exist or you do not have permission."

$
0
0

SP# on 2014 Failed with

"Cannot find the login '##MS_SSISServerCleanupJobLogin##' because it does not exist or you do not have permission."

I had to use -T902 to get server back up 

I have already tried Dropping and re-adding the Login ##MS_SSISServerCleanupJobLogin## and the SSISDB user 

Ideas?

Transaction started in Stored Procedure 'leaked' after Timeout/deadlock?

$
0
0

Hi,

I noticed that when I execute a SP that starts a transaction and commit/rollback later, but a Timeout or Deadlock happens before the Commit/rollback, then the transaction is still open.

Is this indentional, or can this behavior controled?
After all, as far as I know, wenn no or any other kind of exception, happens while the SP is executed, than the transaction is rolled back when the transaction is started in the SP but not completed.

lways ON - BAG on Sql 2016 - TLog

$
0
0
We have setup Always ON - BAG on Sql 2016 standard edition.
Currently both the Primary and Secondary Database in synchronized state.
Now, We have also Backup job setup on Primary as Full backup Nightly and Transaction Log backup every an 1 hour.
When i was reading Synchronization process for AG, by default it's every 10 sec (session time out).
Question is:
1) Is it it's automatically running TLog job to synchronize the Secondary?
Do we need our TLog backup job then?

2) Is it any LSN break issue happens any time?

If Primary Breaks down and it's automatically makes Secondary as Primary then whatever activities happens on Secondary while Primary is dowwn then how the Primary is synchronizing when it's get back on line?
Is it also starts TLog Synchronization from Secondary to Primary suring that time or we will lose the data?

SQL Server Agent Job Notifications Not Working

$
0
0
We have successfully setup Database Mail, and I am able to right click and 'Send Test E-Mail' and it works perfect. We have a few jobs setup in SQL Server Agent, and if the job fails it should e-mail us. Recently a job failed, but no e-mail. So I looked at the job log and see:

NOTE: Failed to notify 'Development' via email.

I confirm under Operators we have `Development` with the e-mail address I would like the error message to go to. Any ideas what would cause this?
Viewing all 15889 articles
Browse latest View live