Restore Database

  • Hi ,

    I dont have .bak file

    But i have only transaction log file and Data file

    Is it possible to restore db with this files.

    If so kindly lemme know the process

    Thanks

  • Yes, lookup sp_attach_db in BOL or a search engine of your choice.

  • I am new here as a DBA, but i think restoring wont work here.. instead you can right click on DATABASE and then select Attach Option & there you can add the .mdf file & so on & start working with it... try this 🙂

    I am sorry if i am wrong... i only know little little 🙂

    ************************************
    Every Dog has a Tail !!!!! :-D

  • anthony.green (8/28/2012)


    Yes, lookup sp_attach_db in BOL or a search engine of your choice.

    Yes, this is also another way you can try which anthony said.....

    Here you go with an example..

    EXEC sp_attach_db @dbname = N'AdventureWorks2012',

    @filename1 =

    N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data\AdventureWorks2012_Data.mdf',

    @filename2 =

    N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data\AdventureWorks2012_log.ldf';

    Just change the Path & DB file name & enjoy 😎

    ************************************
    Every Dog has a Tail !!!!! :-D

  • sp_attach_db is deprecated, included only for backward compatibility with SQL 2000 and should not be used.

    The replacement is CREATE DATABASE ... FOR ATTACH, details in Books Online.

    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
  • Hi ,

    I Dont have .mdf and .ldf files tooo 🙁

    I have only Transaction Log file and Data File

    Is it possible to restore db ?

    Please help me .......

  • Data file = mdf

    Transaction log file = ldf

  • greeshma.patla (8/28/2012)


    Hi ,

    I Dont have .mdf and .ldf files tooo 🙁

    I have only Transaction Log file and Data File

    Is it possible to restore db ?

    Please help me .......

    Hey Try using the option which i told very first....

    Right click on Database & then choose Attach & then select the required files in it & then u can start using it 🙂

    ************************************
    Every Dog has a Tail !!!!! :-D

  • greeshma.patla (8/28/2012)


    Hi ,

    I Dont have .mdf and .ldf files tooo 🙁

    I have only Transaction Log file and Data File

    Is it possible to restore db ?

    Please help me .......

    ??? :w00t:

    you just need to attach the files you haveto SQL Server. Use any method described above for the same.


    Sujeet Singh

  • Divine Flame (8/28/2012)


    greeshma.patla (8/28/2012)


    Hi ,

    I Dont have .mdf and .ldf files tooo 🙁

    I have only Transaction Log file and Data File

    Is it possible to restore db ?

    Please help me .......

    ??? :w00t:

    you just need to attach the files you haveto SQL Server. Use any method described above for the same.

    Divine you mean the answer which i gave is correct????? 🙂

    Please also help me in the below link 🙁

    http://www.sqlservercentral.com/Forums/Topic1350848-1549-1.aspx

    ************************************
    Every Dog has a Tail !!!!! :-D

  • runal_jagtap (8/28/2012)


    Divine Flame (8/28/2012)


    greeshma.patla (8/28/2012)


    Hi ,

    I Dont have .mdf and .ldf files tooo 🙁

    I have only Transaction Log file and Data File

    Is it possible to restore db ?

    Please help me .......

    ??? :w00t:

    you just need to attach the files you haveto SQL Server. Use any method described above for the same.

    Divine you mean the answer which i gave is correct????? 🙂

    Please also help me in the below link 🙁

    http://www.sqlservercentral.com/Forums/Topic1350848-1549-1.aspx%5B/quote%5D

    Yes, your answer is correct that he/she needs to attach the database (as others have also mentioned the same).


    Sujeet Singh

  • Thank u so much 🙂

Viewing 12 posts - 1 through 11 (of 11 total)

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