Home » Topic » Error While Restoring SQL Database From .bak File

Error While Restoring SQL Database From .bak File

Lincoln Burrows ~ Modified: May 27th, 2016 ~ ~ 1 Minute Reading

Home Forums Error While Restoring SQL Database From .bak File

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2123 Score: 0
    Lincoln Burrows
    Moderator
    16 pts

    Hi, I have .bak file and want to restore it via sqlcmd. Please share restore command
    When I am trying to restore a .bak file I am getting the error message

     

    RESTORE DATABASE [XXX] FILE = N’XXX’ FROM DISK = N’C:\DRM\
    SQL_SERVER_BACKUP\XXX.bak’ WITH FILE = 2, MOVE N’XXX’ TO N’c
    :\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\\DRM_G
    OLD_PS3.mdf’, MOVE N’DRM_GOLD_PS3_log’ TO N’c:\Program Files (x86)\Microsoft SQ
    L Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\\XXX.LDF’, NOUNLOAD, STATS = 10

     

    Msg 3234, Level 16, State 1, Server YYYY, Line 1
    Logical file ‘XXX’ is not part of database ‘XXX’. Use RESTORE
    FILELISTONLY to list the logical file names.
    Msg 3013, Level 16, State 1, Server YYYY, Line 1
    RESTORE DATABASE is terminating abnormally.

    #2132 Score: 0
    Barry Alllen
    Moderator
    25 pts
    RESTORE DATABASE [DBName] FROM DISK = N'C:\DRM\SQL_SERVER_BACKUP\XXX.bak' 
    MOVE N'DRM_GOLD_PS3' TO N'c:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\DRM_GOLD_PS3.mdf', 
    MOVE N'DRM_GOLD_PS3_log' TO N'c:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\DRM_GOLD_PS3_log.LDF', 
    NOUNLOAD, STATS =1
    #2135 Score: 0
    Stephen West
    Moderator
    4 pts

    Simple CMD–>Restore database DBname from disk=’Path where is the .bak file’ with NO_Recovery.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.