本篇文章主要介绍了"Sybase数据库日志损坏时重建日志启动数据库的解决办法",主要涉及到sybase,解决办法方面的内容,对于其他数据库感兴趣的同学可以参考一下:
首先判断错误为页损坏或者索引损坏,根据Adaptive Server failed to retrieve a row via its RID in da...
首先判断错误为页损坏或者索引损坏,根据
Adaptive Server failed to retrieve a row via its RID in database 'escourt5' because the requested RID has a higher number than the last RID on the page. Rid pageid = 0x1c88a8; row num = 0x27. Page pointer = 0x261CA000, pageno = 1869992, status = 0x1, objectid = 8, indexid = 0, level = 0.
判断其中:objectid = 8 表示日志段有问题
解决方法一:截断日志
先把sysdatabases 的status 修改成-32768 然后重新启动数据库
1>update sysdatabases set status = -32768where name = "escourt5"
4>go
登陆数据库
1> dump transaction escourt5 with truncate_only
2> go
Msg 921, Level 14, State 1:
Line 1:
Database 'escourt5' has not been recovered yet - please wait and try again.
1> dump transaction escourt5 with no_log
2> go
Msg 921, Level 14, State 1:
Line 1:
Database 'escourt5' has not been recovered yet - please wait and try again.
说明这种发不起作用
解决方法二:重做日志
1> sp_role "grant","sybase_ts_role",sa
2> go
All the roles specified to be granted in the grant role statement have already
been granted to grantee 'sa'.
Authorization updated.
(return status = 0)
1> use master
2> go
1> dbcc rebuild_log(escourt5,1,1)
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
1> shutdown with nowait
2> go
Server SHUTDOWN by request.
The SQL Server is terminating this process.
重启服务后把status修改成0后再重启服务。
服务启动正常
最好是通过dbcc checkdb(databasename)检查一下数据一致性。
以上就介绍了Sybase数据库日志损坏时重建日志启动数据库的解决办法,包括了sybase,解决办法方面的内容,希望对其他数据库有兴趣的朋友有所帮助。
本文网址链接:http://www.codes51.com/article/detail_1310435.html