世界杯指定网站

GBase News

Focus on Database Software Products and Services, Committed to becoming the most trusted provider of database products for users.

GBase 8s Backup Duo | ontape Backup and Recovery Essentials

Published on 2026-10-23

Whether facing accidental deletion, disk failure, or other risks, backup is the database's last line of defense.

GBase 8s natively provides two backup tools, ontape and onbar, each targeting different business scenarios. As a lightweight tool, ontape requires no additional components and offers minimal configuration, making it the standard backup solution for small and medium-sized business instances and traditional local backups.

1. When to Use ontape

Recommended Scenarios

  • Small and medium-sized databases with stable workloads and a focus on minimal operations and low maintenance costs

  • Traditional offline backup architectures based on local disks or tape devices

  • Routine incremental backups, cold disaster recovery of the entire system, and emergency offline log salvage after a crash

Not Recommended For

  • Mission-critical large databases and transaction systems with extremely stringent RTO/RPO requirements

  • Environments with human-error risk that require precise point-in-time rollback

  • Scenarios requiring backup of specific tablespaces

2. Core Capabilities at a Glance

  • Native support for three levels of physical backup—Level 0 full, Level 1 incremental, and Level 2 incremental—supporting tiered backup strategies

  • Supports manual and continuous logical log archiving, plus offline log salvage after a crash, minimizing the risk of data loss

  • Supports cold restore of the entire system and batched logical log replay

3. Essential Production Configuration

ontape strictly separates physical backup and logical backup parameters. The two sets take effect independently and must be fully configured in production.

Example Environment

Physical backup directory: /data/backup/phys
Logical log backup directory: /data/backup/log

1. Physical Backup Configuration

ini
TAPEDEV     /data/backup/phys
TAPEBLK     16          # backup block size, in KB
TAPESIZE    10240000    # maximum capacity per volume, in KB

2. Logical Log Archiving Configuration

ini
LTAPEDEV    /data/backup/log
LTAPEBLK    16          # logical log backup block size, in KB
LTAPESIZE   10240000    # maximum logical log data per volume, in KB

3. Dynamically Apply Settings

Key pitfall: Never set TAPEDEV to /dev/null. This only marks a backup without generating actual backup files, making data recovery impossible after a failure.

bash
onmode -wf TAPEDEV=/data/backup/phys
onmode -wf LTAPEDEV=/data/backup/log

4. Common Production Backup Commands

1. Level 0 Full Backup

A full backup is the only baseline for all incremental backups and disaster recovery.

bash
ontape -s -L0

2. Level 1 Incremental Backup

Backs up data pages changed since the most recent Level 0 backup, significantly reducing backup file size.

bash
ontape -s -L1

3. Level 2 Incremental Backup

Backs up data pages changed since the most recent Level 1 backup, suited to short-cycle, high-frequency backup strategies.

bash
ontape -s -L2

4. Change the Database Logging Mode During Backup

During a Level 0 backup, change the logging mode of the mydb database to nolog.

bash
ontape -s -L0 -N mydb

5. Routine Logical Log Archiving

ontape -a prompts whether to back up the currently active logical log. The following command archives only full logs and does not force a switch of the active log, avoiding jitter in high-concurrency workloads.

bash
echo "n" | ontape -a

6. Continuous Logical Log Archiving

Runs continuously in the background and automatically archives logs when they fill up, supporting subsequent failure recovery.

bash
ontape -c

7. Offline Log Salvage After a Crash (Emergency Use Only)

Run while the database is offline to salvage unarchived residual logs and minimize data loss.

bash
ontape -c

5. Key Recovery Scenarios

1. Full Restore

Automatically combines physical backup restore with logical log roll-forward; suitable for whole-machine failure, disk corruption, and full system rebuild.

bash
onmode -ky
ontape -r

Note: ontape -r is an integrated restore. After recovery, the database is in Quiescent state; after verification, run onmode -m to return to On-Line state.

2. Step-by-Step Precise Restore

Splits recovery into physical restore and log restore for easier troubleshooting and identification of anomalies.

bash
onmode -ky
ontape -p
ontape -l

Note: ontape -p completes physical restore and the instance automatically enters Fast Recovery. After logical log replay completes, the database state changes to Quiescent; run onmode -m to return to On-Line state.

3. Batched Continuous Logical Log Replay

After replaying the logical logs available on the current media, the global recovery session stays open and Fast Recovery remains suspended, allowing additional logical logs to be appended and replayed later.

bash
ontape -l -C

4. Terminate the Log Recovery Session

Ends the global log recovery session started by ontape -l -C.

bash
ontape -l -X

Note: After this command, no additional logical logs can be appended for roll-forward; the instance moves from Fast Recovery to Quiescent mode. After confirming the data is correct, run onmode -m to switch to On-Line and serve requests.

6. Conclusion

With zero additional components, minimal configuration complexity, high stability, and low maintenance, ontape is a perfect fit for small and medium-sized, lightweight GBase 8s production environments. It is the most cost-effective backup solution for simple business scenarios.

Bookmark this article for emergency use. In the next article, we will detail onbar's capabilities and production practices.

FAQ

When should I use ontape?

ontape is suited to small and medium-sized databases with stable workloads and a focus on minimal operations and low maintenance costs, traditional offline backup architectures based on local disks or tape devices, and routine incremental backups, cold disaster recovery of the entire system, and emergency offline log salvage after a crash. It is not recommended for mission-critical large databases and transaction systems with extremely stringent RTO/RPO requirements, environments with human-error risk that require precise point-in-time rollback, or scenarios requiring backup of specific tablespaces.

What backup levels does ontape support?

ontape natively supports three levels of physical backup — Level 0 full, Level 1 incremental, and Level 2 incremental — supporting tiered backup strategies. A full backup (Level 0) is the only baseline for all incremental backups and disaster recovery; Level 1 backs up data pages changed since the most recent Level 0 backup, significantly reducing backup file size; Level 2 backs up data pages changed since the most recent Level 1 backup, suited to short-cycle, high-frequency backup strategies.

What is the key configuration pitfall with TAPEDEV?

Never set TAPEDEV to /dev/null. This only marks a backup without generating actual backup files, making data recovery impossible after a failure. ontape strictly separates physical backup and logical backup parameters (TAPEDEV and LTAPEDEV); the two sets take effect independently and must be fully configured in production.

What is the difference between a full restore and a step-by-step precise restore?

A full restore with ontape -r automatically combines physical backup restore with logical log roll-forward; it is suitable for whole-machine failure, disk corruption, and full system rebuild. A step-by-step precise restore splits recovery into physical restore (ontape -p) and log restore (ontape -l) for easier troubleshooting and identification of anomalies. After either method, the database is in Quiescent state; after verification, run onmode -m to return to On-Line state.

Can unarchived logs be salvaged after a crash?

Yes. Run ontape -S while the database is offline to salvage unarchived residual logs and minimize data loss. In addition, ontape -l -C supports batched continuous logical log replay: after replaying the logical logs available on the current media, the global recovery session stays open and Fast Recovery remains suspended, allowing additional logical logs to be appended and replayed later.