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