Restoring logshipping databases in sqlserver

Avyayah 1,291 Reputation points
2021-03-11T14:24:10.923+00:00

After logshipping all databases are in restoring status and for the users to start testing, I have restored the database using the latest transactional log. Is this process correct? Or should I be using RESTORE DATABASE Database Name WITH RECOVERY GO

76780-restoringdatabases.jpg

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. tibor_karaszi@hotmail.com 4,316 Reputation points
    2021-03-13T09:36:05.79+00:00

    STANDBY isn't an option because the backups are from a lower version of SQL Server. (The database has to be upgraded for the STANDBY recovery do be done, and that cannot be undone at the next restore).

    So either restore with RECOVERY and not be able to restore further log backups.

    Or restore with NORECOVERY an be able to restore further log backups. But not able to access the database.

    Above are the two options.


3 additional answers

Sort by: Most helpful
  1. tibor_karaszi@hotmail.com 4,316 Reputation points
    2021-03-11T14:31:57.14+00:00

    Don't use the GUI, since it is far far more complex what the GUI does compared to using T-SQL commands directly.

    Do you expect to restore more log backups?

    If "yes", then leave the database in restoring or restore your log backups using STANDBY (which requires you to give SQL server a working file to use).

    If "no", then you can say RESTORE DATABASE dbname WITH RECOVERY. Note that you will not be able to restore any more backups now (and this includes the log shipping).

    2 people found this answer helpful.
    0 comments No comments

  2. CarrinWu-MSFT 6,891 Reputation points
    2021-03-12T03:26:28.047+00:00

    Hi @Avyayah ,

    When you prepare to restore a database, you need to restore a full database backup first, and then restore transaction log backups in order. And if you have a lot of transaction log need to restore, please refer to Restore a Transaction Log Backup (SQL Server), see below:
    77005-backup.png

    If you just need to restore last transaction log, you can use below T-SQL, and then database will get online after restore has been completed:

    RESTORE LOG <database_name> FROM <backup_device> WITH RECOVERY;    
    GO  
    

    If I misunderstood what you mean, please let me know.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. CarrinWu-MSFT 6,891 Reputation points
    2021-03-16T05:32:25.79+00:00

    Hi @Avyayah ,

    SQL Server can configure the log shipping between lower version to higher version, but the database should in restoring mode only, STANDBY is not supported for cross versions of SQL Log shipping. Please refer to Will log shipping work on 2 different SQL Server versions? get more information.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.