These pages cover SQL Clone Technical Preview 0.2 to 0.3, which is not the latest version. Help for other versions is also available.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Sometimes it's useful to make changes to a snapshot before cloning it to other environments. SQL Clone allows you to save duplicate data storage by taking a snapshot of a clone.

 

Create a snapshot of the original database
Save-InstantCloneSnapshot -DatabaseName AdventureWorks -SnapshotName AWSnap1

 

Create as many clones as you like
New-InstantCloneClone -NewDatabaseName AWCloneA -SnapshotName AWSnap
New-InstantCloneClone -NewDatabaseName AWCloneB -SnapshotName AWSnap

Make any edits to these database - in this example 2GB and 1GB of data are changed respectively.

Create a snapshot so you can share local changes to AWCloneA
Save-InstantCloneSnapshot -DatabaseName AWCloneA -SnapshotName AWSnapA

Note how AWCloneA is now much smaller, and has AWSnapA as a parent. During this snapshot operation, the clone AWCloneA was temporarily taken offline, and its underlying diff disk is frozen as a snapshot. The clone is brought back online connected to a new diff disk. This method avoids duplicating data between AWSnapsA and AWCloneA.

Advanced example

This operation can be repeated many times. Here AWCloneA has been periodically snapshotted, with AWCloneA3Clone taken from one of those snapshots.

  • No labels