Menu

1 / 2

Tracking Long Transactions in GBase 8s with onstat

DEV Community·Michael·6 months ago
#mkSd29QP
#gbase#database#software#coding#enter
Reading 0:00
15s threshold

Long-running transactions can block the release of logical logs and even cause GBase 8s to enter a Blocked:LONGTX state. The built-in onstat utility provides a quick way to identify the offending transaction and extract its SQL for optimization. Here's a step-by-step walkthrough for a gbase database.

1. Check the Global Database Status

Under normal conditions, onstat - returns something like:

On-Line -- Up 35 days 16:51:16 -- 3920896 Kbytes

Enter fullscreen mode

Exit fullscreen mode

When a long transaction is detected, the status line changes to On-Line (LONGTX) and a Blocked:LONGTX warning appears:

On-Line (LONGTX) -- Up 35 days 16:41:40 -- 3920896 Kbytes Blocked:LONGTX

Enter fullscreen mode

Exit fullscreen mode

This is the first sign that something is holding a transaction open too long.

2. Inspect Transactions and Spot a Rollback

Run onstat -x to list active transactions.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.