Create an InstantClone snasphot from a database or backup file.
Save-InstantCloneSnapshot -DatabaseName <string> -SnapshotName <string> [-PutInSharedFolder] [<CommonParameters>] |
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.
-DatabaseName
<System.String>
The name of the database to snapshot.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | false |
| Accept Wildcard Characters | false |
-SnapshotName
<System.String>
The name to give the snapshot.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | false |
| Accept Wildcard Characters | false |
-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 Input | false |
| Accept Wildcard Characters | false |
-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 Value | False |
| Accept Pipeline Input | false |
| Accept Wildcard Characters | false |
<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.
The input type is the type of the objects that you can pipe to the cmdlet.
The output type is the type of the objects that the cmdlet emits.
|
This creates a new InstantClone snapshot called AdvSnap1 from the database AdvWorks2012. We then clone it to a new database called AdvClone1.
|
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.