Get-NimDatabaseSnapshot

The Get-NimDatabaseSnapshot cmdlet queries all the arrays configured on the host and displays details about all the snapshots present. If any snapshot has SQL database details, then those details are populated as well.

This cmdlet returns a list of NimDatabaseSnapshot objects, each of which contains {SnapShotCollectionName,SnapShotCollectionID, VolumeCollectionName, Application, AppAware, DbInstanceName, DbName, DbHostName, ArrayMgmtIP, CreationTime, VSS, VerifiyBackup, SkipDatabaseVerification, AppConsistentObjects, SnapshotCount, IsReplica,and PoolName}.

Refer to General Best Practices for Using Cmdlets for general tips for working with cmdlets. The Get-NimDatabaseSnapshot cmdlet also has the following best practice recommendation:
  • Define a single initiator group with all the initiators of each node in the cluster.

The Get-NimDatabaseSnapshot cmdlet has the following limitations:
  • Your credentials must allow you to access the groups affected by the cmdlet. Use the Set-Configuration cmdlet to configure your credentials.

If you experience a problem using the Get-NimDatabaseSnapshot cmdlet, check the information in Troubleshooting Cmdlet Issues.

Options

The Get-NimDatabaseSnapshot cmdlet supports several command options.

-DBName <String[]> option. The name of the database to be queried. The format of the parameter is instanceName/DBName. Only forward slashes are accepted with instanceName. If you do not provide an SQL instance as the value for instanceName, the default SQL instance (the localhostname) is used. You can use this option with the SQLInstance option.

-Application <String> option. The name of the application that requires the snapshot details. The default value is sql.
NOTE: Currently only sql is supported.

-SQLInstance <String[]> option. The name of the SQL instance. You can use this option with the DBName option. When you include the DBName option, the cmdlet returns details of both the database in the DBName option and all the databases in the SQL instance. If there are multiple databases in different SQL instances, you can use this parameter to specify the SQL instance that you want to use. For example, you might enter -DBName sqlcluster4/c7a8db1.

-MaxObjects <UInt32> option. The number of snapshots the cmdlet should get. If you do not specify a number, all records are returned. The latest snapshots are determined by the CreateTime option.

-From <DateTime> option. Get snapshots created from the time and date you specify. If no value is specified, the procedure starts with any date. The value for this parameter should be specified in local time.

-To <DateTime> option. Get snapshots created through the time and date you specify. If no value is specified, the procedure ends with any date. The value for this parameter should be specified in local time.

-OnlyReplica [<SwitchParameter>] Specifies whether to include only replica (downstream array) snapshots. The default is to include both replicated and non-replicated snapshots. If you are using synchronous/asynchronous replication, you can use the Get-NimDatabaseSnapshot and Invoke-NimDatabaseClone cmdlets to create a clone using the snapshot collection of a downstream array. You can then enter a command line similar to: Get-NimDatabaseSnapshot -OnlyReplica -DBName <name>> -MaxObjects <integer> | Invoke-NimDatabaseClone
NOTE: You must register the management IP of the downstream array when you are using asynchronous replication and when the "OnlyReplica" switch parameter uses Set-Configuration.
-NoReplica [<SwitchParameter>]Specifies whether to include only non-replica (upstream array) snapshots. The default is to include both replicated and non-replicated snapshots. If you are using synchronous replication, you can use the Get-NimDatabaseSnapshot and Invoke-NimDatabaseClone cmdlets to create a clone using the snapshot collection of an upstream array. You do not need to register the management IP of the downstream array in this situation. You can enter a command line similar to: Get-NimDatabaseSnapshot -NoReplica -DBName <name>> -MaxObjects <integer> | Invoke-NimDatabaseClone

-InformationAction <ActionPreference> option. This is a default PowerShell option and has no effect on the cmdlet execution.

-InformationVariable <String> option. This is a default PowerShell option and has no effect on the cmdlet execution.

-WhatIf [<SwitchParameter>] option. This option validates the parameter, but does not modify data. When used with the -Verbose option, it displays messages on the console.

-Confirm [<SwitchParameter>] option. This option is used with the -Force option to ensure that a confirmation message is displayed. It has no effect on the cmdlet execution.

<CommonParameters>. This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Syntax variants

The command options you use with the Get-NimDatabaseSnapshot cmdlet vary depending on the type of object you want to remove.

NOTE: For more details about working with the cmdlet, view the cmdlet help by entering Get-Help <cmdlet_name>.

The cmdlet has the following basic format:

Get-NimDatabaseSnapshot [-DBName <String[]>] [-Application <String>] [-SQLInstance <String[]>] [-MaxObjects <UInt32>] [-From <DateTime>] [-To <DateTime>] [-OnlyReplica <SwitchParameter>] [-NoReplica <SwitchParameter>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Get all snapshots from the arrays configured on the host example:

Get-NimDatabaseSnapshot

Get all the snapshots of a database from the array example:

Get-NimDatabaseSnapshot -DBName dbo

Get all the snapshots belonging to the SQL database residing on a particular SQL instance example:

Get-NimDatabaseSnapshot -DBName dbo -SQLInstance test1

Get all the snapshots belonging to SQL database residing on SQL instances or belonging to a particular database example:

Get-NimDatabaseSnapshot -DBName dbo -SQLInstance test1, winhost2