DEV Community

Michael
Michael

Posted on • Originally published at gbase.cn

Using the table.list File for Flexible Backup in GBase 8a

When backing up specific tables across different databases in GBase 8a, you'll need a table.list file. This file is only required for batch table‑level backups — not for entire VCs or databases. Here's how to use it in your gbase database.

When You Need table.list

The file is mandatory only for the backup tables command. Other backup levels do not use it:

Backup Level Command (inside gcrcman) Requires table.list?
Cluster‑level backup level 0 No
Database‑level backup database vc1.testdb level 0 No
Single table backup table vc1.testdb.t1 level 0 No
Batch tables backup tables /opt/gbase/table.list level 0 Yes

So, if you need to selectively back up a set of tables that may span multiple databases or even multiple VCs, table.list is the tool.

Why a File Is Required

  • Explicit scope: Without a database boundary, the file removes any ambiguity about which tables are included.
  • Cross‑database and cross‑VC support: The file can list tables from different databases and VCs, which a single backup database command cannot do.
  • Scripting and automation: Maintaining a list of tables in a file makes it easy to version, modify, and run repeatable backups.
  • Atomicity and consistency: The whole backup tables job runs as one task; the file defines the complete dataset, helping to achieve a consistent point‑in‑time view.

table.list File Format

Strict rules apply:

  • One table per line.
  • Full table name format: [vcname.]dbname.tabname
    • vcname: Virtual Cluster name (optional if using the default VC).
    • dbname: Database name.
    • tabname: Table name.
    • Components are separated by a dot ..

Example content:

vc000001.test.t1
vc000001.test.t2
vc000001.test.t3
sales.customer_order   -- uses default VC
hr.employee_salary
Enter fullscreen mode Exit fullscreen mode

Example: Back Up Three Tables

  1. Create the file:
   vi /opt/gbase/backup/table.list
Enter fullscreen mode Exit fullscreen mode

Contents:

   vc1.test.t1
   vc1.test.t2
   vc1.test.t3
Enter fullscreen mode Exit fullscreen mode
  1. Run the backup:
   gcrcman.py -d /opt/gbase/backup -P gbase -p your_password
   gcrcman> backup tables /opt/gbase/backup/table.list level 0
Enter fullscreen mode Exit fullscreen mode

Key Points

  • File location: The table.list file must reside on the management node running gcrcman and be readable by the executing user.
  • Validation: If a listed table doesn't exist or the format is incorrect, the backup will fail.
  • Restore: You restore with the corresponding backup set, not the file itself. The restore command is recover tables ....
  • Generate automatically: You can create table.list from system tables:
  SELECT CONCAT(table_vc, '.', table_schema, '.', table_name)
  FROM information_schema.tables
  WHERE table_schema IN ('test', 'sales')
  INTO OUTFILE '/tmp/table.list'
  FIELDS TERMINATED BY '' LINES TERMINATED BY '\n';
Enter fullscreen mode Exit fullscreen mode

The table.list file gives you precise control over multi‑table backups in GBASE's MPP cluster. Use it when you need to go beyond single‑database backups and tailor your data protection exactly to your needs.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.