Wednesday, February 1, 2023

Creat DB snapshot in order to reuse the test data

 --Taking the snapshot

CREATE DATABASE AxDB_Snapshot ON  
( NAME = <DB Logical name>, FILENAME =  
'<the path to save the snapshot file>' )  
AS SNAPSHOT OF AxDB;
It took me around 2 mins to create the snapshot

--Restoring the database from the snapshot
ALTER DATABASE AxDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
RESTORE DATABASE AxDB from  
DATABASE_SNAPSHOT = 'AxDB_Snapshot';  
ALTER DATABASE AxDB SET MULTI_USER;

No comments:

Post a Comment

Set up Onebox VM for D365 FO with non-organization microsoft account

With the release of the new VHD 10.0.37, I have tried to create a Onebox VM in my laptop instead of using the cloud hosted environment and f...