How to rebuild db log
Note:This process may result in some inconsistency in the db
(1) Grant sa as sybase_ts_role
1> sp_role ‘grant’, ‘sybase ts role’,sa
2> go
(2) set the database as “bypass”
1> sp_configure ‘ allow updates to system tables ’,1
2> go
1> use master
2> go
1> update sysdatabases
2> set status=“-32768” where dbid =“the database id”
3> go
1> shutdown with nowait
2> go
(3) rebuild the database log
1> use master
2> go
1> dbcc rebuild_log(db_name,l,l) (dbcc checkcatalog 针对sql server)
2> go
1> shutdown with nowait
2> go
(4) reboot the db and set the status to normal
1> use master
2> go
1> update sysdatabases
2> set status =0 where dbid = “the database id”
3> go
1> sp_configure ‘ allow updates to system tables ’,0
2> go
1> shutdown
2> go
本文提供了一种详细的步骤来修复损坏的数据库,包括授予sa权限、设置数据库状态为绕过模式、重建数据库日志文件以及重启数据库并恢复正常状态。
285

被折叠的 条评论
为什么被折叠?



