A common GBase Database(GBase 8s) troubleshooting mistake is treating oninit -ivy and oninit -vy as interchangeable commands.
They are not.
The difference is one character: -i. But that character determines whether you initialize a database instance or simply start an existing one.
Understanding this distinction is essential for GBase Database initialization, startup, and troubleshooting.
1. What Does Each oninit Option Mean?
Before comparing the two commands, break down their options:
| Option | Meaning |
|---|---|
-i |
Initialize the instance |
-v |
Verbose mode; display initialization or startup details |
-y |
Automatically answer yes to interactive prompts |
The critical difference is -i.
oninit -ivy performs instance initialization and then starts the instance. The initialization process creates the required instance control structures, initializes reserved pages and rootdbs, and proceeds with startup.
oninit -vy does not initialize anything. It starts an instance that has already been initialized.
In short:
-
oninit -ivy: Initialize and start. -
oninit -vy: Start an existing instance.
2. When Should You Use Each Command?
The two commands belong to different stages of the GBase Database deployment lifecycle.
First initialization:
# Initialize and start the instance
[gbasedbt@localhost ~]$ oninit -ivy
Use this when creating a new instance that has not yet been initialized.
After successful execution, the instance is already started. There is no need to run another startup command.
Routine startup:
# Start an existing, initialized instance
[gbasedbt@localhost ~]$ oninit -vy
Use this when the instance has already been initialized and needs to be started.
Stop the instance:
[gbasedbt@localhost ~]$ onmode -ky
Check the current instance state:
[gbasedbt@localhost ~]$ onstat -
These commands should be treated as separate lifecycle operations, not interchangeable installation commands.
3. What Goes Wrong When You Mix Them Up?
There are two common failure scenarios.
Scenario A: Running oninit -vy on a New Instance
A new environment has been prepared, but the administrator runs:
oninit -vy
Because the instance has not been initialized, startup cannot proceed normally.
A possible error is:
shared memory not initialized
The administrator may then suspect a corrupted installation package or incomplete deployment.
But the actual problem may simply be that the initialization step was skipped.
Scenario B: Running oninit -ivy on an Existing Instance
The opposite mistake is potentially more concerning.
An administrator sees a startup issue and runs:
oninit -ivy
without first checking the instance state.
The -i option requests initialization, not routine startup. It should never be used as a generic recovery or restart command.
Depending on the instance state and execution context, the command may fail or introduce unnecessary risk to the existing environment.
Before considering any initialization or rebuild operation, verify the current instance state and confirm the target instance.
4. Check Instance State Before Running oninit
A simple state check can prevent unnecessary troubleshooting.
Start with:
onstat -
If the output reports:
On-Line
the instance is already running. Do not run another oninit command.
If the instance is stopped, confirm that it has already been initialized before choosing oninit -vy.
There is another environment-related detail worth checking.
When onstat - reports:
shared memory not initialized
it does not automatically mean the instance has never been initialized.
The current shell may be pointing to a different instance name through GBASEDBTSERVER.
Check it first:
echo $GBASEDBTSERVER
Verify that the environment variable identifies the intended GBase Database instance before deciding what to do next.
This distinction is particularly important on hosts running multiple instances.
5. A Simple Rule for Database Operations
My mnemonic is straightforward:
The i in oninit -ivy stands for initialization. Use it for the initial setup, not routine startup.
The operational sequence is:
| Lifecycle stage | Command |
|---|---|
| First initialization and startup | oninit -ivy |
| Routine startup | oninit -vy |
| Stop instance | onmode -ky |
| Verify instance state | onstat - |
| Check instance environment | echo $GBASEDBTSERVER |
One important rule: after a successful oninit -ivy, the instance is already started. Do not immediately follow it with oninit -vy.
For GBase Database(GBase 8s), initialization and startup are separate lifecycle concepts. Understanding that separation makes deployment and troubleshooting much more predictable.
6. Put the Difference in the Delivery Documentation
This distinction should not exist only in an experienced DBA's memory.
Every GBase Database delivery document should explicitly identify:
- Whether the instance has been initialized
- Which command is used for first initialization
- Which command is used for routine startup
- How to verify the current instance state
- How to confirm the target instance through
GBASEDBTSERVER
GBase Database initialization happens once, but startup happens many times.
A single missing -i can prevent a new instance from starting. An unnecessary -i can complicate operations on an existing instance.
The safest habit is simple: check the instance state first, verify the target instance, and then choose the correct command.
Top comments (0)