Instance
Version, role, uptime, database sizes; WARN/FAIL when connections near the limit.
KINGBASEES · CLI DIAGNOSTICS
Command-line diagnostics for KingbaseES. One static binary runs a single read-only look at a live instance and tells you what it found, why, and which command to run next.
START WITH A QUESTION
Command examples, not captured output. Build the binary and copy it to the database host first.
# 1. What is this instance, and are connections running out?
~/kbdiag status
# 2. Is anyone waiting for a lock, and who blocks them?
~/kbdiag locks
# 3. Follow the verify line of a finding
~/kbdiag session <pid>FIND YOUR STARTING POINT
Version, role, uptime, database sizes; WARN/FAIL when connections near the limit.
Who is connected, who sits idle in transaction, and what one session is doing.
Who waits for a lock and which session directly blocks them.
Old open transactions and forgotten prepared (2PC) ones.
Sessions grouped by wait event and state.
Inactive slots that keep WAL and hold back vacuum.
LOOK · QUERY · FOLLOW
01 / LOOK
~/kbdiag status
echo $?
02 / QUERY
~/kbdiag sessions
~/kbdiag locks
~/kbdiag txn
03 / FOLLOW
verify: kbdiag session 435308
Only the binary. It speaks the wire protocol itself, so it does not need ksql or any runtime; connect over the local socket as the kingbase OS user.
No. Every connection is a read-only transaction with a lock_timeout. Suggested fixes such as ROLLBACK PREPARED are printed for you to review, never executed.
kbdiag 2.0 is a Go rewrite; this first release covers sessions, locks, transactions, waits, instance status and replication slots. The shell toolkit (v1.x) is frozen; use release v1.0.0 if you need its other commands.
Run your first checkBuild the static binary, copy it to a KingbaseES V8R6 host, and start with status and sessions.