One fine morning, users started complaining my SQL server instance performance…They sent me a screenshot which indirectly says, their queries have timed out. I quickly logged in and checked if there are any blocks. SELECT*
FROMsysprocesses
WHEREblocked<>0
There were several blocks caused by a naughty spid 80.
When I checked DBCC INPUTBUFFER(80), To my surprise, I got below scary result.
Below query in that forum helped me identify the process and query causing the blocks. It was a select query. SELECTc.session_id,
c.properties,
c.creation_time,
c.is_open,
t.text
FROMsys.Dm_exec_cursors(80)c
CROSSapplysys.Dm_exec_sql_text(c.sql_handle)t
The value 80 was my blocking process spid here. You will have to replace that with your blocking spid. Share the output with the application developers to help them prevent this from happening in future.
session_id – properties – creation_time – is_open text
80 – API | Dynamic | Scroll Locks | Global (0) – 2013-06-18 20:34:19.357 – 1 – (@1 int)SELECT * FROM [xxxxxxx] WHERE [aid]=@1
Technology enthusiast Sherbaz is a Microsoft certified SQL Server Subject Matter Expert. He had fun automating day to day task to achieve management goals. He has extensive hands-on experience in high availability deployments and support with several years of industry experience performing SQL Server installations, configuration, maintenance, backups, performance tuning, Transactional & P2P replication, migration, high availability solutions (Always on, Failover Clustering, Logshipping and Mirroring) and Disaster recovery.
Sherbaz also has basic hands-on experience in other DBMSs like MongoDB, Oracle 9i, 10g, Sybase and MySQL. 1 year on Mongodb, Oracle 9i & 10g. Completed M102 & M202 courses in MongoDB.
Sherbaz spends his spare time with automation in electronics, embedded system circuits and IOT in his private lab at home.
Also, he supports his customers and users at www.SplitExpense.in for issues with app, website or telegram chat bot @SplitExpenseBot https://t.me/SplitExpenseBot. @TheSherBot https://t.me/TheSherBot is another telegram chat bot, partially artificial intelligent, programmed and maintained by him on python and backend Mongodb database.
Sherbaz always showed interest learning new technologies and to think out of the box bringing innovation in work. Some of his work is documented @ www.sherbaz.com.
He is now busy learning 3D modeling software on his roadmap towards building his next hobby build, A 3D PRINTER.
Subscribe to his youtube channel
https://www.youtube.com/c/SherbazMohamed/
View all posts by Sherbaz