(1)賦予sa用戶Sybase_ts_role的角色
isql -Usa -P
1>sp_role "grant","Sybase_ts_role",sa
2>go
1>quit(2)將數據庫置為"bypass recovery"狀態
isql -Usa -P
1>sp_configure "allow updates",1
2>go
1>use master
2>go
1>update sysdatabases set status=-32768
2>where name="database_name"
3>go
1>shutdown with nowait
2>go(3)rebuild數據庫日志
重啟Server
isql -Usa -P
1>use master
2>go
1>dbcc rebuild_log(database_name,1,1)
2>go
1>shutdown with nowait
2>go(4)重啟SQL Server
(5)在重啟SQL Server之後,如果數據庫恢復正常,rebuild log工作將會成功完成,否則要恢復數據庫備份,使用dump database或bcp命令。
1>use master
2>go
1>update sysdatabases set status=0 where name="database_name"
2>go
1>sp_configure "allow updates",0
2>go
1>shutdown with nowait
2>go