Remove-InstantCloneClone

Remove an InstantClone clone.

Syntax

Remove-InstantCloneClone -CloneName <string> [-onlyData] [<CommonParameters>]

Remove-InstantCloneClone -CloneId <string> [-onlyData] [<CommonParameters>]

Remove-InstantCloneClone -All [-onlyData] [<CommonParameters>]

Description

This removes the clone database, backing-file and directory. The original snapshot is unaffacted. This should always be used to remove a clone - do not directly remove the cloned database in SQL Server.

Parameters

-CloneName <System.String>

The name of the clone you want to remove.

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

-CloneId <System.String>

The Id of the clone you want to remove.

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

-All <System.Management.Automation.SwitchParameter>

Remove all clones.

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

-onlyData <System.Management.Automation.SwitchParameter>

This removes the data, but not the SQL Server database. Use this switch if you've removed the SQL Server Database manually, and now need to remove the backing clone VHD and entry in the list of clones.

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.

Return values

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

Examples

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

Remove-InstantCloneClone -CloneName AWClone4 -Verbose

This removes the clone AWClone4. The AWClone4 database is removed from your SQL Server and the backing data is removed. The snapshot, and the snapshot's original database, are unaffected.

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

Remove-InstantCloneClone -CloneName AWClone8 -onlyData

If I remove the database AWClone8 via SSMS, then the associated InstantClone files are left. This is not a desirable state. This command removes the database and metadata, but does not require the AWClone8 database to still exist.

---------- EXAMPLE 3 ----------

Remove-InstantCloneClones -All -Verbose

This removes all your clones.