Analysis on archiving of DB2 database log files (1)

Source: Internet
Author: User

This document describes how to archive log files in the active log directory of the DB2 database, and describes how to use the USEREXIT program to manage log files for your reference, hope to help you.

Requirement Description

Because the LOGRETAIN = ON database configuration is used, the database log files will not be automatically deleted or recycled by the database from the active log directory, and more log files will be stored in the active log directory, therefore, you need to archive the log files in this directory.

Problem Analysis

After you set LOGRETAIN to ON, the database supports rollback and recovery. There are three types of log files in the system:

Activity Log: This log contains information about transaction units that have not been committed or rolled back, and the transaction information that has been committed but has not been written into the database file.

Online archiving log: all changes in the activity log are not required for normal processing, that is, when the transactions recorded in the log have been committed and written to the database file, this activity log is converted to online archived logs. They are called online because they are stored in the same directory as activity logs.

Offline archiving logs: these logs are archived offline by copying them from the active log directory to another place. These logs may still be required during database rollback and recovery.

You can manually manage database logs (manually copy online archived logs to an archive directory) or compile the USEREXIT program for automatic maintenance.

DB2 provides the USEREXIT sample program for all platforms and is easy to modify and use. Therefore, IBM recommends that you use the USEREXIT program to manage log files.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.