Database storage problems rarely happen overnight. A chunk may become unavailable, a dbspace may gradually run out of space, and application read/write errors may appear only after the underlying storage problem has already developed.
In GBase Database (GBase 8s), the onstat -d command provides an important first step for identifying these storage risks.
One major advantage is that onstat -d reads instance shared memory directly and does not require a database connection. This makes it particularly useful when the instance is unhealthy and applications cannot connect.
1. Run onstat -d to Inspect Database Storage
Execute the following commands as the gbasedbt user:
onstat -d onstat -d | grep PD The first command displays dbspace information and detailed chunk records.
The output includes information such as:
- Dbspace names and configuration
- Page size (
pgsize) - Chunk ownership
- Physical chunk paths
- Chunk size (
size) - Available space (
free) - Chunk status and flags
The second command filters for PD, which indicates a Down chunk.
A Down chunk requires immediate investigation. It indicates that the corresponding storage component is unavailable and may affect database operations involving that storage.
Unlike a gradually increasing space-utilization percentage, a Down chunk represents an existing availability problem rather than merely a potential future risk.
2. Understand the Size and Free Columns
Two fields deserve particular attention: size and free.
Both values are expressed in database pages, not bytes.
To convert page counts into bytes, multiply the page count by the corresponding page size:
Space in bytes = Number of pages × Page size For example, if a chunk contains 100,000 pages and the page size is 16 KB:
100,000 × 16 KB = 1,600,000 KB This distinction matters when building storage monitoring scripts.
Treating page counts as byte values can produce incorrect capacity calculations by several orders of magnitude.
Also, interpret the flags column according to the documentation for your GBase Database version rather than relying on remembered abbreviations.
3. Identify What onstat -d Cannot Tell You
Although onstat -d is useful for inspecting database storage, it has limitations.
It does not directly provide:
- A complete dbspace usage percentage
- A detailed breakdown of which tables occupy the space
- A comprehensive storage growth trend
For more readable storage utilization information, use System Monitoring Interface (SMI) queries against sysmaster to combine chunk details with dbspace attributes.
Keep in mind that SMI queries require an accessible database connection. They should complement, rather than replace, direct onstat inspection during an instance failure.
4. Add Chunk Status Checks to Routine Monitoring
A practical GBase Database storage-check script should include the following items:
Chunk availability
onstat -d | grep PD Treat unexpected output as an alert requiring investigation.
Physical storage paths
Record the physical path of each chunk. When a storage device fails, this information helps the operations team locate the affected component more quickly.
Historical records
Archive onstat -d output with timestamps and review it regularly.
Comparing historical results helps identify gradual dbspace growth and changes in available storage capacity.
A single snapshot tells you the current state. A time series helps explain how that state developed.
5. Separate Storage Detection from Remediation
A storage health check should identify anomalies, including:
- Down chunks
- High dbspace utilization
- Disabled dbspaces
- Changes in available storage capacity
Corrective actions such as expanding dbspaces, adding chunks, or changing storage configurations should follow separate assessment and change-approval procedures.
Avoid combining detection and remediation into a single emergency script. Storage changes can affect database availability and should be performed within an appropriate maintenance window.
6. Build a More Reliable GBase Database Storage Check
The key operational practices are straightforward:
- Run
onstat -dregularly to inspect dbspaces and chunks. - Use
grep PDto identify Down chunks. - Interpret
sizeandfreeas page counts, not bytes. - Record physical chunk paths for faster fault localization.
- Archive timestamped outputs to track storage changes.
- Use SMI queries when a database connection is available and percentage-based reporting is required.
The purpose of storage monitoring is not just to measure available space. It is to identify storage risks early, preserve diagnostic evidence, and make troubleshooting repeatable.
GBase Database provides the raw storage information. Turning those readings into reliable monitoring procedures is what makes them operationally valuable.
Does your GBase Database monitoring script include onstat -d | grep PD to detect Down chunks?