i have mdf and ldf files how to restore these 2 files in sqlserver 2000

  • hi this is urgent

    how to restore these files

  • Try attaching them. It should work.

    From object explorer, right click the database folder and select Attach Database

    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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You can also create a dummy database with the same name as your original database, shut down sql server service and overwrite your data files with original files. Restart sql server service, It'd recover the data you had in the original database.



    Pradeep Singh

  • ps (12/13/2008)


    You can also create a dummy database with the same name as your original database, shut down sql server service and overwrite your data files with original files. Restart sql server service, It'd recover the data you had in the original database.

    This is more of a cowboy way (e.g. not a supported way, but it works). In order for it to work you also need to create the dummy database's files with the same name as the LDF, MDF and NDF files that you have.

    Personally I used it only once few years ago when I needed to attach a database that was detached while it was in suspect mode. Since the database could not be attached, I used your approach. In all other cases, when I can attach the database in the normal way, I don't see any reason to use this method.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • ps (12/13/2008)


    You can also create a dummy database with the same name as your original database, shut down sql server service and overwrite your data files with original files. Restart sql server service, It'd recover the data you had in the original database.

    this is a last resort for damaged files. If your data files are ok then just attach as normal dont resort to this scenario

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks for your replies Adi and Perry.

    Though i consider attaching a database the simplest option to put the database back in action, i gave that option as an alternative.

    Few google hits gave a 3rd option. Looks interesting but dangerous too!!

    I dont suggest the initiator of this thread to try this out either.. just for informative purposes....

    I havent tried it out as yet...

    refer to Method Two at the following URL

    http://searchsecurity.techtarget.com/tip/0,289483,sid14_gci824569,00.html



    Pradeep Singh

  • ps (12/14/2008)


    Though i consider attaching a database the simplest option to put the database back in action

    that is the option that should used

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Have you been successful at attaching these files to your database server? If not, what problems are you having now?

    -ef

    [font="Tahoma"]Eric Flamm, Flamm Consulting[/font]

  • Your topic is "I have mdf and ldf files how to restore these 2 files in sqlserver 2000", but it's posted in SQL 2005 Backup section.

    Are you trying to restore a SQL2005 database to SQL2000? If so, that's not possible. You would need to create an empty database with the schema and import the data.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply