With the continuous development of the banking, the application of computer networks and databases is increasingly wide, with database, especially the security issues of large databases, has received the attention of the majority of database administrators. In order to prevent accidental loss or damage of data, data must be taken to take effective backup means.
The so-called data backup is to keep a standby system. When the running system fails, the original data can be restored at the minimum time. The database's backup can be a copy of the entire database, or a copy of the data (one or more tablespaces). Data backups generally have two levels:
Hardware-level backup: Use redundant hardware to ensure continuous operation of the system, such as dual-machine fault, hard disk mirroring, etc. If the primary hardware is corrupted, the backup hardware can immediately take it back. Software-level backup: Save system data to other moving media, such as tape, floppy disk, disc, etc. When the system fails, the system can restore the system to the backup. This article focuses on the software-level backup of the database.
IBM's DB2 database has long been a very good reputation worldwide, one of the database systems that are favored by users. This article discusses backup and recovery of the DB2 5.5 for AIX database system.
First, the backup of the DB2 database
The DB2 database can back up the entire database, or you can back up one or more tablespaces; you can back up when the application is connected to the database (this is called online backup), or it can be connected to the database without any application. Backup (this is called offline backup). (See Table 1)
DB2 Database Use the command backup to back up. The backup command requires sysadm, sysctrl, or sysmaint permissions, and its command syntax is:
Backup Database Database Boun TO Media Name
or
BACKUP DATABASE Database Album Name TableSpace Table Space Name [Online} TO Media Name
Where the media name is generally designated as the absolute path of the medium, the tape drive device in which the non-rotating tape drive is named / DEV / RMT0, the rotary tape drive device is called /dev/rmt0.n. Data can also be backed up on the hard disk, and the media name is the absolute path. The backup command generates one or more backup files on the specified media, which shows the file name structure generated on the AIX 4.3 for RS / 6000:
The following is some examples of the backup command:
(1) This example creates a complete backup to the MYDB database under the specified server directory / backup / mydb:
Backup Database mydb to / backup / mydb
(2) This example is a online backup of the table space specified in the MYDB database. When the backup is made, the application can continue to update the database:
Backup Database MyDB TableSpace MySpace1 Online To / Backup / MyDB
The impact of the table one database can be made forward recovery