Databases 7 min read

Mastering Physical Fine‑Grained Backup & Restore in GaussDB(DWS)

This article explains why physical fine‑grained backup and restore are essential for GaussDB(DWS), outlines the toolchain, advantages, detailed workflow, and practical command‑line usage to protect data warehouse integrity while saving space and time.

Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Mastering Physical Fine‑Grained Backup & Restore in GaussDB(DWS)

Introduction

In the era of big data, data loss can cause immeasurable damage to business decisions. The webinar “Backup Recovery Mastery, Data Warehouse Safer” featured Huawei Cloud EI DTSE evangelist Li Wenxin, who discussed GaussDB(DWS) physical fine‑grained backup and restore.

GaussDB(DWS) Backup & Recovery Architecture

GaussDB(DWS) provides two defensive layers: high‑reliability technology and backup‑recovery technology. The Roach tool offers backup, restore, and disaster‑recovery functions, including cluster‑level backup/restore, physical fine‑grained backup/restore, logical backup/restore, dual‑cluster disaster recovery, migration, and fine‑grained disaster recovery.

Why Physical Fine‑Grained Backup?

If a table is accidentally deleted, a cluster‑level restore would require restoring the entire cluster, which is inefficient. Physical fine‑grained restore allows precise recovery of only the affected table or schema, matching real‑world usage where such targeted restores are more common.

Advantages of Physical Fine‑Grained Backup

Save space by backing up only critical files instead of the whole cluster.

Save time with a simpler, more efficient physical file copy process.

Precise recovery without needing to restore the entire cluster.

Basic Workflow

The process uses the gs_dump tool to capture table definitions, then copies related files (e.g., column‑store cudesc, toast files). A map file records table relationships and associated files. Roach compresses the physical files into .rch archives and generates a fine_file_list that lists the contents of each archive. After backing up the definition, related files, and physical files, fine‑grained single‑table restoration is possible.

Physical Fine‑Grained Restore Procedure

The restore creates a target table with the same definition in the current cluster, then replaces its physical files with those from the backup. Because the replaced files retain old transaction information, a data‑cleaning step is required after the restore to complete the process.

Practical Usage

Physical fine‑grained backup and restore are executed via a Python script that invokes the gs_roach tool with specific parameters, such as:

--physical-fine-grained   # enable fine‑grained mode
--dbname <database_name>   # e.g., postgres
--schema-list <file>       # list of schemas to back up
--clean                    # clean original table when restoring to the same name
--table-list <file>        # list of source tables
--restore-target-list <file> # list of target tables

Backup tasks can also be submitted from the control panel by enabling the fine‑grained switch in the cluster management interface.

Further Resources

For more technical articles and live‑stream updates on GaussDB(DWS), follow the GaussDB(DWS) forum.

Data WarehouseBackupRestoreGaussDBPhysical Fine-Grained
Huawei Cloud Developer Alliance
Written by

Huawei Cloud Developer Alliance

The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.