[SQL Clone home]
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.
Redgate SQL Instant Clone Alpha
This is an alpha release of SQL Instant Clone by Redgate Software. This is a limited alpha release for your personal use only – please don't distribute! This is an early version, so don't use it in production or on important systems.
SQL Instant Clone is a technology for creating many 'clones' of a Microsoft SQL Server database. These clones appear in a few seconds, use little disk space, and are independent of each other. You can use these clones just like any other SQL Server database. In each clone, it only stores the difference between the clone and the original snapshot.
Instant Clone can be used from PowerShell or from the command-line. The functionality is roughly the same.
Let us know how you get on! Email Richard.Macaskill@Red-Gate.com or Jason.Crease@Red-Gate.com with your thoughts.
The installer automatically sets up PowerShell to use the module located at: C:\Program Files (x86)\Red Gate\Instant Clone X.Y.Z\Modules\. Run the PowerShell command-line or ISE as an administrator. Use the cmdlets like this. Finish all invocations with –Verbose to see debug output.
# Set connection string for use by Instant Clone. Only need to do this the first time
Initialize-InstantCloneConnectionString -ConnectionString "Server=JOHNSMITHTEST\sql2012;Trusted_Connection=True" -Verbose
# Save a snapshot of my WidgetProd database to disk
Save-InstantCloneSnapshot -DatabaseName WidgetProd -SnapshotName WidgetSnp1 -Verbose
# Create a couple of clones from the WidgetSnp1 snapshot
New-InstantCloneClone -NewDatabaseName WidgetClone1 -SnapshotName WidgetSnp1 -Verbose
New-InstantCloneClone -NewDatabaseName WidgetClone2 -SnapshotName WidgetSnp1 -Verbose
# I'm bored with these clones now. Let's drop them
Remove-InstantCloneClone -CloneName WidgetClone1 -Verbose
Remove-InstantCloneClone -CloneName WidgetClone2 -Verbose
# Let's drop that snapshot too
Remove-InstantCloneSnapshot -SnapshotName WidgetSnp1 -Verbose
When you restart your machine, clone databases will be offline until you run the restore cmdlet:
Restore-InstantClone -Verbose
See all the clones and snapshots with the Show-InstantCloneSnapshots/Clones cmdlets
Show-InstantCloneSnapshots -Verbose
Show-InstantCloneClones -Verbose
See all cmdlets available with the Get-Command cmdlet:
Get-Command -Module RedGate.InstantClone.PowerShell
You may want to create a snapshot on one machine, but clone it on another. To do this, setup the
On the source machine:
Save-InstantCloneOptions -SharedSnapshotFolder [\\myServer\SharedSnapshots|\\myServer\SharedSnapshots] -Verbose
Save-InstantCloneSnapshot -DatabaseName AdventureWorks -SnapshotName AdvSnap -Verbose
Save-InstantCloneSharedSnapshot -SnapshotName AdvSnap -NewSnapshotName AdvSnapShared
A shared-snapshot can listed/deleted/cloned just like any other snapshot.
On the target machine:
Save-InstantCloneOptions -SharedSnapshotFolder [\\myServer\SharedSnapshots|\\myServer\SharedSnapshots] -Verbose
Show-InstantCloneSnapshots -Verbose
New-InstantCloneClone -SnapshotName AdvSnapShared -NewDatabaseName AdvClone -Verbose
>rgclone.exe connect –c "Data Source=JOHNSMITHTEST\SQL2012;Integrated Security=True;"
JOHNSMITH\SQL2012 will now be used as the Server for subsequent queries.
>rgclone snapshot -d AdventureWorks -s AdvSnap1
Snapshot mode : Full backup
Source database : Data Source=JOHNSMITHTEST\SQL2012;Integrated Security=True;
Snapshot folder : d:\snapshots
Snapshotting database [AdventureWorks] as 'AdvSnap1'
Snapshot complete
>rgclone clone -s AdvSnap1 –n AdvClone1
Clone connection string : Data Source= JOHNSMITHTEST\SQL2012;Integrated Security=True;
Clone folder : d:\clones
Cloning snapshot 'AdvSnap1' as new database [AdvClone1]
>rgclone clone -s AdvSnap1 –n AdvClone2
>rgclone clone -s AdvSnap1 –n AdvClone3
...
>rgclone drop clone AdvClone1
>rgclone drop snapshot AdvSnap1
>rgclone restore
Email richard.macaskill@red-gate.com
Read https://www.red-gate.com/assets/purchase/assets/license.pdf . Remember, this product is an experimental product for your own use only.