存档

2009年12月14日 的存档,文章数:2

当master设备文件正在被二进制编辑器修改时,数据库服务器不能正确读取文件报错:

00:00000:00000:2009/12/14 17:21:11.79 kernel  dopen: open 'D:\sybase\data\master.dat', No error

错误日志中仅仅有这么一条(ase15.0.3esd2#).

每次启动的时候老是报00:00000:00011:2009/12/14 17:26:02.50 server  Error: 12315, Severity: 21, State: 1
00:00000:00011:2009/12/14 17:26:02.50 server  Corrupt page, Internal error: Mismatch between tail timestamp '0b7b' and the low two bytes of timestamp in the page header 'c9d3' while accessing page '2291' of object '3' in database '1'. Please contact Sybase Technical Support.类似的错误,一个一个的修改很麻烦。

启动时打开flag=3607,所有数据库均处于bypass mode。这是截断master的日志报错

1> dump tran master with no_log
2> go
Msg 4237, Level 16, State 1:
Line 1:
Cannot dump master database's log as distributed transaction resolution is not complete ye
t. Please retry later.
1> dump tran master with truncate_only
2> go
Msg 4237, Level 16, State 1:
Line 1:
Cannot dump master database's log as distributed transaction resolution is not complete ye
t. Please retry later.

即使对master数据库进行全备也不能截断日志。

dbcc checkdb(master),dbcc checktable(sysobjects),dbcc checktable(syslogs)等等之后。重启sybase就能够正常启动了。

————————————————————————————————————
——— 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
——— 转载务必注明原始出处 : http://www.dbainfo.net
——— 关键字: ASE 15.0.3 时间戳 二进制  修复 master 设备文件
————————————————————————————————————

此方法有一定的风险,请做好备份。you do it at your own risk!

以前的版本为:
Adaptive Server Enterprise/15.0.3/EBF 16550 ESD#1/P/NT (IX86)/Windows 2003/ase1503/2680/32-bit/OPT/Thu Mar 05 00:21:40 2009
在用mon表的时候报:NT storage access violation in omni_closetable destroyRemoteAccess. 怀疑是bug562998 。

于是打了ebf16738补丁。打补丁的过程和初次安装的过程一样只是wizard显示ASE15.0.3ESD#2,没有新建任何服务就选择完成了。
但是启动数据库的时候报错,很让人崩溃。难道我升级的方法有问题?

启动错误信息如下:

00:00000:00000:2009/12/14 14:55:34.59 kernel  engine 0, os pid 2404  online
00:00000:00000:2009/12/14 14:55:34.59 server  No active traceflags
00:00000:00001:2009/12/14 14:55:34.59 kernel  libomni1 - Component Integration Services: using 'Sybase Client-Library/15.0/P-EBF16074 ESD #15/PC Intel/BUILD1500-111/OPT/Thu Jul 31 20:59:50 2008'
00:00000:00001:2009/12/14 14:55:34.59 server  Opening Master Database ...
00:00000:00001:2009/12/14 14:55:34.71 server  Loading ASE's default sort order and character set
00:00000:00001:2009/12/14 14:55:34.73 server  Recovering database 'master'.
00:00000:00001:2009/12/14 14:55:34.75 server  Started estimating recovery log boundaries for database 'master'.
00:00000:00001:2009/12/14 14:55:34.75 server  Database 'master', checkpoint=(3779,8), first=(3779, 8), last=(3779, 31).
00:00000:00001:2009/12/14 14:55:34.75 server  Completed estimating recovery log boundaries for database 'master'.
00:00000:00001:2009/12/14 14:55:34.75 server  Started ANALYSIS pass for database 'master'.
00:00000:00001:2009/12/14 14:55:34.75 server  Completed ANALYSIS pass for database 'master'.
00:00000:00001:2009/12/14 14:55:34.75 server  Log contains all committed transactions until 2009/12/14 14:42:57.56 for database master.
00:00000:00001:2009/12/14 14:55:34.75 server  Started REDO pass for database 'master'. The total number of log records to process is 24.
00:00000:00001:2009/12/14 14:55:34.78 server  Error: 3474, Severity: 21, State: 1
00:00000:00001:2009/12/14 14:55:34.78 server  During redo the page timestamp value is less than old timestamp from log. Page #=348, object id = 37, page timestamp=0000 00000b20. Log old timestamp=0000 0000dbc2. Log record marker = (3779, 12).
00:00000:00001:2009/12/14 14:55:34.78 server  Cannot recover the master database, exiting.
00:00000:00001:2009/12/14 14:55:34.78 kernel  ueshutdown: exiting

又启动了一次,同样的错误信息。日志的意思是当前时间戳比日志中的时间要小,正常的应该为0000 0000dbc2,而redo中的时间戳为:0000 00000b20。以前日志都记录到(3779, 12).页面上了,升级后不知道什么原因却记到348页面上了?

原因没有搞清楚,但是sybase数据库不能用了。以前研究并且实现了对sybase日志设备的解析工作。通过修改设备文件修改一下时间戳看看能不能奏效吧?

用二进制工具打开master设备文件,根据错误信息中的可疑页号348定位到1433600(350*4096,@@maxpagesize=4096),找到

时间戳0000 00000b20将其修改为0000 0000dbc2。让咱们也来欺骗一下sybase服务器。^_^

0015E000 | 5C 01 00 00 00 00 00 00 5A 01 00 00 25 00 00 00 | \.......Z...%...
0015E010 | 20 0B 00 00 45 00 00 04 00 00 F7 09 02 08 02 00 |  ...E..........
0015E020 | 13 00 02 01 45 00 00 00 00 00 00 00 02 A8 01 4C | ....E.........L
0015E030 | 01 00 00 17 00 1C 70 65 72 63 65 6E 74 20 64 61 | ......percent da
0015E040 | 74 61 62 61 73 65 20 66 6F 72 20 68 69 73 74 6F | tabase for histo
0015E050 | 72 79 02 0E 00 02 AA 01 4C 01 00 00 19 00 1B 70 | ry.....L......p
0015E060 | 65 72 63 65 6E 74 20 64 61 74 61 62 61 73 65 20 | ercent database 
0015E070 | 66 6F 72 20 6F 75 74 70 75 74 02 0E 00 02 A9 01 | for output.....
0015E080 | 4C 01 00 00 18 00 14 70 65 72 63 65 6E 74 20 68 | L......percent h
0015E090 | 69 73 74 6F 72 79 20 66 72 65 65 02 0E 00 02 AB | istory free....

上红色的 20 0B  改为C2 DB 后,启动sybase服务器,成功!日志如下:

00:00000:00001:2009/12/14 15:27:44.29 server  Opening Master Database ...
00:00000:00001:2009/12/14 15:27:44.39 server  Loading ASE's default sort order and character set
00:00000:00001:2009/12/14 15:27:44.40 server  Recovering database 'master'.
00:00000:00001:2009/12/14 15:27:44.40 server  Started estimating recovery log boundaries for database 'master'.
00:00000:00001:2009/12/14 15:27:44.42 server  Database 'master', checkpoint=(3779, 8), first=(3779, 8), last=(3779, 31).
00:00000:00001:2009/12/14 15:27:44.42 server  Completed estimating recovery log boundaries for database 'master'.
00:00000:00001:2009/12/14 15:27:44.42 server  Started ANALYSIS pass for database 'master'.
00:00000:00001:2009/12/14 15:27:44.42 server  Completed ANALYSIS pass for database 'master'.
00:00000:00001:2009/12/14 15:27:44.42 server  Log contains all committed transactions until 2009/12/14 14:42:57.56 for database master.
00:00000:00001:2009/12/14 15:27:44.42 server  Started REDO pass for database 'master'. The total number of log records to process is 24.
00:00000:00001:2009/12/14 15:27:44.46 server  Redo pass of recovery has processed 2 committed and 0 aborted transactions.
00:00000:00001:2009/12/14 15:27:44.46 server  Completed REDO pass for database 'master'.
00:00000:00001:2009/12/14 15:27:44.48 server  Recovery of database 'master' will undo incomplete nested top actions.
00:00000:00001:2009/12/14 15:27:44.48 server  Started recovery checkpoint for database 'master'.
00:00000:00001:2009/12/14 15:27:44.53 server  Completed recovery checkpoint for database 'master'.
00:00000:00001:2009/12/14 15:27:44.53 server  Started filling free space info for database 'master'.
00:00000:00001:2009/12/14 15:27:44.65 server  Completed filling free space info for database 'master'.
00:00000:00001:2009/12/14 15:27:44.65 server  Started cleaning up the default data cache for database 'master'.
00:00000:00001:2009/12/14 15:27:44.67 server  Completed cleaning up the default data cache for database 'master'.
00:00000:00001:2009/12/14 15:27:44.75 server  Checking external objects.
00:00000:00001:2009/12/14 15:27:45.26 server  Database 'master' is now online.

呵呵,问题解决了。出现该问题的原因还未搞清楚!

————————————————————————————————————
——— 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
——— 转载务必注明原始出处 : http://www.dbainfo.net
——— 关键字: ASE 15.0.3 ESD#2 补丁 二进制 设备 dat
————————————————————————————————————