Many engineers assume that uninstalling GBase Database(GBase 8c) requires only one command. In fact, a complete uninstall involves two separate operations.

The first removes the database cluster. The second clears the Distributed Configuration Store (DCS).

Skipping the second step may leave stale cluster metadata behind, even when the uninstall command reports success.

Here is the correct procedure for a complete GBase Database uninstall.

1. Before Uninstall: Verify Your Backup

Before executing any uninstall command, make sure you have a backup that has been successfully verified as readable.

A completed backup job does not automatically guarantee recoverability. Confirm that:

  • The backup files exist.
  • The files are readable and intact.
  • The backup path is correct.
  • The required permissions are available.

Important: GBase Database uninstall is an irreversible operation. The DCS destruction command has no rollback mechanism.

Do not proceed until backup verification is complete.

2. Step One: Uninstall the Database Cluster

Execute the following command to uninstall the GBase Database cluster:

gha_ctl uninstall -c gbase -l http://10.x.x.6:2379 

Replace 10.x.x.6 with the actual DCS address used by your deployment.

This command handles the cluster uninstall operation, including its instances and configuration.

A successful execution returns:

{"ret":0,"msg":"Success"} 

However, this only confirms that the cluster uninstall command completed. It does not mean that all DCS metadata has been removed.

3. Step Two: Destroy DCS Metadata

After uninstalling the cluster, clear the DCS metadata separately.

First, enter the package script directory:

cd /home/gbase/gbase_package/script 

Then execute:

./gha_ctl destroy dcs -l http://10.x.x.6:2379 

A successful execution returns:

{"ret":0,"msg":"Success"} 

Why is this second command necessary?

GBase Database separates cluster management from its distributed metadata service.

  • gha_ctl uninstall handles the database cluster and its configuration.
  • gha_ctl destroy dcs removes the corresponding DCS metadata.

If you skip the second operation, DCS may retain stale cluster information after the database instances have been uninstalled.

Note: Run the second command from the script directory. Executing it elsewhere may result in the command not being found.

4. Why Is One DCS Address Enough?

The command requires a DCS endpoint, for example:

-l http://10.x.x.6:2379 

You do not need to manually execute the same operation against every DCS node. The command communicates with the DCS service through the specified endpoint.

Environment variables are also cleared automatically as part of the uninstall process.

5. Post-Uninstall Verification

A successful return code does not necessarily mean the host environment is completely clean.

After uninstalling GBase Database(GBase 8c), verify three areas.

1. Processes

Check whether any database-related processes remain:

ps -ef | grep -E 'gaussdb|gha_ctl' 

Review the output carefully and distinguish actual processes from the search command itself.

2. Directories

Check the installation directory and package-related locations for residual files.

Do not remove directories blindly. Confirm that they belong to the uninstalled cluster and are no longer required.

3. Ports

Check whether previously used service ports are still occupied:

ss -tlnp 

Investigate any remaining listeners before considering the environment clean.

The key distinction is simple: a successful uninstall command confirms that the requested operation completed; post-uninstall verification confirms that no unintended resources remain.

6. A Practical Uninstall Checklist

Before closing the change ticket, confirm the following:

  • [ ] Backup completed and verified readable.
  • [ ] Business services stopped and active connections checked.
  • [ ] gha_ctl uninstall completed successfully.
  • [ ] gha_ctl destroy dcs completed successfully.
  • [ ] No unintended database processes remain.
  • [ ] No unnecessary installation directories remain.
  • [ ] No unintended service ports remain occupied.

Record both commands and their execution results in the change ticket.

Conclusion

A complete GBase Database uninstall is not a single-command operation. It requires removing the database cluster and clearing its DCS metadata separately.

The correct sequence is:

  1. Verify the backup.
  2. Run gha_ctl uninstall.
  3. Run gha_ctl destroy dcs.
  4. Verify processes, directories, and ports.

For GBase Database(GBase 8c), uninstall deserves the same operational discipline as installation. Removing a database environment should never be treated as a casual cleanup task.

Two commands, one verified backup, and three post-uninstall checks.