Skip to main content
Version: v5.6.1

opschain admin database status

Included from Basic tier

The database health snapshot — a GET of /api/admin/database. The header line names the backend, whether scheduled maintenance is enabled, the analyze interval and the vacuum day/window (all from config.yaml's database.maintenance block). Then one row per tracked table: total size, live and dead tuples, and the most recent analyze and vacuum — manual or auto, whichever is later, with auto-runs marked (auto). On SQLite the header adds the database file size and free bytes. The footer lists the last recorded maintenance runs (task, finish time, duration, statements, failures), or no maintenance runs recorded yet.

Read it before and after an on-demand run: a high dead-tuple count that an admin database vacuum does not bring down, or never in the LAST ANALYZE column on a hot table, is what the on-demand verbs exist for.

Flags​

FlagMeaning
--server <url>Server base URL (default: the active context / OPSCHAIN_SERVER).
--auth-token <token>Admin bearer token override (default: your opschain login session, then $OPSCHAIN_ADMIN_TOKEN, then the token stored by opschain admin login).

-o json|yaml prints the raw status document.

Exit codes​

CodeMeaning
0Snapshot fetched.
1Request failed, non-2xx response, or the token was rejected.
2Usage error — no server or no credential resolvable.

Named errors​

  • a server is required — pass --server <url>, set OPSCHAIN_SERVER, or 'opschain context use <name>' — exit 2.
  • this command needs a login or an admin token — run 'opschain login', pass --auth-token, set OPSCHAIN_ADMIN_TOKEN, or store one with 'opschain admin login' — exit 2.
  • the server rejected the credential — run 'opschain login' again, or check the admin token — HTTP 401 (exit 1).

Examples​

opschain admin database status
backend: postgres scheduled maintenance: enabled analyze every 30m vacuum sunday 02:00-04:00
TABLE SIZE LIVE DEAD LAST ANALYZE LAST VACUUM
steps 42.3MB 81204 1532 2026-10-14T02:30:00Z 2026-10-12T02:10:11Z (auto)
last analyze: finished 2026-10-14T02:30:00Z in 412ms over 9 statement(s), 0 failure(s)

See also​

  • opschain docs cli/admin-database-analyze and opschain docs cli/admin-database-vacuum — act on what the snapshot shows.