flyinweb_cu 发表于 2010-07-21 17:43

关于onbar时间点恢复的问题

本帖最后由 flyinweb_cu 于 2010-07-21 17:45 编辑

环境:AS4U7 + Informix Dynamic Server 2000 Version 9.21.UC2 (虚拟机)
模拟一个场景:在一次onbar 0级备份之后,操作了数据库,现在想恢复到0级备份之前的一个时间点时的数据,或者是在误操作之后,想恢复到之前的状态

# cat ixbar.0
online_db         rootdbs            R0 1   0 1911863244 0          2010-07-21 16:36:09 1   0   0         1   0   - -
online_db         logdbs             CD 0 2   0 1911863245 0          2010-07-21 16:36:12 1   0   0         2   0   - -
online_db         phydbs             CD 0 3   0 1911863247 0          2010-07-21 16:36:13 1   0   0         3   0   - -
online_db         datadbs            ND 0 4   0 1911863246 0          2010-07-21 16:36:13 1   0   0         4   0   - -
online_db         idxdbs             ND 0 5   0 1911863248 0          2010-07-21 16:36:13 1   0   0         5   0   - -
online_db         13               L0 6   0 1911863249 0          2010-07-21 16:37:04 1   0   0         6   0   - -
online_db         rootdbs            R0 7   0 1911863250 0          2010-07-21 17:01:49 1   0   0         7   0   - -
online_db         logdbs             CD 0 8   0 1911863251 0          2010-07-21 17:01:51 1   0   0         8   0   - -
online_db         phydbs             CD 0 9   0 1911863252 0          2010-07-21 17:01:52 1   0   0         9   0   - -
online_db         idxdbs             ND 0 10    0 1911863253 0          2010-07-21 17:01:52 1   0   0         10    0   - -
online_db         datadbs            ND 0 11    0 1911863254 0          2010-07-21 17:01:52 1   0   0         11    0   - -
online_db         14               L0 12    0 1911863255 0          2010-07-21 17:02:44 1   0   0         12    0   - -

bar_act.log日志如下:
2010-07-21 17:09:16 49904988 /home/informix/bin/onbar_d -r -t 2010-07-21 16:37:04
2010-07-21 17:09:16 49904988 Storage space datadbs is not down so it will not be restored.
2010-07-21 17:09:16 49904988 Storage space idxdbs is not down so it will not be restored.
2010-07-21 17:09:16 49904988 Storage space logdbs is not down so it will not be restored.
2010-07-21 17:09:16 49904988 Storage space phydbs is not down so it will not be restored.
2010-07-21 17:09:16 49904988 Storage space rootdbs is not down so it will not be restored.
2010-07-21 17:09:16 49904988 There are no storage spaces/logical logs to backup/restore.
2010-07-21 17:09:16 49904988 /home/informix/bin/onbar_d complete, returning 147 (0x93)

官方一篇文章
http://www-01.ibm.com/support/docview.wss?rs=630&context=SSGU8G&dc=DB550&uid=swg1IC50716&loc=en_US&cs=UTF-8&lang=en&rss=ct630db2
IC50716: RESTORE FAILS WITH "THERE ARE NO STORAGE SPACES/LOGICAL LOGS TO BACKUP/RESTORE"
APAR statusClosed as program error.
Error descriptionStarting with version 10 time lines were created for restore.
The time line uses the UNIX time as a sequence on when the
objects were "sealed", that is, the archive checkpoint time
for dbspaces and the closing time for logical logs. If logs are
not automatically backed up and the system clock is changed,
the time line will get corrupted. Logical logs that were closed
before the archive checkpoint time will have a "seal-time"
higher than the archive checkpoint time and so they will be
required to be restore. Because the dbspace does not need this
log it will jump to the backup immediately before the
one wanted. If one cannot be found, it will fail with:
"There are no storage spaces/logical logs to backup/restore"

Local fixModify the ixbar so that only the logs that were active when the
backup was taken are in the files

Problem summary****************************************************************
USERS AFFECTED:
10.00.xC1 and above
****************************************************************
PROBLEM DESCRIPTION:
Starting with version 10 time lines were created for restore.
The time line uses the UNIX time as a sequence on when the
objectswere "sealed",that is:
- The archive checkpoint time for dbspaces or
- The closing time for logical logs.
If logs are not automatically backed up and the system clock is
changed to a time in the past, the time line will get corrupted
and therefore restore will be impossible. The typical error you
will see is:
    "There are no storage spaces/logical logs to
