Get-NimDatabase

The Get-NimDatabase cmdlet queries all the arrays configured on the host and displays details about all the databases present on the volume that is on the current host.

This cmdlet returns a list of NimDatabase objects, each of which contains {DbName, DbInstanceName, DbType, DbVersion, DbClusterEnabled, SnapCollCount, DbHostVolumeCount, VolCollName, VolumeCountInVolcoll, DbFiles, DbArrayName, DbHostVolumes, DbArrayVolumes, AppConsistency, ReplicationEnable, and Verify}.

Refer to General Best Practices for Using Cmdlets for general tips for working with cmdlets. The Get-NimDatabase 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-NimDatabase cmdlet has the following limitations:
  • The databases being passed in the cmdlet must all reside on volumes that belong to the same group.
  • The volumes hosting the database should be part of the same volume collection.
  • 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-NimDatabase cmdlet, check the information in Troubleshooting Cmdlet Issues.

Options

The Get-NimDatabase 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.

-Application <String> option. The name of the application for which you are searching the database. 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.

-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-NimDatabase 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-NimDatabase [-DBName <String[]>] [-Application <String>] [-SQLInstance <String[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf <SwitchParameter>] [-Confirm <SwitchParameter>] [<CommonParameters>]

Prints all SQL databases residing on the volumes present on the host example:

Get-NimDatabase

Query only the default instance because instance name is not specified example:

Get-NimDatabase -DBName dbo

Query for dbname "dbo" in the default instance and also query all the databases present in SQL instance test1 example:

Get-NimDatabase -DBName dbo -SQLInstance test1

Query for dbname "dbo" in the default instance and also query all the databases present in the SQL instance test1 and winhost12 the default instance) example:

Get-NimDatabase -DBName dbo -SQLInstance test1, winhost12

Query for dbname "dbo" using an instance name example:

Get-NimDatabase -DBName test1/dbo