DB2 database backup is the basic knowledge in the DB2 database process. Next we will introduce you to the DB2 database backup method, and hope to help you.
Database Backup creates a time point image of the database, which is the basic component of the disaster recovery solution. DB2 provides several backups, including offline backup, online backup, and Incremental backup. The time required for Backup recovery depends on the size of the database and the hardware resources that can be used for recovery.
Because Database Backup only captures data at the time point, it is impossible to recover any data changes after the backup through a simple restoration. To restore the transaction completed after the backup, you need to apply the log file. The database can be recovered from the backup and log files by performing "Roll Forward" in the log files. This allows recovery to a certain point in time or recovery to the end of the log file.
Therefore, if the DR solution must recover the transaction since the last backup, it is critical to retain the log file.
The DB2 database backup solution can be divided into three types:
§ Offline backup
§ Backup and Log Retention
§ Logical backup
Offline backup
Only create database backup. Simple backup is suitable for read-only databases or databases filled with batch jobs that can be easily re-created, or databases that do not need to be maintained between backups.
Data loss: all changes made after the last backup operation will be lost. This type of recovery operation restores data to a specific time point for full backup, so it is also called version recovery.
Recovery Time: it takes a long time to recover the database.
Online backup and Log Retention
The database log files are retained and backed up together to create a more comprehensive DR solution. Log files allow data changes between backups to be restored. This solution is suitable for most business-oriented environments. It balances the need to minimize the risk of data loss and the costs required to maintain DR solutions.
Data loss: if proper steps are used to maintain log files, the risk of data loss is greatly reduced.
Recovery Time: it takes time to recover the database. The application log file will increase the recovery time.
The preceding two DB2 database backup methods cannot be used across platforms.
Logical backup
Using exp/imp or db2move to back up data is similar to oracle exp/imp ).
Data loss: data changes between backups may be lost.
Recovery Time: it takes a long time to recover the database.
This backup method can be used across platforms. However, the backup and recovery takes a long time and is only suitable for databases with small data volumes.
Database logs
Db2 has two logging methods: loop and archive.
Loop log:
When a new database is created, the cyclic record is the default attribute. For this log recording method, only full offline backup is allowed.
Archive logs:
Online backup is supported only when the database is configured as an archive record. During the online backup operation, all activities on the database are recorded. When you restore an online backup, you must at least roll back the log to the time point when the backup is completed. Therefore, logs must be archived and available when restoring the database. After the online backup is complete, DB2 forces the active logs to be closed for archiving.
Introduction to DB2 database backup software
Implementation of batch SQL script execution in DB2
DB2 tablespace Classification
Implementation of DB2 string connection
Use of the DB2 auto-incrementing field IDENTITY