I'm really having trouble tracking down some blocking we are experiencing.

The root blocking SPID's status is 'sleeping', the cmd is 'AWAITING COMMAND', and the sqltext is 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'.

When I view the Top Transactions by Blocked Transactions Count report, the Blocking SQL Statement is '--'.

I've performed a trace on the SQL and when the blocking happens tracing the root blocking SPID but it hasn't really led me anywhere.  The last trace statement is the same as the sqltext above 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'.

I've checked all the related SPROCs I can find to make sure they have TRY/CATCH BEGIN TRAN/COMMIT TRAN/ROLLBACK TRAN statements (we use SPROCs for everything so there are no standalone statements being ran).  This issue just started happening over the last 24 hours and no one is claiming to have made any changes to the system.

Solution.  One of our seldomly used SPROCs had an error with an insert (number of columns didn't match), but we are still confused on what exactly was happening.

When looking at all the trace information, the EXEC statement for this SPROC was listed at times, but NEVER just before the BLOCK happened on the blockking SPID.  It seemed that when it starting blocking, the trace didn't record the execution of it (or any of the statements within it either).  However there are other times were the trace did record it's execution and no blocking occurred.

The SPROC error report came from a user, and I was able to find multiple EXEC statements in traces and run them in SSMS.  No time when I ran them did we have any blocking occur or did they hang.  They ran as expected (the catch block fired and rolled back the transaction after the error).  After resolving the fixing the SPROC, we have not seen the issue again.


Question: Bash - use loop to make backup script more efficient
Answer: #!/bin/bash
MAX=29

for i in `seq 1 $MAX` 
do 
    echo " check file exists directory.$i"
    echo "mv directory.$i to directory" `expr $i - 1`
done


This might be a good starting point