How to take a Sql database out of standyby mode

Greg Booth 1,316 Reputation points
2022-10-19T14:45:51.32+00:00

We have a database that is in STANDBY mode (and is also read only)
We want to take a backup of it (before we delete it)
The database has been used as a read only copy of another database - kept in synch via log shipping, but we no longer have the master copy.

It looks like i can take the database out of standyby mode using the following command (i.e. without referencing a file to restore to - so its not actually restoring the database from a backup file ?):
Restore database {database name} with recovery

Is this the correct command to use and can you see any issues with using this command ?
We will never need to go back to using log shipping with the database or otherwise put it back into standby mode.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,695 questions
{count} votes

Accepted answer
  1. CathyJi-MSFT 21,966 Reputation points Microsoft Vendor
    2022-10-20T02:53:02.177+00:00

    Hi @Greg Booth ,

    > Is this the correct command to use and can you see any issues with using this command ?

    Yes, it is correct. I test this in my environment, there is no issue with using this command.

    1. Run this command as below screenshot. You don't have to actually restore from a backup file.
      252196-capture.png
    2. Right click the database, choose Refresh option, then you can see the database in online sate.
      252243-1.png

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


0 additional answers

Sort by: Most helpful

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.