question

Wilfred van Dijk avatar image
Wilfred van Dijk asked

logfile corrupt, switch to SIMPLE?

I need to examine a user database with a corrupted logfile ("the logscan number ... is not valid"). This database is in full recovery mode. Due to this error, no backup can be taken. However, data is replicated and still working fine (so no data loss). Instead of doing a restore will this work: 1. put database in emergency / single user mode 2. set database in SIMPLE recovery mode 3. run DBCC CHECKDB 4. fixed (?) thanks!
corruptioncheckdblogfile
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Wilfred van Dijk avatar image
Wilfred van Dijk answered
Update: database was already in SIMPLE. Here's what I did: 1. scripted the replication (SSMS feature) 2. dropped the replication, this "released" the logfile 3. ran DBCC CHECKDB, no errors 4. made a backup (not done since 2 months ...) 5. shrinked and resized the logfile 6. re-created the replication
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sjimmo avatar image
sjimmo answered
If you have the last backup of the T-Log and you know the LSN then run the following: RESTORE LOG FROM DISK = 'path:\backupfilename' WITH STOPATMARK = 'lsn:lsnnumber' GO Your replication will continue to work as long as the system can write to the T-Log, but is the data being committed to the database? Replication works from the T-Log.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.