SQL Server Performance

Restoring a database.

Discussion in 'General DBA Questions' started by starwarsbigbang, May 15, 2006.

  1. starwarsbigbang New Member

    I have a dev server.

    I need to restore a database called 'TestDb' with the backup of another database called 'Forums1'. Both these databases are on the same server and the outcome should be that the 'TestDb' has the same contents as 'Forums1'. What syntax do I need to use. If I try using the REPLACE option for restore then it throws out an error message stating that the present database will be overwritten. I don't want do disturn the 'Forums1' database at all.

    Please let me know the proper syntax to do this operation.


  2. thomas New Member

    restore database Testdb
    from disk = 'full path to backup file'
    with move 'primary_logical_data_file' to 'full path to physical data file',
    move 'logical_log_file' to 'full path to physical log file',

    N.B. the new files should have different physical names to the existing Forums1 files.
  3. dineshasanka Moderator

    give different physical file name for data and log file


Share This Page