Warning: Constant WP_TEMP_DIR already defined in /var/www/html/blogs/glenn/wp-config.php on line 94

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/glenn/wp-config.php:94) in /var/www/html/blogs/glenn/wp-includes/feed-rss2-comments.php on line 8
Comments on: SQL Server Diagnostic Information Queries for November 2014 https://www.sqlskills.com/blogs/glenn/sql-server-diagnostic-information-queries-for-november-2014/ Semi-random musings about SQL Server performance Tue, 09 Oct 2018 16:40:36 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Joe https://www.sqlskills.com/blogs/glenn/sql-server-diagnostic-information-queries-for-november-2014/#comment-192980 Thu, 24 Sep 2015 15:36:56 +0000 http://3.209.169.194/blogs/glenn/?p=923#comment-192980 Glenn
In SQL Server 2012 there are a few of the scripts that now return results that when I copy and paste them into Excel they data from query_text for example is pasting down across multiple Excel rows.
The (Query Execution Counts) for example.

I added the REPLACE(..statement…., CHAR(13) + CHAR(10), ‘ ‘) as query_text to band aid this issue. I was curious if you were doing something different to not have this issue.

Thanks.

]]>
By: Muhammad Asam https://www.sqlskills.com/blogs/glenn/sql-server-diagnostic-information-queries-for-november-2014/#comment-113783 Fri, 21 Nov 2014 14:25:26 +0000 http://3.209.169.194/blogs/glenn/?p=923#comment-113783 In reply to Glenn Berry.

Thanks Glenn,

As per policy we have 12 log file which is sufficient for us to identify/debug any issue.
As mentioned earlier, daily recycle overwrites older logs and server is up and running much more than 12 days.
Do you see any issue with this strategy? or any other related tip please.

Again thanks for reply.

Kind Regards.

]]>
By: Glenn Berry https://www.sqlskills.com/blogs/glenn/sql-server-diagnostic-information-queries-for-november-2014/#comment-111996 Wed, 19 Nov 2014 15:41:14 +0000 http://3.209.169.194/blogs/glenn/?p=923#comment-111996 In reply to Asam.

I would be curious whether the words “detected” or “socket” show up in any of your error logs. Probably what is happening is that your servers have been running long enough that the actual startup information from the original error log when SQL Server started has been overwritten as you recycle the log every day.

]]>
By: Asam https://www.sqlskills.com/blogs/glenn/sql-server-diagnostic-information-queries-for-november-2014/#comment-111444 Tue, 18 Nov 2014 22:37:14 +0000 http://3.209.169.194/blogs/glenn/?p=923#comment-111444 — Get socket, physical core and logical core count from (Query 12) (Core Counts)
— SQL Server Error log. This query might take a few seconds
— if you have not recycled your error log recently
EXEC sys.xp_readerrorlog 0, 1, N’detected’, N’socket’;

This is not returning any results on any of the servers. We have SQL Server 2012 Standard edition where we cycle the logs every day.

Glenn, Any reason/fix in your mind. Thanks

]]>
By: Calvin Jones https://www.sqlskills.com/blogs/glenn/sql-server-diagnostic-information-queries-for-november-2014/#comment-102792 Mon, 10 Nov 2014 21:14:02 +0000 http://3.209.169.194/blogs/glenn/?p=923#comment-102792 I came across a situation where all the databases were not listed for Query #21 (Database Properties). The SQL instance had several databases with Auto Close = ON. If a database is closed, then it does not get returned by the query. I modified the query to fix this:

SELECT db.[name] AS [Database Name], db.recovery_model_desc AS [Recovery Model],
db.log_reuse_wait_desc AS [Log Reuse Wait Description],
ls.cntr_value AS [Log Size (KB)], lu.cntr_value AS [Log Used (KB)],
CAST(CAST(lu.cntr_value AS FLOAT) / CAST(ls.cntr_value AS FLOAT)AS DECIMAL(18,2)) * 100 AS [Log Used %],
db.[compatibility_level] AS [DB Compatibility Level],
db.page_verify_option_desc AS [Page Verify Option], db.is_auto_create_stats_on, db.is_auto_update_stats_on,
db.is_auto_update_stats_async_on, db.is_parameterization_forced,
db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on,
db.is_auto_close_on, db.is_auto_shrink_on, db.is_cdc_enabled
FROM sys.databases AS db WITH (NOLOCK)
LEFT JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK)
ON db.name = lu.instance_name
AND lu.counter_name LIKE N’Log File(s) Used Size (KB)%’
LEFT JOIN sys.dm_os_performance_counters AS ls WITH (NOLOCK)
ON db.name = ls.instance_name
AND ls.counter_name LIKE N’Log File(s) Size (KB)%’
AND ls.cntr_value > 0
ORDER BY db.[name] OPTION (RECOMPILE);

]]>