重建数据库日志
2006-03-19 21:46:01 来源:WEB开发网核心提示:(1)赋予sa用户sybase_ts_role的角色 isql -Usa -P 1>sp_role "grant","sybase_ts_role",sa 2>go 1>quit (2)将数据库置为"bypass recovery"状态 is
(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)重启server
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
(5)在重启server之后,如果数据库恢复正常,rebuild log工作将会成功完成,否则要恢复数据库备份,使用dump database或bcp命令。
更多精彩
赞助商链接