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.

Save-InstantCloneSnapshot

Create an InstantClone snasphot from a database or backup file.

Syntax

Save-InstantCloneSnapshot -DatabaseName <string> -SnapshotName <string> [-PutInSharedFolder] [<CommonParameters>]

Save-InstantCloneSnapshot -SnapshotName <string> -BackupPath <string[]> [-PutInSharedFolder] [<CommonParameters>]

Description

A snapshot is a file created from the original database (or backup) files. You can then create clones based on this snapshot file, using the New-InstantCloneClone cmdlet.

Snapshots files are created in the folder specified as the SnapshotFolder option. Edit this with the Save-InstantCloneOptions cmdlet.

A snapshot file is approximately the same size as the original database, and takes approximately 20s/Gb to create.

Parameters

-DatabaseName <System.String>

The name of the database to snapshot.

Aliases None
Required?true
Position?named
Default Value None
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

-SnapshotName <System.String>

The name to give the snapshot.

Aliases None
Required?true
Position?named
Default Value None
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

-BackupPath <System.String[]>

One or more SQL Server backup files to create a snapshot from. Specify a single backup file as a string, and mulitple backup files as an array of strings: @("c:\backup\file1.bak", "c:\backup\file2.bak")

Aliases None
Required?true
Position?named
Default Value None
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

-PutInSharedFolder <System.Management.Automation.SwitchParameter>

Use this switch to put the snapshot directly in the shared snapshots folder.

Aliases None
Required?false
Position?named
Default ValueFalse
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None.
    You cannot pipe input to this cmdlet.

Return values

The output type is the type of the objects that the cmdlet emits.

  • None.
    You cannot pipe input to this cmdlet.

Examples

---------- EXAMPLE 1 ----------

Save-InstantCloneSnapshot -DatabaseName AdvWorks2012 -SnapshotName AdvSnap1 -Verbose
New-InstantCloneClone -SnapshotName AdvSnap1 -NewDatabaseName AdvClone1     -Verbose

This creates a new InstantClone snapshot called AdvSnap1 from the database AdvWorks2012. We then clone it to a new database called AdvClone1.

---------- EXAMPLE 2 ----------

Save-InstantCloneSnapshot -BackupPath "D:\awbak.bak" -SnapshotName AdvFromBackup -Verbose
Save-InstantCloneSnapshot -BackupPath @("D:\AWBakMulti\a1.bak", "D:\AWBakMulti\a2.bak", "D:\AWBakMulti\a3.bak" ) -SnapshotName AdvMulti -PutInSharedFolder -Verbose

The first line creates an InstantClone snapshot AdvFromBackup from the backup file awbak.bak.

This creates an InstantClone snapshot AdvMulti from the backup stored across the backup files a1.bak, a2.bak and a3.bak. The snapshot is created as a shared snapshot in the SharedSnapshots folder.

  • No labels