Seeing On-Line in onstat - does not guarantee that database storage is healthy. In GBase Database (GBase 8s), instance status and storage health are two separate things, and both need independent checks.
Today's lesson is about an easily overlooked part of database health checks: storage diagnostics.
1. Check Storage Even When the Instance Is On-Line
Start with two basic commands:
onstat -d | grep PD # Down chunks
onstat -l | grep "U--" | grep -v C # Used, not backed-up logs
A running instance can still have serious storage problems:
- Down chunks: Data on the affected chunk may become inaccessible, affecting tables and business operations.
- Dbspace approaching capacity: Inserts, sorts, and other database operations may start failing.
- Accumulated logical logs: A growing number of unbacked-up logs can eventually prevent normal database operations.
None of these conditions is adequately represented by the instance status alone.
On-Line tells you that the database instance is running. It does not tell you whether every chunk is available, whether dbspaces have sufficient capacity, or whether logical logs are accumulating.
That's why GBase Database health checks need a separate storage inspection step.
2. Use the Right Diagnostic Entry Point
GBase Database (GBase 8s) provides different tools for different diagnostic situations.
| Tool | What to check | Purpose |
|---|---|---|
onstat - |
Instance status | Check whether the instance is running |
onstat -d |
Dbspaces and chunks | Identify storage availability problems |
onstat -l |
Logical logs | Check log states and backup conditions |
| SMI queries | Storage usage and readable states | Generate monitoring reports |
The important distinction is that onstat commands read instance information directly, while SMI queries require a database connection through dbaccess to sysmaster.
For example:
dbaccess sysmaster -
This difference becomes especially important during incidents.
3. Understand Why onstat Matters During Connection Failures
When the database is healthy, both onstat and SMI queries are useful.
However, when the instance is hung or database connections are unavailable, SMI queries may no longer be accessible.
In that situation, repeatedly retrying dbaccess wastes valuable troubleshooting time.
Use onstat first to collect evidence:
onstat -
onstat -d
onstat -l
These commands do not require a database connection through dbaccess, making them valuable for initial diagnosis when connectivity is abnormal.
A practical diagnostic sequence is:
When the instance is healthy:
- Check instance status with
onstat -. - Inspect chunks and dbspaces with
onstat -d. - Check logical log states with
onstat -l. - Use SMI queries for readable utilization reports.
When the instance is unhealthy or connections fail:
- Collect instance information with
onstat. - Check chunk availability.
- Inspect logical log states.
- Preserve the output for further investigation.
- Do not depend on SMI queries if the required database connection is unavailable.
Choosing the correct diagnostic entry point is often more important than running more commands.
4. Archive Health-Check Results with Timestamps
A single health-check result only describes one moment.
For example, On-Line today does not tell you whether logical logs have been accumulating over the past three days.
Archive the output of routine checks with timestamps:
#!/bin/bash
CHECK_TIME=$(date '+%Y-%m-%d %H:%M:%S')
echo "===== GBase Database Health Check ====="
echo "Time: $CHECK_TIME"
echo
echo "===== INSTANCE STATUS ====="
onstat -
echo
echo "===== STORAGE STATUS ====="
onstat -d
echo
echo "===== LOGICAL LOG STATUS ====="
onstat -l
Save the results regularly so engineers can compare historical states.
With archived records, you can identify:
- When a chunk first entered the Down state.
- Whether logical logs are accumulating over time.
- How quickly dbspace usage is increasing.
- Whether an apparently healthy instance is developing storage risks.
The value of storage monitoring is not limited to detecting current problems. Historical records help reveal how those problems develop.
5. Separate Detection from Remediation
A health-check script should identify abnormal conditions, not automatically execute corrective operations.
Its responsibilities should include:
- Detecting Down chunks.
- Identifying high dbspace utilization.
- Monitoring unbacked-up logical log accumulation.
- Reporting Disabled dbspaces.
- Preserving diagnostic evidence.
Storage expansion, logical log configuration changes, and long-transaction handling should follow separate operational procedures with appropriate assessment and change controls.
This separation makes GBase Database operations more predictable and reduces the risk of unnecessary actions during an incident.
Final Takeaway
A reliable GBase Database health check cannot stop at onstat -.
Instance status and storage health are different dimensions. A database can be On-Line while storage risks are accumulating, and a database that cannot accept connections may still provide valuable diagnostic information through onstat.
Remember these principles:
- Check instance status and storage health separately.
- Use
onstatfor initial diagnostics when connections are unavailable. - Use SMI for readable storage reports when the database connection is available.
- Archive check results with timestamps to identify trends.
- Keep anomaly detection separate from corrective actions.
Does your GBase Database health-check script still collect useful diagnostic evidence when the instance hangs or database connections fail?
Top comments (0)