Restore with NORECOVERY option isssue

andriancruzandriancruz Posts: 22
edited February 26, 2015 10:09PM in SQL Backup Previous Versions
Hi All,

I'd like to ask if anyone encountered this issue: I'm restoring the database with NORECOVERY option, because I want to restore Differential/Transaction logs backup after. But when i restored the database, I'll expect the database status should be restoring state, but when i checked the database is already accessible and I'm not able to restore the Differential/Transaction log backup. Below are the scripts that I'm using.

EXEC master..sqlbackup '-SQL "RESTORE DATABASE [Db_Name]
FROM DISK = ''Drive:Filename.sqb''
WITH MOVE ''Logical_name'' TO ''Drive:DB_Name.mdf'',
MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf REPLACE, NORECOVERY''"'

I'm using SQL Backup v7.7.0.7 server components.

Any help are highly appreciated. Thanks a lot!


Regards, Andrian

Comments

  • Eddie DEddie D Posts: 1,805 Rose Gold 5
    Hi

    Can you please confirm the syntax you are using?

    From your example you appear to be missing the closing two single quotation marks at the end of the move statement for the log file:
    MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf
    

    Where it should be:
    MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf''
    

    Can you please retry your script based on your example using the code below?
    EXEC master..sqlbackup '-SQL "RESTORE DATABASE [Db_Name] 
    FROM DISK = ''Drive:Filename.sqb''
    WITH MOVE ''Logical_name'' TO ''Drive:DB_Name.mdf'', 
    MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf'' REPLACE, NORECOVERY"'
    

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Hi Eddie,

    Your right I've missing the closing two single quotation marks :) Thanks a lot for the help it's working fine now.

    Cheers!

    Regards, Andrian
Sign In or Register to comment.