六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 58|回复: 0

设置DB2归档模式

[复制链接]

升级  35%

89

主题

89

主题

89

主题

举人

Rank: 3Rank: 3

积分
305
 楼主| 发表于 2013-1-25 21:48:10 | 显示全部楼层 |阅读模式
设置归档模式:

[db2inst1@server1 ~]$ db2 update db cfg for sample using logretain recoveryDB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.SQL1363W  One or more of the parameters submitted for immediate modification were not changed dynamically. For these configuration parameters, all applications must disconnect from this database before the changes become effective--这时候,需要手动备份数据库,否是会出现backup pending的状态:[db2inst1@server1 ~]$ con sampleSQL1116N  A connection to or activation of database "SAMPLE" cannot be made because of BACKUP PENDING.  SQLSTATE=57019[db2inst1@server1 ~]$ db2 backup db sample to /tmpBackup successful. The timestamp for this backup image is : 20101117125927--检查相关设置:[db2inst1@server1 ~]$ con sample   Database Connection Information Database server        = DB2/LINUX 9.5.2 SQL authorization ID   = DB2INST1 Local database alias   = SAMPLE[db2inst1@server1 ~]$ db2 get db cfg |grep -i log Log retain for recovery status                          = RECOVERY Log retain for recovery enabled             (LOGRETAIN) = RECOVERY First log archive method                 (LOGARCHMETH1) = LOGRETAIN Options for logarchmeth1                  (LOGARCHOPT1) =  Second log archive method                (LOGARCHMETH2) = OFF--再设置归档的路径:[db2inst1@server1 ~]$ db2 update db cfg for sample using LOGARCHMETH1 "DISK:/arch/"DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.[db2inst1@server1 ~]$ db2 get db cfg |grep LOGARCHMETH1 First log archive method                 (LOGARCHMETH1) = DISK:/arch/--手动归档一下:[db2inst1@server1 ~]$ db2 ARCHIVE LOG FOR DATABASE sampleDB20000I  The ARCHIVE LOG command completed successfully.--看看归档情况[root@server1 /arch/db2inst1/SAMPLE/NODE0000/C0000000]# lltotal 16-rw-r----- 1 db2inst1 db2iadm1 12288 Nov 17 13:09 S0000000.LOG[db2inst1@server1 ~]$ db2 LIST HISTORY  ARCHIVE LOG all for sample                    List History File for sampleNumber of matching file entries = 2 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID -- --- ------------------ ---- --- ------------ ------------ --------------  X  D  20101117130935      1    D  S0000000.LOG C0000000       ---------------------------------------------------------------------------- ----------------------------------------------------------------------------    Comment:                                                                   Start Time: 20101117130935   End Time: 20101117130935     Status: A ----------------------------------------------------------------------------  EID: 23 Location: /arch/db2inst1/SAMPLE/NODE0000/C0000000/S0000000.LOG Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID -- --- ------------------ ---- --- ------------ ------------ --------------  X  D  20101117130935      N                    S0000000.LOG   ---------------------------------------------------------------------------- ----------------------------------------------------------------------------    Comment: ARCHIVE LOG                                                       Start Time: 20101117130935   End Time: 20101117130935     Status: A ----------------------------------------------------------------------------  EID: 24
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表