Question on restoring a backup

  • Hi,

    I am not that knowledgable on backups and the files that they create, so please forgive me if say something wrong here.

    My manager restored from a backup a database.  So, let's say we had a database named ABC when he restored it, from a backup he named the restored one as Meng; so far no problem. He wants to now restore the ABC database again from the ABC back up again, and call it ABC_Dev. He thinks he cannot do this because of the ABC database and the Meng Shae the same datafile names and in them the (mdf, ndf, and ldf) files.

    Questions:

    1. Is it true that for those reasons he/ I could not do this?
    2. If so what can we do?
    3. thank you
  • wrote:

    1. Is it true that for those reasons he/ I could not do this?

    No.  Look up the WITH MOVE Option

    wrote:

    2. If so what can we do?

    This syntax should get you started

    USE [master]
    RESTORE DATABASE [ABC_Dev] FROM DISK = N'YourBackupFile' WITH FILE = 1,
    MOVE N'ABC Logical Data File' TO N'D:\Data\ABC_Dev.mdf',
    MOVE N'ABC Logical Log File' TO N'L:\Logs\ABC_Dev_log.ldf',
    NOUNLOAD, REPLACE, STATS = 5

    GO
    wrote:

    thank you

    You're welcome.

    Do yourself a favor, and invest in yourself.  There is so much information about backups and restores available from a simple Google search.   You can learn 1000 times more in an a hour of reading than  you can by posting on a forum.

    Good Luck!

     

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Grant Fritchey has a bunch of videos on YouTube where he shows you how to do a bunch of database backup & restore things. Definitely worth watching.

  • <Is it true that for those reasons he/ I could not do this?>

    No, SQL Server would never allow one file to be used by two different dbs at the same time.

    SQL DBA,SQL Server MVP(07, 08, 09) "Money can't buy you happiness." Maybe so, but it can make your unhappiness a LOT more comfortable!

Viewing 4 posts - 1 through 3 (of 3 total)

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