DB2 online backup is one of the most commonly used functions.
1. run the following command to check the Unix/Linux parameters: db2 get db cfg for xcldb | grep "USEREXIT" db2 get db cfg for xcldb | grep "LOGRETAIN" db2 get db cfg for xcldb | grep "TRACKMOD" command for viewing in Windows: db2 get db cfg for xcldb | find/I "userexit" db2 get db cfg for xcldb | find/I "logretain" db2 get db cfg for xcldb | find/I "trackmod"
2. configure parameters to change the database to archive log mode. The default mode is cyclic log mode. Online backup is not supported. db2 update db cfg for xcldb using userexit on // Enable User exit db2 update db cfg for xcldb using logretain on // enable archiving log db2 update db cfg for xcldb using trackmod on // enable incremental Backup
3. The database changes to the Backup pending status. You need to back up db2 backup db xcldb to/db2bak offline.
4. Test the connection and check whether the connection is successful. db2 connect to xcldb db2 connect reset
5. manually archive the file to check whether the generated log file exists. 5.1 find the directory where the log file is located. It is the value corresponding to the Path to log files parameter. db2 get db cfg for xcldb 5.2 manual archiving db2 archive log for db xcldb 5.3 go to the log directory to check whether files generate ls-lrt
6. online (online) backup: supports the following methods: Back up databases only, excluding logs -- compress: compressing backup sets db2 backup db xcldb online to c: \ db2bak compress -- back up databases, and the backup contains the log db2 backup db xcldb online to c: \ db2bak include logs -- incremental backup db2 backup db xcldb online incremental to c: \ db2bak include logs -- Differential (Delta) backup db2 backup db xcldb online incremental delta to c: \ db2bak include logs
7. view the backup record db2 list history backup all for xcldb