DB2 log management

Source: Internet
Author: User
Important DB log concepts $ db2getdb1_forsamplelogfilesize (4 kb) (LOGFILSIZ) 1000 Numberofprimarylogfiles (LOGPR

Important DB Log concepts $ db2 get db cfg for sample log file size (4 kb) (LOGFILSIZ) = 1000 Number of primary Log files (LOGPR



About setting the archive log Mode

If "USEREXIT" is not enabled, you can set logarchmeth1 or logarchmeth2 to a value other than OFF, and use the database to perform rollback and recovery.

If you update the userexit or logretain configuration parameters, logarchmeth1 is automatically updated,

And vice versa. However, if you are using userexit or logretain, you must set logarchmeth2 to OFF.

In addition, FAILARCHPATH (the archiving path of failover logs) is also provided in db2 8.2)

[Db2inst1 @ O11g64 bin] $ db2level

DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09013"

With level identifier "01040107 ".

Informational tokens are "DB2 v9.1.0.3", "s070719", "MI00203", and Fix Pack

"3 ".

Product is installed at "/u01/db2v9 ".

[Db2inst1 @ O11g64 bin] $ mkdir-p/home/db2inst1/db2inst1/mylog

[Db2inst1 @ O11g64 bin] $ db2 "update db cfg for xcldb using logfilsiz 8 LOGARCHMETH1 disk:/home/db2inst1/db2inst1/mylog /"

[Db2inst1 @ O11g64 bin] $ mkdir-p/home/db2inst1/db2inst1/cold

-- Db2 rollforward db xcldb query status -- not pending

[Db2inst1 @ O11g64 bin] $ db2 backup db xcldb to/home/db2inst1/db2inst1/cold

Backup successful. The timestamp for this backup image is: 20131213225508

First log archive method (LOGARCHMETH1) = DISK:/home/db2inst1/db2inst1/mylog/

[Db2inst1 @ O11g64 bin] $ db2 get db cfg for xcldb | grep "LOGARCHMETH1"

First log archive method (LOGARCHMETH1) = DISK:/home/db2inst1/db2inst1/mylog/

[Db2inst1 @ O11g64 bin] $ db2 get db cfg for xcldb | grep "LOGFILSIZ"

Log file size (4 kb) (LOGFILSIZ) = 8

[Db2inst1 @ O11g64 bin] $

[Db2inst1 @ O11g64 bin] $ db2 archive log for db xcldb

DB20000I The archive log command completed successfully.

[Db2inst1 @ O11g64 bin] $ ls-lrt/home/db2inst1/db2inst1/mylog/db2inst1/XCLDB/NODE0000/C0000000

Total 24

-Rw-r -----. 1 db2inst1 db2iadm1 12288 Dec 13 22:53 S0000000.LOG

-Rw-r -----. 1 db2inst1 db2iadm1 12288 Dec 13 S0000001.LOG



[Db2inst1 @ O11g64 bin] $ db2level

DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09013"

With level identifier "01040107 ".

Informational tokens are "DB2 v9.1.0.3", "s070719", "MI00203", and Fix Pack

"3 ".

Product is installed at "/u01/db2v9 ".

[Db2inst1 @ O11g64 bin] $ mkdir-p/home/db2inst1/db2inst1/mylog

[Db2inst1 @ O11g64 bin] $ db2 "update db cfg for xcldb using logfilsiz 8 LOGARCHMETH1 disk:/home/db2inst1/db2inst1/mylog /"

[Db2inst1 @ O11g64 bin] $ mkdir-p/home/db2inst1/db2inst1/cold

-- Db2 rollforward db xcldb query status -- not pending

[Db2inst1 @ O11g64 bin] $ db2 backup db xcldb to/home/db2inst1/db2inst1/cold

Backup successful. The timestamp for this backup image is: 20131213225508

First log archive method (LOGARCHMETH1) = DISK:/home/db2inst1/db2inst1/mylog/

[Db2inst1 @ O11g64 bin] $ db2 get db cfg for xcldb | grep "LOGARCHMETH1"

First log archive method (LOGARCHMETH1) = DISK:/home/db2inst1/db2inst1/mylog/

[Db2inst1 @ O11g64 bin] $ db2 get db cfg for xcldb | grep "LOGFILSIZ"

Log file size (4 kb) (LOGFILSIZ) = 8

[Db2inst1 @ O11g64 bin] $

[Db2inst1 @ O11g64 bin] $ db2 archive log for db xcldb

DB20000I The archive log command completed successfully.

[Db2inst1 @ O11g64 bin] $ ls-lrt/home/db2inst1/db2inst1/mylog/db2inst1/XCLDB/NODE0000/C0000000

Total 24

-Rw-r -----. 1 db2inst1 db2iadm1 12288 Dec 13 22:53 S0000000.LOG

-Rw-r -----. 1 db2inst1 db2iadm1 12288 Dec 13 S0000001.LOG

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.