Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database recovery

Database recovery

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pradipta
    wrote on last edited by
    #1

    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

    B 1 Reply Last reply
    0
    • P pradipta

      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

      B Offline
      B Offline
      Bruce Duncan
      wrote on last edited by
      #2

      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.

      P 1 Reply Last reply
      0
      • B Bruce Duncan

        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.

        P Offline
        P Offline
        pradipta
        wrote on last edited by
        #3

        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.

        B 1 Reply Last reply
        0
        • P pradipta

          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.

          B Offline
          B Offline
          Bruce Duncan
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups