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
RPflag (Rollback in Progress) and note the session ID:
onstat -u | grep RP
- Retrieve the SQL for that session:
onstat -g ses <sid>
Method 2: Use the Transaction Flags
- List active transactions; an
Rin the third position offlagsmeans a rollback is underway. Capture theuserthreadaddress (e.g.,686cb9e8) and the estimated remaining time (rb_time):
onstat -x | grep "A-R"
- Map the
userthreadto a session ID:
onstat -u | grep "686cb9e8"
- Then extract the SQL:
onstat -g ses <sid>
Both methods are non‑intrusive and help you pinpoint problematic SQL quickly, keeping your gbase database running smoothly.
Top comments (0)