If you want to use SQL Clone from Powershell, read Using the PowerShell cmdlets.
If you want to use SQL Clone from the UI, read Using the UI.
Important Tips
- Do not delete clone databases via SQL Server. Use the User Interface or the Remove-InstantCloneClone cmdlet. This ensures everything is tidied-up correctly.
- On machine restart, or a restart of the SQL Server service, your clones will have stopped. The Redgate SQL Clone service will restore the clones when it restarts, or you can run Restore-InstantClone in PowerShell.
Space and Time
- A snapshot takes approximately 20 seconds per GB to create – the limiting factor is usually the speed of your storage. A snapshot will occupy a similar amount of space as the original database.
- A clone takes approximately 5 seconds to create. Upon creation, a clone uses roughly 30MB, regardless of the snapshot size. If you write to the clone, for instance by inserting, updating or deleting data, this will increase the size of the clone.
- If you snapshot a clone, then you get a ‘chain’ of snapshots, which effectively uses less disk space. For instance, let’s say we snapshot a 10GB database, clone it, make 1GB of additions, and then snapshot the clone. The 1st snapshot is 10GB, but the 2nd snapshot is only 1GB – not 11GB. This is because the 2nd snapshot references the 1st. This method can be used to create a space-efficient chain of clones/snapshots.