A logical log reaching 100% usage does not necessarily indicate a database problem. In GBase Database (GBase 8s), the real warning sign is the log status flag, not the usage percentage. Understanding the difference helps DBAs avoid false alerts and identify actual logical log risks.
1. Why %used=100 Is Normal
Today's small lesson comes from onstat -l.
onstat -l | grep "U--" | grep -v C
When a logical log reaches %used=100, it simply means the log has been fully written. A logical log normally switches after it fills, so this percentage alone does not indicate a failure.
The actual risk is hidden in the status flags.
A growing number of U-- logs (used but not backed up) can eventually cause the GBase Database instance to hang and block write operations.
Think of it this way:
-
%usedtells you how much of the log has been written. - Status flags tell you what state the log is in.
Confusing these two creates unnecessary alerts and makes normal database operations look like failures.
2. Understand the Logical Log Flags
Several logical log states look similar but have completely different meanings.
| Flag | Meaning | Monitoring action |
|---|---|---|
U---C |
Current log being filled | Normal |
U-- |
Used but not backed up | Requires attention |
U-B--- |
Backed up but still needed for recovery | Retain for recovery |
F------ |
Free log | Normal |
Two states deserve particular attention.
U---C: The current logical log
This is the log currently being filled. It is a normal operating condition, not an anomaly.
U--: Used but not backed up
A growing number of these logs requires investigation because accumulated unbacked-up logical logs can eventually affect database operations.
The command uses:
grep -v C
to exclude the current log from the results.
Without this filter, normal current-log activity can trigger false alerts.
3. Translate Log Flags into Readable States with SMI
Bitmask-style flags are not particularly friendly to monitoring platforms or engineers who do not work with logical logs every day.
GBase Database provides the syslogfil SMI view, which translates logical log conditions into readable states:
UsedBackedUpUsedCurrentUsedNewAdd
For monitoring purposes:
-
Used: Requires attention. -
UsedCurrent: Normal current-log activity. -
UsedBackedUp: Backed up, but may still be required for recovery. -
NewAdd: A newly added logical log state.
Using SMI queries to expose these states makes monitoring rules easier to maintain.
Instead of asking the monitoring platform to interpret bitmasks, SQL can translate the status into readable values first.
This makes GBase Database logical log monitoring more accessible and reduces the need for every team member to understand bitwise status calculations.
4. Avoid a Common grep Monitoring Mistake
There is another easy-to-miss problem in shell-based monitoring.
Consider this command:
onstat -l | grep "U--"
It also matches U---C, because the current log contains the U-- pattern.
The result? A monitoring script may repeatedly report an abnormal condition even when the only matching log is the current log.
The corrected command is:
onstat -l | grep "U--" | grep -v C
The exclusion is not redundant. It prevents the current logical log from being counted as an unbacked-up log requiring attention.
One practical recommendation: add a comment explaining why grep -v C is necessary.
# Exclude the current logical log to prevent false alerts
onstat -l | grep "U--" | grep -v C
Otherwise, the next engineer maintaining the script might remove the filter as an unnecessary optimization and reintroduce the false alerts.
5. Learn to Distinguish Abnormal Numbers from Abnormal States
This logical log example illustrates a broader principle of GBase Database monitoring: a number that looks abnormal does not always represent an abnormal database state.
Similar situations can occur elsewhere:
-
(CKPT REQ)inonstat -indicates a checkpoint request, not automatically an error. - Physical log
%usedand logical log status represent different things and should not be interpreted interchangeably. - A logical log at 100% usage is not necessarily a failure.
Reliable database monitoring requires understanding what each field actually represents before defining alert thresholds.
Final Takeaway
For GBase Database (GBase 8s) logical log monitoring, do not trigger alerts simply because %used reaches 100%.
Instead:
- Check logical log status flags.
- Exclude the current log (
U---C) from abnormal-state detection. - Monitor the accumulation of
U--logs. - Use the
syslogfilSMI view to translate flags into readable states. - Keep recovery-related logs such as
U-B---intact.
Reading the state correctly is more important than reacting to a number that looks alarming.
Does your GBase Database log monitoring count %used=100 as an anomaly, or does it evaluate logical log status flags?
Top comments (0)