backup/restore"
****************************************************************
RECOMMENDATION:
Upgrade to IDS version 10.00.xC7
****************************************************************

Problem conclusionProblem was first fixed in IDS 10.00.xC7

不知上面的情景是不是这个问题?

liaosnet 发表于 2010-07-21 21:25

本帖最后由 liaosnet 于 2010-07-21 21:27 编辑

你这里是在online状态下恢复的.....需在冷恢复~~

在这里
Storage space rootdbs is not down so it will not be restored.
提示dbspace 不是down的.不能恢复...也许dbspace down也能时间点恢复..

flyinweb_cu 发表于 2010-07-22 09:05

楼上正解!

2010-07-22 08:34:47 94779475 /home/informix/bin/onbar_d -r -p -t 2010-07-21 16:37:04
2010-07-22 08:37:27 94779475 Successfully connected to Storage Manager.
2010-07-22 08:37:27 94779475 Begin cold level 0 restore rootdbs (Storage Manager copy ID: 1911863244 0).
2010-07-22 08:37:39 94779475 Completed cold level 0 restore rootdbs.
2010-07-22 08:37:39 95029477 Process 95029477 successfully forked.
2010-07-22 08:37:39 95029477 Successfully connected to Storage Manager.
2010-07-22 08:37:39 95039477 Process 95039477 successfully forked.
2010-07-22 08:37:39 95039477 Successfully connected to Storage Manager.
2010-07-22 08:37:39 95049477 Process 95049477 successfully forked.
2010-07-22 08:37:39 95049477 Successfully connected to Storage Manager.
2010-07-22 08:37:39 95059477 Process 95059477 successfully forked.
2010-07-22 08:37:39 95059477 Successfully connected to Storage Manager.
2010-07-22 08:37:40 95029477 Begin cold level 0 restore logdbs (Storage Manager copy ID: 1911863245 0).
2010-07-22 08:37:41 95059477 Begin cold level 0 restore idxdbs (Storage Manager copy ID: 1911863248 0).
2010-07-22 08:37:42 95029477 Completed cold level 0 restore logdbs.
2010-07-22 08:37:42 95029477 Process 95029477 completed.
2010-07-22 08:37:44 95059477 Completed cold level 0 restore idxdbs.
2010-07-22 08:37:44 95059477 Process 95059477 completed.
2010-07-22 08:37:50 95049477 Begin cold level 0 restore datadbs (Storage Manager copy ID: 1911863246 0).
2010-07-22 08:37:51 95039477 Begin cold level 0 restore phydbs (Storage Manager copy ID: 1911863247 0).
2010-07-22 08:37:53 95049477 Completed cold level 0 restore datadbs.
2010-07-22 08:37:54 95049477 Process 95049477 completed.
2010-07-22 08:37:54 95039477 Completed cold level 0 restore phydbs.
2010-07-22 08:37:54 95039477 Process 95039477 completed.
2010-07-22 08:37:54 94779475 Physical restore complete. Logical restore required before work can
continue.
2010-07-22 08:37:54 94779475 /home/informix/bin/onbar_d complete, returning 0 (0x00)
2010-07-22 08:55:34 95289526 /home/informix/bin/onbar_d -r -l -t 2010-07-21 16:37:04
2010-07-22 08:55:35 95289526 Successfully connected to Storage Manager.
2010-07-22 08:55:35 95289526 Begin restore logical log 13 (Storage Manager copy ID: 1911863249 0).
2010-07-22 08:55:53 95289526 Completed restore logical log 13.
2010-07-22 08:55:53 95289526 Begin restore logical log 14 (Storage Manager copy ID: 1911863256 0).
2010-07-22 08:55:54 95289526 Completed restore logical log 14.
2010-07-22 08:55:55 95289526 Begin restore logical log 15 (Storage Manager copy ID: 1911863258 0).
2010-07-22 08:55:56 95289526 Completed restore logical log 15.
2010-07-22 08:56:02 95289526 Completed logical restore.
2010-07-22 08:56:03 95439541 /home/informix/bin/onbar_d -b -l
2010-07-22 08:56:04 95439541 /home/informix/bin/onbar_d complete, returning 0 (0x00)
2010-07-22 08:56:07 95289526 /home/informix/bin/onbar_d complete, returning 0 (0x00)
页: [1]
查看完整版本: 关于onbar时间点恢复的问题