Summary: Learn how to interpret both sections of onstat -d in GBase Database(GBase 8s), understand the relationship between dbspaces and chunks, calculate actual storage utilization, and identify unavailable chunks before making capacity decisions.

Today I'm documenting a command that is easy to misread: onstat -d.

In GBase Database(GBase 8s), this command displays two sections: Dbspaces first, Chunks second. Many engineers look at the free column in the second section, conclude that storage capacity is sufficient, and overlook the structural information in the first section.

The correct reading order is important: check chunk availability first, understand the dbspace structure second, and evaluate free space last.

1. Dbspaces: Understand Which Storage Spaces Exist

The first section of onstat -d lists the dbspaces configured in the instance.

Example output:

address number flags fchunk nchunks pgsize flags owner name 4550b028 1 0x70001 1 1 2048 N BA gbasedbt rootdbs 47805258 6 0x60001 6 1 16384 N BA gbasedbt datadbs01 6 active, 2047 maximum 

For GBase Database dbspace monitoring, pay particular attention to four fields:

  • number: The dbspace number.
  • fchunk: The first chunk number belonging to the dbspace.
  • nchunks: The number of chunks associated with the dbspace.
  • pgsize: The page size used by the dbspace.

The name column identifies the dbspace, such as rootdbs or datadbs01.

The nchunks value tells you how many physical storage units belong to a logical dbspace. The pgsize value tells you the page size.

An important detail: dbspaces with different page sizes cannot simply be mixed. Page size is a design decision that should be verified when creating storage spaces.

2. Chunks: Find Physical Files and Available Capacity

The second section lists the physical chunks associated with dbspaces.

Example:

address chunk/dbs offset size free bpages flags pathname 4786f028 6 6 0 246366 178082 PO-BE- /opt/gbase/data/datachk01 6 active, 32766 maximum 

This section answers two practical questions:

  1. Where is the physical storage located?
  2. How much capacity remains available?

The important fields are:

  • chunk/dbs: Identifies the chunk number and its owning dbspace number.
  • size: Total chunk size, measured in pages.
  • free: Available space, measured in pages.
  • pathname: Physical file or device path.

Do not read size and free as KB.

Both values are expressed in pages. To calculate actual capacity, multiply the page count by the page size of the owning dbspace.

For example, if the page size is 16 KB and free is 178082:

178082 × 16 KB = 2,849,312 KB ≈ 2.72 GiB 

The utilization formula is:

Utilization = (size - free) / size × 100% 

This gives you the actual percentage of allocated chunk capacity currently in use.

Getting the unit wrong can lead to serious mistakes in GBase Database storage capacity planning.

3. Understand the Relationship Between Dbspaces and Chunks

The two sections are not independent. They describe different levels of the same storage structure.

In the Dbspaces section:

  • fchunk identifies the first chunk number.
  • nchunks indicates how many chunks belong to the dbspace.

In the Chunks section:

  • The first number in chunk/dbs is the chunk number.
  • The second number is the owning dbspace number.

For example:

Dbspaces: number = 6 fchunk = 6 nchunks = 1 name = datadbs01 Chunks: chunk = 6 dbs = 6 pathname = /opt/gbase/data/datachk01 

Following these identifiers lets you move in either direction:

  • From a dbspace to its physical chunk.
  • From a physical chunk back to its owning dbspace.

This relationship is essential when investigating storage growth or unavailable chunks in GBase Database.

4. A Falling Free Value Does Not Always Mean Business Data Is Growing

Another common troubleshooting mistake is assuming that every reduction in free space comes from business table writes.

Different workloads consume different storage areas:

  • Business table and index writes consume their assigned dbspaces.
  • Temporary sorting operations use temporary storage.
  • Physical and logical logging consume their respective log spaces.
  • Large object writes consume their designated storage spaces.

With a properly layered storage architecture, engineers can identify which category of workload is consuming capacity.

When everything is placed in rootdbs, storage attribution becomes much harder.

This is why GBase Database dbspace management should be considered part of the initial architecture design rather than an afterthought.

5. Automate Basic Chunk and Capacity Checks

The text-based output of onstat -d makes basic storage monitoring straightforward.

A simple health-check workflow can include three steps:

  1. Check for unavailable chunks.
  2. Extract free-space information for each dbspace.
  3. Record the results in a monitoring log.

Start with this command:

onstat -d | grep PD 

Any matching output should trigger immediate investigation of the affected chunk.

An unavailable chunk can make the data stored on it inaccessible and may affect the availability of dependent objects. This should take priority over routine capacity warnings.

For production monitoring, do not rely on a single grep result alone. Check the complete chunk status and investigate the associated dbspace before determining the impact.

Because onstat -d reports instance storage information directly, it does not require an application database connection. This makes it useful during connection failures and other unhealthy-instance scenarios, provided the instance is still responsive to the command.

6. My Recommended onstat -d Reading Order

When troubleshooting storage in GBase Database(GBase 8s), I follow this sequence:

Step 1: Check chunk availability

onstat -d | grep PD 

Rule out unavailable chunks before investigating ordinary capacity issues.

Step 2: Read the Dbspaces section

Check pgsize, fchunk, and nchunks to understand the storage structure.

Step 3: Read the Chunks section

Check size, free, and pathname to identify physical capacity and storage locations.

Step 4: Calculate utilization

Convert pages into actual storage units and calculate the utilization percentage before making expansion decisions.

The principle is simple: check availability before capacity, and understand structure before interpreting numbers.

onstat -d may look dense at first, but once you understand the relationship between dbspaces and chunks, storage diagnosis becomes much faster.

For GBase Database administrators, it is one of the most useful commands to keep at the beginning of a storage troubleshooting workflow.