我们的DR sybase解决方案基于还原完整备份,然后还原来自主站点的事务日志。 sybase是旧版本:ASE15.0但是,该解决方案不起作用。还原完整备份(无错误)后,还原事务日志失败(例如执行了数据库主动操作)。我认为是因为在还原完整备份之后,该序列已损坏:
数据库'db_warehouse',checkpoint =(2511803,20),first =(2511803,20),last =(2511900,1)。
任何人都可以帮助我了解为什么我有这种行为吗?
用于还原数据库的命令如下:
load database db_warehouse from "/dumps/sybase/db_warehouse_20191215010001.dmp
谢谢P
我进行了一些分析,并调试了用于还原数据库和事务日志的脚本。
第一步是使用load命令恢复数据库的转储。收到100%后,在load命令的输出下面]
Backup Server: 3.42.1.1: LOAD is complete (database db_warehouse). Started estimating recovery log boundaries for database 'db_warehouse'. Database 'db_warehouse', checkpoint=(2511803, 20), first=(2511803, 20), last=(2511900, 1). Completed estimating recovery log boundaries for database 'db_warehouse'. Started ANALYSIS pass for database 'db_warehouse'. Completed ANALYSIS pass for database 'db_warehouse'. Started REDO pass for database 'db_warehouse'. The total number of log records to process is 1315.
然后前进了很多,执行的结尾,我有:
Redo pass of recovery has processed 145 committed and 0 aborted transactions. Completed REDO pass for database 'db_warehouse'. Use the ONLINE DATABASE command to bring this database online; ASE will not bring it online automatically.
所以一切看起来都很好,并且数据库仍然保持脱机状态,如预期的那样:
name dbid suid status version logptr crdate dumptrdate status2 audflags deftabaud defvwaud defpraud def_remote_type def_remote_loc status3 status4 audflags2 ------------------------------ ------ ----------- ------ ------- ----------- ----------------------- ----------------------- ------- ----------- ----------- ----------- ----------- --------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------- ----------- ---------------------------------- db_warehouse 8 1 12 1 2510827 2019-12-16 22:28:44.006 2019-12-14 23:50:00.866 16 0 0 0 0 NULL NULL 131072 0 NULL
然后,使用相同的脚本加载事务日志,第一件事是检查数据库是否处于脱机状态。在此检查期间,将执行以下查询:
SELECT CONVERT(int, lct_admin('logsegment_freepages', db_id('db_warehouse')))
此查询返回以下错误:
Msg 921, Level 14, State 2 Server 'SYBASE_WAREHOUSE', Line 1 Database 'db_warehouse' has not been recovered yet - please wait and try again. ----------- 0
您为什么此查询返回此错误?唯一的解决方案是使数据库联机,但是事务日志还原失败(数据库中有活动,然后序列不再匹配)。
谢谢P