Posts

Showing posts from 2011

DBCC LOGINFO on SQL 2005 causes “non-yielding processes on scheduler” errors and server timeouts

Image
If you are using DBCC LOGINFO in the production environment and you are lucky enough to still have an instance of SQL Server 2005 which, suddenly out of the blue, started throwing “non-yielding processes on scheduler” errors into the error log and becomes unresponsive, then you should know that there can be a connection between the two. It is most probably a bug in the DBCC, reproducible on SQL 2005 instances only. It’s been fixed for SQL 2008 and up. Maybe this is one of the reasons why this DBCC is undocumented… I have the following procedure which loops through all the databases and checks the number of VLFs (virtual log files - logical sections in the transaction log file allocated each time a log growth occurs). It’s using an undocumented, but very useful for this purpose, DBCC LOGINFO. Unfortunately, there was a database snapshot on the server and the procedure got executed there as well as on other databases (not on purpose, of course, just used sp_msforeachdb procedure with...

Easy load testing using Management Studio

Image
There is an easy way to open several connections to your SQL Server in order to perform load testing. You can use Management studio "Multiple Server Query Execution" feature. This feature is usually used to run the same query against multiple servers but we also can use it for a load or stress testing. In the registered servers tab create a group with the same name as your server that you are planning to use for the load testing. Inside the group create 10 or more connections to the same server, just making sure that in the server alias field you add number to your server name otherwise Management Studio will not allow to create two server connections with the same alias. Easy way to add multiple connections is by editing Management Studio connections xml file that you can find in "C:\Users\<> \AppData\Roaming\Microsoft\Microsoft SQL Server\110\Tools\Shell\RegSrvr.xml", you can simply copy the connection multiple times, still changing alias name for each ne...

PASS 2011 summit excitement

Image
The PASS summit is an amazing event, it is fantastic to see more than 4000 SQL Server DBAs and BI developers from all over the world at the one place. Everyone here is talking SQL, joking SQL and breezing SQL. The most terrific thing about an SQL Server DBAs is that crazy and passionate light in their eyes when they talk about their job and an SQL Server in general. I'm very new to the twitter world but here everything that happens on summit is always commented on twitter ( note the big screen on the photo - it's all twitting) , all the tricky questions and the funny remarks during the sessions, mentors criticizing notes and, of course, "thank you very much for a great session" comments as well as all activities like #sqlrun in the morning, #sqlawards , #sqlquiz and #sqlclinic during the day and #sqlkaraoke in the evening. Second day of the PASS was #sqlkilt day, many #sqlpeople were going around in kilts. It's quite difficult to choose which lecture to attend...

DDL Triggers and SET options

I have just had an unforgettable experience with DDL triggers and, as far as I see on Google search, I'm not alone. DDL triggers, as you know, fire stored procedure in a response to server or database DDL events, like metadata or security changes. We use them to track changes on publishing server (those changes that replication cannot take care of) and apply them on subscriber. So, DDL triggers procedure writes statement into Statement table and other process later is executing them on subscriber. Here is a code of DDL trigger and statements logging table below. ################################################################################ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE dbo . DDLOutput ( ID int IDENTITY ( 1 , 1 ) NOT NULL, DateAdded datetime NULL, EventType nvarchar ( 255 ) NULL, DatabaseName sysname NULL, ...