SQL Restore | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

SQL Restore

I am trying to restore a database restoring the .mdf file only. We use simple recovery model so my thought was that we would not need to restore the .ldf file. However after I take the database offline replace the .mdf file and bring it backup the database is listed in the suspect mode. Do I have to restore the .ldf file as well? I am an extreme novice in this area so any help would be great!

Yes. Only way is to dettach database, delete ldf, and when attach create a new ldf. Full backup before, of course.
Luis Martin
Moderator
SQL-Server-Performance.com All in Love is Fair
Stevie Wonder
All postings are provided “AS IS” with no warranties for accuracy.
When attaching the database what is the proper method to create the new ldf file. Also can this be done with Enterprise Manager? or do you need the sql statement? if so what is the correct statement. Thanks
You can do it with EM. Luis Martin
Moderator
SQL-Server-Performance.com All in Love is Fair
Stevie Wonder
All postings are provided “AS IS” with no warranties for accuracy.
what do I need to do to create the new ldf file after I have deleted the original.
EM will ask you to create a new one. Remember to delete the old one.
Luis Martin
Moderator
SQL-Server-Performance.com All in Love is Fair
Stevie Wonder
All postings are provided “AS IS” with no warranties for accuracy.
I tried the steps listed above but got a error saying the physical file name of the .ldf may be incorrect…Attaching database failed. Any thoughts?
Make sure the specified path of that log file exists and even SQL service account has required privileges on that path. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
I am not sure how to make sure the path file for the log file exists….as there is no log file for the database and it will create a new log file?
I mean to say ensure the path specified in your restore statement exists. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
]]>