Sybase Question:
Download Questions PDF

Fixing a Munged Log in Sybase?

Answer:

Sybase Technical Support states that this is extremely dangerous as it "jacks up the value of the timestamp" which is used for recovery purposes. This may cause potential database corruption if the system fails while the timestamp rolls over.

In 4.9.2, you could only run the dbcc rebuild_log command once and after that you would have to use bcp to rebuild the database
In System 10, you can run this command about 10 times.
In System 11 I (Pablo, previous editor) tried it about 20 times and no problem.
1. use master
2. go
1. select count(*) from your_database..syslogs
2. go

-----------
some number

1. sp_configure "allow updates",1
2. go
1. reconfigure with override /* for system 10 and below only*/
2. go

1. begin tran
2. go

/* Save the following status to be used later... */
1. select saved_status=status from sysdatabases where name = "your_database"
2. go
1. update sysdatabases set status = -32768 where name = "your_database"
2. go
1. commit tran
2. go
1. shutdown
2. go

Download Sybase Interview Questions And Answers PDF

Previous QuestionNext Question
Hiding your password to isql in Sybase?How to implement if-then-else in a select clause in Sybase?