How can we help you today? How can we help you today?

Restore with NORECOVERY option isssue

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
andriancruz
0

Comments

2 comments

  • Eddie D
    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 D
    0
  • andriancruz
    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
    andriancruz
    0

Add comment

Please sign in to leave a comment.