Problems while Restoring a database.

  • Hi Friends,

    Following is the scenerio where i am facing problems while at the time of restoring.

    I am having two servers namely Server1 and Server2 . Both the servers have its own databases in which some are having the same name in both the servers. In that Server1 i am having a Database name DB11 and in the Server2 i am having a database name as DB11 (means the names are similar).

    I had taken the full backup of DB11 of Server1. Now i need to create a new database called DB11NEW on the Server2 and restore the DB11NEW with full backup of DB11. The problem is the DB11 on the Server1 is having the data and log file names as DB11.mdf and DB11_log.ldf. and aslo the DB11 present on the Server2 is also having the data and log file names as DB11.mdf and DB11_log.ldf. Now can i restore the database DB11NEW with the full backup of DB11 where it is also having the data and log file names as DB11.mdf and DB11_log.ldf.

    How to over come this. is there any way to restore?

    Venu Gopal.K
    Software Engineer
    INDIA

  • Yes, it's possible using the WITH MOVE part of the restore command e.g.

    RESTORE DATABASE DB11NEW

    FROM DISK='{drive\path}\DB11.bak'

    WITH

    MOVE 'DB11_Data' TO '{drive\path}\DB11NEW.mdf',

    MOVE 'DB11_log' TO '{drive\path}\DB11NEW.ldf'

    (assuming DB11_Data and DB11_log are the logical names of your files)

Viewing 2 posts - 1 through 1 (of 1 total)

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