August 11, 2010 at 12:52 pm
Hi,
Is it able to restore a database from just mdf file.
I dont have the ldf file..
Wat can I do?
Thanks,
Sushant
Regards
Sushant Kumar
MCTS,MCP
August 11, 2010 at 1:02 pm
The MDF is the data file, not a backup file. I'm guessing you're trying to see if you can reattach the database with just the MDF file?
Take a look here:
http://msdn.microsoft.com/en-us/library/ms174385.aspx
If this works, a new LDF file should be created when you re-attach the database.
August 11, 2010 at 1:06 pm
You might be able to attach it. If the database was shut down cleanly, then in the process of attaching, SQL will create a new ldf. If the database was not shut down cleanly, the attach will fail.
No chance of getting an actual backup?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 11, 2010 at 1:44 pm
@ blackbird
Ya,i want to reattach the database with just MDF file.
@ gilamonster
That server was made to shut down and the images of the databases were taken, now wen we are extracting from the images, we can find only the mdf files.
Regards
Sushant Kumar
MCTS,MCP
August 11, 2010 at 1:51 pm
Did you take a full backup before shutting down ? That's always a good idea to do before making changes to databases, servers, configuration etc ... Then you could do a restore which will include the .ldf
August 11, 2010 at 2:03 pm
You can try to attach it, you'll just have to remove the reference to the ldf file in the attach dialog. If the image was made while SQL was running it probably won't attach. If that happens, see this blog post for a method of hacking and repairing the DB - http://sqlinthewild.co.za/index.php/2009/06/09/deleting-the-transaction-log/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 12, 2010 at 1:49 am
try this.
EXEC sp_attach_single_file_db @dbname = '', --- your database name
@physname = '' --- the location of the .mdf file
August 12, 2010 at 3:51 am
Ya, it works.
August 12, 2010 at 6:43 am
Ya, it worked.
Thanks all
Sushant
Regards
Sushant Kumar
MCTS,MCP
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply