Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-09-06 : 09:48:37
|
| Marianna writes "I HAVE ACCIDENTALLY DELETED THE LOG FILE OF MY DATABASE SIGNED AS "SUSPECT", SO I HAVE CREATED A NEW DATABASE, I HAVE DETACHED IT AND, WHEN I TRIED TO ATTACH MY OLD DB DATAFILE TO THE NEW ONE, SQL SAID IT IS NON POSSIBLE BECAUSE THE OLD_DB log.ldf may be incorrect. I THINK THAT SOME TRANSACTION OF THE OLD DB ARE NOT CLOSED AND THE OLD DATABASE DATAFILE HAS SOME REFERENCES TO THE OLD DATABASE LOG FILE THAT DOESN'T EXIST.I DON'T WANT LOSE THE OLD DATABASEWHAT CAN I DO TO RESTORE THE OLD DATABASE FILE without THE OLD DB LOG FILE?" |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-09-06 : 10:22:43
|
| Try to attach your database, using sp_attach_single_file_db. If that doesn't work, restore from backup. You do have backups, don't you?!!!And here is a way you could try to recover your DB if you don't even have backups... It is not a supported way -- use as a last resort only!http://sqlteam.com/Forums/topic.asp?TOPIC_ID=18882Edited by - izaltsman on 09/06/2002 10:24:01 |
 |
|
|
solart
Posting Yak Master
148 Posts |
Posted - 2002-09-06 : 12:55:36
|
| Using the DBCC REBUILD_LOG undocumented feature, as suggested by izaltsman "may work". But be aware while this may get your data back, it may also be in a transactionally inconsistent state. Without the original log, the system does not know what to roll forward and what to back out.solartEdited by - solart on 09/06/2002 13:02:04 |
 |
|
|
|
|
|