Chinaunix首页 | 论坛 | 博客
  • 博客访问: 698987
  • 博文数量: 147
  • 博客积分: 5347
  • 博客等级: 大校
  • 技术积分: 1453
  • 用 户 组: 普通用户
  • 注册时间: 2005-06-06 11:11
文章分类

全部博文(147)

文章存档

2014年(4)

2012年(9)

2011年(5)

2010年(28)

2009年(21)

2008年(29)

2007年(15)

2006年(17)

2005年(19)

我的朋友

分类:

2009-10-26 23:42:47

1、 ONLINE备份:
    db2 backup database test online to /backup include logs;
 
    生成一个备份文件/backup/test.0.db2inst1.NODE0000.CATN0000.20091026221919.001
 
2、 RESTORE AND RECOVER
    restore:
    db2 "resote database test from /backup taken at 20091026221919 logtarget /archivelog/new"
 
    恢复好后的状态:
    Database is consistent                                  = NO
     Rollforward pending                                     = DATABASE

     Restore pending                                         = NO
 
    reocver:
    第一种:
    db2 "rollforward database test to end of logs and complete overflow log path (/archivelog/new)"
 
  RECOVER 后的状态:
   Database is consistent                                  = YES
   Rollforward pending                                     = NO

   Restore pending                                         = NO
 
    第二种:
    db2 "recover database fangys to end of logs and complete overflow log path (/archivelog/new)"
 
  RECOVER 后的状态:
   Database is consistent                                  = YES
   Rollforward pending                                     = NO

   Restore pending                                         = NO
 
 
有个疑问,之前数据库的配置信息如下:
手工归档日志(db2 archive log for db test)归档日志是放在:/archive/fangys_db_log目录下;
但恢复了数据库后,发现数据库的配置信息没变化,但归档日志,归到了/db2/db2inst1/NODE0000/SQL00002/SQLOGDIR/目录下,不知道为什么,----待续
 
Log retain for recovery status                          = RECOVERY
 User exit for logging status                            = YES
 Catalog cache size (4KB)              (CATALOGCACHE_SZ) = (MAXAPPLS*4)
 Log buffer size (4KB)                        (LOGBUFSZ) = 8
 Log file size (4KB)                         (LOGFILSIZ) = 1000
 Number of primary log files                (LOGPRIMARY) = 3
 Number of secondary log files               (LOGSECOND) = 2
 Changed path to log files                  (NEWLOGPATH) =
 Path to log files                                       = /db2/db2inst1/NODE0000/SQL00002/SQLOGDIR/
 Overflow log path                     (OVERFLOWLOGPATH) =
 Mirror log path                         (MIRRORLOGPATH) =
 First active log file                                   = S0000008.LOG
 Block log on disk full                (BLK_LOG_DSK_FUL) = NO
 Percent of max active log space by transaction(MAX_LOG) = 0
 Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
 Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
 Log retain for recovery enabled             (LOGRETAIN) = RECOVERY
 User exit for logging enabled                (USEREXIT) = OFF
 HADR log write synchronization mode     (HADR_SYNCMODE) = NEARSYNC
 First log archive method                 (LOGARCHMETH1) = DISK:/archivelog/fangys_db_log/
 Options for logarchmeth1                  (LOGARCHOPT1) =
 Second log archive method                (LOGARCHMETH2) = OFF
 Options for logarchmeth2                  (LOGARCHOPT2) =
 Failover log archive path                (FAILARCHPATH) =
 Number of log archive retries on error   (NUMARCHRETRY) = 5
 Log archive retry Delay (secs)         (ARCHRETRYDELAY) = 20
 Log pages during index build            (LOGINDEXBUILD) = OFF
阅读(1290) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~