Corrupt transaction log; Build a new ASE transaction log with dbcc rebuild_log
In some cases it is necessary to rebuild the ASE transaction log.
Sybase Technical Support states that this is extremely dangerous. It may cause potential database corruption if the system fails while the timestamp rolls over.
- dump the database first. If "dbcc rebuild_log" corrupts the database you can give it a second try.
- login to the ASE
- run
SELECT count(*) FROM db_name_with_corrupt_log..syslogs
the result is an int-value higher than 1.
configure the ASE to allow updates on systemtables:
sp_configure "allow updates",1
SELECT STATUS FROM master..sysdatabases WHERE name = "db_name_with_corrupt_log"
The result is "your_db_status" which is a int-value. Save it.
begin tran go UPDATE sysdatabases SET STATUS = -32768 WHERE name = "db_name_with_corrupt_log" go commit tran go
dbcc rebuild_log (db_name_with_corrupt_log, 0, 0)
dbcc rebuild_log (db_name_with_corrupt_log, 1, 1)
USE db_name_with_corrupt_log
SELECT count(*) FROM syslogs
begin tran go UPDATE sysdatabases SET STATUS = <your_db_status> WHERE name = "db_name_with_corrupt_log" go commit tran go