"Can't connect" is one of the most common problems in database operations. But a connection failure is a symptom, not a root cause.
In GBase Database(GBase 8s), the cause may exist in three different layers:
- Instance state
- Machine resources
- Network and authorization
Checking these layers in the right order can save significant troubleshooting time and prevent unnecessary configuration changes.
1. Layer One: Check the Database Instance State
Start with:
onstat -
Look for the instance status in the output:
- On-Line: The instance is running normally.
- Quiescent: The instance is in an administrative state. Check whether planned maintenance is underway.
- Fast Recovery: The instance is performing recovery operations.
- shared memory not initialized: The instance may not be started, or your environment may be pointing to the wrong instance.
For example:
shared memory not initialized for GBASEDBTSERVER 'gbase01'
This message does not automatically mean a network failure. First verify whether the instance is running and whether GBASEDBTSERVER points to the intended instance.
Why check this layer first?
onstat - reads local instance information without requiring a database connection. It provides immediate evidence about the instance state, even when remote clients cannot connect.
There is little value in changing network settings when the database instance itself is not ready.
2. Layer Two: Check Machine-Level Resources
If the instance cannot start or its status indicates a startup problem, investigate operating system resources.
Run:
onstat -g osi | grep -E 'System memory|System free memory|shmmax|shmids'
Pay attention to:
-
System memory: Total system memory -
System free memory: Available system memory -
shmmax: Maximum shared memory segment size -
shmids: Shared memory identifiers
Insufficient shared memory resources or semaphore settings can prevent GBase Database from starting successfully.
This is why changing database parameters without checking the machine layer can send troubleshooting in the wrong direction.
The key question is whether the operating system provides the resources required by the database instance.
3. Layer Three: Check Network and Authorization
Only after confirming that the instance is running and machine resources are sufficient should you investigate connectivity configuration.
For GBase Database(GBase 8s), check the following:
Instance name and listener configuration
Verify that the server name in sqlhosts matches the intended DBSERVERNAME configuration.
Network address and port
Confirm that the configured hostname, IP address, and service port correspond to the actual listener configuration.
Connection authorization and limits
Check whether the client is authorized to connect and whether the instance's connection capacity is sufficient.
These checks help distinguish network configuration problems from authorization or connection-limit issues.
Editing sqlhosts repeatedly without first confirming the instance state is a common source of wasted troubleshooting effort.
4. Why the Diagnostic Order Matters
The three layers are not interchangeable. Each one answers a different question.
| Diagnostic layer | Main question | First command |
|---|---|---|
| Instance state | Is the database running and ready? | onstat - |
| Machine resources | Can the operating system provide the required resources? | onstat -g osi |
| Network and authorization | Can the client reach and access the instance? | Configuration and connectivity checks |
The order matters for three reasons:
- Instance state comes first: It provides local evidence without requiring a network connection or successful database authentication.
- Machine resources come second: If the instance cannot start because of resource constraints, network troubleshooting will not solve the problem.
- Network and authorization come last: These checks become meaningful once the instance is running and ready to accept connections.
Consider a typical troubleshooting scenario: an engineer edits sqlhosts four times, changes connection settings, and checks client permissions, only to discover that the instance has been in Fast Recovery all along.
The problem was not the network. The diagnostic order was wrong.
5. Preserve Evidence Before Making Changes
One additional practice makes troubleshooting much more reliable: separate diagnosis from corrective action.
Before changing parameters or restarting services, archive the complete output of the relevant diagnostic commands.
This creates a baseline for before-and-after comparison and helps the team understand what actually changed.
For GBase Database operations, this is particularly important when multiple engineers share on-call responsibilities. Without recorded evidence, a corrective action can remove useful clues about the original problem.
Conclusion: Diagnose from the Instance Outward
When troubleshooting GBase Database connection failures, follow this sequence:
-
Instance: Check
onstat -to understand the current database state. -
Machine: Check
onstat -g osito investigate operating system resources. -
Network: Verify
sqlhosts, listener configuration, connection authorization, and limits.
The objective is not to memorize more commands. It is to identify the correct diagnostic layer before taking action.
A connection failure does not always mean a network problem. Sometimes the fastest way to fix connectivity is to stop checking the network first.
When your team encounters a GBase Database connection failure, which layer do you investigate first: instance state, machine resources, or network configuration?
Top comments (0)