Skip to content

KINGBASEES · CLI DIAGNOSTICS

kbdiag A verdict, the evidence, the next step

Read-only diagnostics for KES V8R6 + V9. One static binary, 17 canonical commands: a verdict, the evidence and the next step.

START WITH A QUESTION

What is this instance? Is anything stuck?

Command examples, not captured output. Build the binary and copy it to the database host first.

What is this instance? Is anything stuck?
kbdiag status
kbdiag check --html ./patrol.html
kbdiag lock --tree
kbdiag session <pid>
kbdiag sql top

FIND YOUR STARTING POINT

17 commands, six groups

LOOK · QUERY · FOLLOW

Every finding tells you where to look next

01 / LOOK

Start with the facts

  • Is the instance reachable? What is its role? Are connections running out?
  • The exit code carries the verdict: 0 OK, 1 WARN, 2 FAIL, 3 UNKNOWN.
kbdiag
~/kbdiag status
echo $?

02 / QUERY

Look at one dimension

  • Choose by scope: instance, current database or esrep metadata.
  • Missing, masked and inapplicable evidence stay distinct.
kbdiag
kbdiag session waits
kbdiag lock --tree
kbdiag sql show --id=-123

03 / FOLLOW

Follow the next steps

  • Findings suggest a follow-up verification command or remediation action for review.
  • Suggested fixes are printed, never run.
kbdiag
verify: kbdiag session 435308

Before you start

What do I need on the database host?

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.

Can it change my database?

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.

Which versions are supported?

KES V8R6 + V9, with SQL selected by capability. cluster checks repmgr topology separately.

Run your first checkCopy the binary to a KES V8R6 or V9 host, start with status, then save an offline report with check –html.