Two ways to store db2 logs

Source: Internet
Author: User

What are the methods for saving db2 logs? This is a problem that many people have mentioned. The following describes the two methods for saving db2 logs for your reference.

There are two ways to store db2 logs: cyclic logs and archived logs.

Loop log:

Circular logs cannot be deleted under any circumstances. If you delete a database, an error occurs.
If an error occurs, only backup can be used for restoration. If no backup is performed, contact the IBM official team for a connection.
Then you export the data and recreate the database. It is said that this is provided only when you have bought PPA.
.

Archive logs:

Activity logs in archived logs cannot be deleted. If the deletion result is the same as that of cyclic logs.
Archived logs can be deleted, but you may not be able to perform some rollback operations after deletion. Database Backup recovery involves backup files and logs

The link is as follows:

During backup, it is best to use the log parameter to package a special log, because the restoration cannot be completed without this special file, let alone roll back.

If the archive logs between the two full backups are deleted, the database cannot roll to any time in the two full backups.
If the log is retained, you can roll the database to any time point in the two full backups. The specific method is to restore the first full backup first, and then use the log to roll to the specified time point. In fact, if the logs between the two backups are retained, you can roll the database to any time point in the two backups.
1. view log space settings:

 
 
  1. db2 get dbm cfg for dbname  
  2.  
  3. --------------------------------------------------------------------------------------------------------------  
  4.  
  5.   | Log file size (4KB) (LOGFILSIZ) = 10000   
  6. | Number of primary log files (LOGPRIMARY) = 20   
  7. | Number of secondary log files (LOGSECOND) = 10   
  8. | Changed path to log files (NEWLOGPATH) =   
  9. | Path to log files = /data1/instwip/   
  10. | First active log file = S0006578.LOG  

Log space size = LOGFILSIZ * LOGPRIMARY

2. Update LOGFILSIZ, LOGPRIMARY, and LOGSECOND.

 
 
  1. Db2 update db cfg for database name for LOGFILSIZ using parameter value
  2.  
  3. Db2 update db cfg for database name for LOGPRIMARY using parameter value
  4.  
  5. Db2 update db cfg for database name using LOGSECOND parameter value

3. Modify cyclic logs/archive logs

 
 
  1. Db2 = update db cfg for database name using LOGARCHMETH1 parameter value
  2. Db2 = update db cfg for database name using FAILARCHPATH parameter value

Common DB2 cycle usage

Implementation of creating a database in DB2

DB2 database authorization

DB2 Authentication Overview

DB2 rename a table and view table information

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.