Database recovery
-
-
I had created a database(SQL Server) few motnhs before but unfortunately the database is now missing ,i have only the .mdf file of that database(.ldf is also missing),Can someone tell me how to recover the database from the .mdf file. Thanx Pradipta
You should be able to reattach the .mdf file to sql server. You can do this with Enterprise Manager, or the
sp_attach_db
system stored proc. You may get a warning about not having the corresponding .ldf.Without nipples, breasts would be pointless.
-
You should be able to reattach the .mdf file to sql server. You can do this with Enterprise Manager, or the
sp_attach_db
system stored proc. You may get a warning about not having the corresponding .ldf.Without nipples, breasts would be pointless.
I tried the following EXEC sp_attach_db @dbname = N'pubs', @filename1 = N'c:\mssql7\data\pubs.mdf' But I am getting following error using the above Stored procedure -------------------------------------------------------- Server: Msg 5105, Level 16, State 4, Line 1 Device activation error. The physical file name 'c:\mssql7\data\pubs.mdf' may be incorrect. ------------------------------------------------------ But the physical path is correct.I also tried with sp_attach_single_file_db but same error results. How can i do the same using Enterprise Manager,It will be highly appreciated if u tell me step by step.
-
I tried the following EXEC sp_attach_db @dbname = N'pubs', @filename1 = N'c:\mssql7\data\pubs.mdf' But I am getting following error using the above Stored procedure -------------------------------------------------------- Server: Msg 5105, Level 16, State 4, Line 1 Device activation error. The physical file name 'c:\mssql7\data\pubs.mdf' may be incorrect. ------------------------------------------------------ But the physical path is correct.I also tried with sp_attach_single_file_db but same error results. How can i do the same using Enterprise Manager,It will be highly appreciated if u tell me step by step.
pradipta wrote: N'c:\mssql7\data\pubs.mdf' Are you using SQL Server 7? I can explain how I do it with 2000, but I assume it would be similar process. Open Enterprise Manager. Expand the tree until you find your database server instance. Expand that. Right-click on Databases, select All Tasks -> Attach Database. Browse [...] for your database file. As for the error you are receiving, I don't know what the problem might be. Was the file detached from the original database, or just copied? That may cause problems potentially. But I'm no DBA, so I can't say for sure. Good luck
Without nipples, breasts would be pointless.