Restore SQL Server DB without transaction log

后端 未结 5 1859
既然无缘
既然无缘 2021-02-06 20:30

Given a SQL Server 2008 .bak file, is there a way to restore the data file only from the .bak file, without t

5条回答
  •  走了就别回头了
    2021-02-06 21:02

    I know this is an old thread now, but i stumbled across it while I was having transactional log corruption issues, here is how I got around it without any data loss (I did have down time though!)

    Here is what I did:--

    Stop the sql server instance service make a copy of the affected database .mdf file and .ldf file (if you have an .ndf file, copy that as well!) - Just to be sure, you can always put these back if it doesn't work for you.

    restart the service.

    Log into sql management studio and change the database mode to simple, then take a full backup.

    Change the database type back again and once again take a full backup, then take a transactional log backup.

    Detach the database.

    Right click on databases and click on restore, select the database name from the drop down list, select the later full database backup created (not the one taken from the simple mode) and also select the transactional log backup.

    Click restore and it should put it all back without any corruption in the log files.

    This worked for me with no errors and my backups all worked correctly afterwards and there were no more transactional log errors.

提交回复
热议问题