2007-9-5 21:59
biangl
是不是online备份到另一台机器上restore一定要日志?
目前有一个24*7的数据库做了联机备份,目前手头只有这么一个备份文件,其他相关一概没有,在另一台小机做恢复,是不是必须要原本的acchivelog才可以rollforward?如果不需要可以将命令跟贴我看看吗?
谢谢了
2007-9-6 00:38
beginner-bj
必须要有原本的acchivelog
联机备份可能已经带了acchivelog
2007-9-6 08:41
biangl
联机备份可能已经带了acchivelog?
这个是什么概念??可以说得明白些吗?一个联机备份的文件中怎么自带了acchivelog?
2007-9-6 09:19
biangl
给各操作命令流程,高手帮忙看看 ,谢谢~!~
$ db2 restore db TYDB from /home/db2inst1 taken at 20070903112216 without rolling forward
SQL2537N Roll-forward is required following the Restore.
$ db2 restore db TYDB from /home/db2inst1 taken at 20070903112216
DB20000I The RESTORE DATABASE command completed successfully.
$ db2 connect to TYDB
SQL1117N A connection to or activation of database "TYDB" cannot be made
because of ROLL-FORWARD PENDING. SQLSTATE=57019
$ db2 rollforward db TYDB to 2007-09-03-11.22.16.000000 using local time and stop
SQL1275N The stoptime passed to roll-forward must be greater than or equal to
"2007-09-03-11.22.30.000000", because database "TYDB" on node(s) "0" contains
information later than the specified time.
$ db2 rollforward db TYDB to 2007-09-03-11.22.30.000000 using local time and stop
SQL1268N Roll-forward recovery stopped due to error "24" while retrieving log
file "S0000230.LOG" for database "TYDB" on node "0".
$ db2 rollforward db TYDB query status
Rollforward Status
Input database alias = TYDB
Number of nodes have returned status = 1
Node number = 0
Rollforward status = DB pending
Next log file to be read = S0000230.LOG
Log files processed = -
Last committed transaction = 2007-09-03-03.22.30.000000
2007-9-6 16:47
beginner-bj
[quote]原帖由 [i]biangl[/i] 于 2007-9-6 08:41 发表 [url=http://www.loveunix.net/discuz/redirect.php?goto=findpost&pid=717460&ptid=76530][img]http://www.loveunix.net/discuz/images/common/back.gif[/img][/url]
联机备份可能已经带了acchivelog?
这个是什么概念??可以说得明白些吗?一个联机备份的文件中怎么自带了acchivelog? [/quote]
db2 backup ... INCLUDE LOGS
V8开始有的,V8.x不记得了。
2007-9-6 16:50
beginner-bj
db2ckbkp -H 这个命令可以看备份文件是否INCLUDE LOGS
2007-9-6 17:24
biangl
问题解决了,上家坚持认为给我的备份文件含有LOG,我死活从备份文件里找不到,后来弄明白该备份文件上家做过两个,一个含有log,一个不含有备份log,再转手的时候他给我的只是不含有log的。我怒!!!其中有二转手的,倒死了!
2007-9-7 15:06
biangl
又有新状况出现了,亟待解决啊!!!!
$ db2 restore db TYDB from /home/userid taken at 20070903112236 logtarget /home/userid
DB20000I The RESTORE DATABASE command completed successfully.
$ db2 rollforward db TYDB query status
Rollforward Status
Input database alias = TYDB
Number of nodes have returned status = 1
Node number = 0
Rollforward status = DB pending
Next log file to be read = S0000231.LOG
Log files processed = -
Last committed transaction = 2007-09-03-03.22.48.000000
$ db2 rollforward db TYDB to 2007-09-03-03.22.48.000000 using local time and stop
SQL1275N The stoptime passed to roll-forward must be greater than or equal to
"2007-09-03-11.22.48.000000", because database "TYDB" on node(s) "0" contains
information later than the specified time.
$ db2 rollforward db TYDB to 2007-09-03-11.22.48.000000 using local time and stop
SQL1268N Roll-forward recovery stopped due to error "24" while retrieving log
file "S0000232.LOG" for database "TYDB" on node "0".
$db2 rollforward db TYDB query status
Rollforward Status
Input database alias = TYDB
Number of nodes have returned status = 1
Node number = 0
Rollforward status = DB working
Next log file to be read = S0000232.LOG
Log files processed = -
Last committed transaction = 2007-09-03-03.22.48.000000
又要S0000232.LOG日志了,我的想法是备份前的某一事务提交的记录跨了两个日志文件了,现在怎么办?
2007-9-7 16:28
biangl
因为提供了第一日志,此时需要S0000232.LOG做为保持恢复数据一致性的依据,此时可以采用
db2 rollforward db TYDB stop 命令强制脱离pengding状态,只不过恢复出来的数据和原始备份可能存在一定的数据丢失!!
不过对于拿不到S0000232.LOG来说,我认为已经是最好的解决方法了,不知还有哪位高人有更好的解决方法?
2007-9-7 18:11
beginner-bj
db2 rollforward ... NORETRIEVE
页:
[1]
Powered by Discuz! Archiver 5.5.0
© 2001-2006 Comsenz Inc.