> 데이터 베이스 > MySQL 튜토리얼 > DB2日志的管理

DB2日志的管理

WBOY
풀어 주다: 2016-06-07 17:34:00
원래의
1104명이 탐색했습니다.

DB重要的日志概念 $ db2 get db cfg for sample Log file size (4KB) (LOGFILSIZ) = 1000 Number of primary log files (LOGPR



关于归档日志模式设置

如果 "USEREXIT" 没有启用,可将 logarchmeth1 或 logarchmeth2 设置为 OFF 以外的值,使用数据库可以进行前滚恢复。

如果更新 userexit或 logretain 配置参数,,将自动更新 logarchmeth1,

反之亦然。然而,如果您正在使用 userexit 或 logretain, 必须将 logarchmeth2 设置为 OFF。

另外,db2 8.2里面还提供了FAILARCHPATH(故障转移日志归档路径)

 

[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 (4KB) (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 23:07 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 (4KB) (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 23:07 S0000001.LOG

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