TAILIEUCHUNG - SQL Server Tacklebox- P27

SQL Server Tacklebox- P27: This book, as with almost all books, started out as an idea. I wanted to accumulate together those scripts and tools that I have built over the years so that DBAs could sort through them and perhaps adapt them for their own circumstances. | 5 DBA as detective one row at a time 1 000 times into the important_Data table based on random patterns for T_Desc and T_Back. It does this insert every 1 second. While doing so it explicitly locks out the important_Data table using a table hint xLock so that no other query can access the lmportant_Data table until it is complete which will not be until 1020 seconds or 17 minutes passes. Finally we have the heinous call to xp_cmdshell. Again one would think that no one would really do this in the real world. Unfortunately I know for a fact that some developers make liberal use of xp_cmdshell. Sometimes it is the path of least resistance to kicking off another process that will return a value to the calling query. But what if at some point the expected value is not returned and a dialogue box appears instead awaiting user input Suffice it to say that it would be very bad but I am getting ahead of myself. All we need to know right now is that for the sake of our example this query is happening and I do not have a few hours or soft floor and the warm blankie was wrenched from my grasp by my boss who is standing over me. So it is best to just proceed ahead to resolution. Killing the offending query At this point my goal is simply to kill the blocking SPID so that any queries backing up behind it can start to flow through. So after confirming that the business has signed off on killing the offending SPID trust me eventually you will get the OK to KILL this SPID the next step seems easy enough and the command would look something like this KILL SPID 51 And that is it right If you issue this command in SSMS you will receive the usual reassuring success message as shown in Figure . .ster sa 56 Executing. SC KILL 51 J Messages C oiLiiiiand s c omp 1 et. e d successful y Figure Killing the Bad Query process 51 . 130 5 DBA as detective However that message can be misleading. In some cases the SPID will indeed be

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.