In the previous two articles, I have shared basic details about the SQL Server Snapshot and how we can configure it.
But one of the important things is, we can also restore a source database from the created Snapshot database.
When we update anything in the source database, it holds the modified pages and copied original pages into the Snapshot database.
The Snapshot database is a collection of the original pages and source database may have some original and updated pages.
The Snapshot is a virtual backup of the Source database and sometimes it happens that after the creation of Snapshot database, some invalid operation or update happen on the source database.
If any corruption happens in the Source database, we can restore original pages from Snapshot database and can overwrite on the modified pages in the Source database and Transaction log also update accordingly.
Generally, restoring a database from the Snapshot is not an always preferable option.
The best practice is to take a full database backup regularly and whenever it is required we can restore it. But to restore a Source Database using Snapshot Database is faster than the regular restore operation.
Script to restore using Snapshot Database:
RESTORE DATABASE [Source_Database]
FROM DATABASE_SNAPSHOT = 'Snapshot_Database'
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.