Quickly identifying transactions that are rolling back is essential for diagnosing blocking and assessing impact. These two onstat chains give you the session ID and the running SQL in seconds.
Method 1: Find Sessions with the RP Flag
Look for sessions with the RP flag (Rollback in Progress) and note the session ID:
onstat -u | grep RP
Enter fullscreen mode
Exit fullscreen mode
Retrieve the SQL for that session:
onstat -g ses <sid>
Enter fullscreen mode
Exit fullscreen mode
Method 2: Use the Transaction Flags
List active transactions; an R in the third position of flags means a rollback is underway.…