SQL Server Performance

SQL Server restore failure

Discussion in 'General DBA Questions' started by Valconian, Jan 9, 2005.

  1. Valconian New Member

    Hi all,

    I schedule a complete backup every night and now I've reformatted the
    server and failed to restore the backup.

    From the newly formatted SQL Server, it didnt contain any backup
    history of the database. I've tried restoring by specifying the
    location of the file, but still no avail.

    I've even tried the "attach" function, but I still can't. I
    desperately need some help here. Thanks.

  2. satya Moderator

    What was the error while restoring the backup?
    If the disk configuration of the previous SQL server and this one is different then you must use WITH MOVE clause in RESTORE statement, using books online.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. derrickleggett New Member

    Code:
    RESTORE FILELISTONLY
    FROM DISK = '\sharedirectoryfile.bak'
    --This will give you logical file names for the old databases.
    
    RESTORE DATABASE database_name
    FROM DISK = '\sharedirectoryfile.bak'
    WITH
         STATS = 1,
         MOVE 'logical_data_file' TO 'c:mssqldatafile_data.bak', --This will be the logical from first statement and new location.
         MOVE 'logical_log_file' TO 'c:mssqllogfile_log.bak' --This will be the logical from first statement and new location.
    
    
    If you get an error when you are doing this, let us know exactly what you typed and the exact error.
    
    MeanOldDBA
    derrickleggett@hotmail.com
    
    When life gives you a lemon, fire the DBA. 

Share This Page