# Get-CVSQLDatabase

The `Get-CVSQLDatabase` cmdlet retrieves a list of SQL databases in your CommCell environment.

Before you can use this cmdlet, you must log on to your CommCell environment using the `Connect-CVServer` cmdlet. For more information, see Connecting to a CommCell Environment with PowerShell.

## Syntax

    Get-CVSQLDatabase [-SortColumn $[bkpTime | bkpSize | insName | dbName | cName | planName]] [-SortDescending] [-OnlySLA] [-ShowSysDB] [-AllProperties] [-IncludeTotalCount] [-Skip $[UInt64]] [-First $[UInt64]] [$[CommonParameters]]

    Get-CVSQLDatabase [-Name $[String]] [-ClientName $[String]] [-InstanceName $[String]] [-SortColumn $[bkpTime | bkpSize | insName | dbName | cName | planName]] [-SortDescending] [-OnlySLA] [-ShowSysDB] [-AllProperties] [-IncludeTotalCount] [-Skip $[UInt64]] [-First $[UInt64]] [$[CommonParameters]]

    Get-CVSQLDatabase [-Id $[int32]] [-InstanceId $[int32]] [-SortColumn $[bkpTime | bkpSize | insName | dbName | cName | planName]] [-SortDescending] [-OnlySLA] [-ShowSysDB] [-AllProperties] [-IncludeTotalCount] [-Skip $[UInt64]] [-First $[UInt64]] [$[CommonParameters]]

    Get-CVSQLDatabase [-InstanceObject $[Object]] [-SortColumn $[bkpTime | bkpSize | insName | dbName | cName | planName]] [-SortDescending] [-OnlySLA] [-ShowSysDB] [-AllProperties] [-IncludeTotalCount] [-Skip $[UInt64]] [-First $[UInt64]] [$[CommonParameters]]

## Optional Parameters

### Commvault Parameters

Parameter | Description | Data type | Values | Accepts pipeline input? | Accepts wildcard characters? | Type of parameter
--- | --- | --- | --- | --- | --- | ---
`–Name` | The name of the subclient to get databases for. | String |  | No | No | Named
`–Id` | The ID of the subclient to get databases for. | Int32 | The default value is 0. | No | No | Named
`–ClientName` | The name of the client to get databases for. | String |  | No | No | Named
`–InstanceName` | The name of the instance to get databases for. | String |  | No | No | Named
`–InstanceId` | The ID of the instance to get databases for. | Int32 | The default value is 0. | No | No | Named
`–InstanceObject` | The object that represents the instance to get databases for. | Object |  | True, by: Value Property name | No | Named
`–SortColumn` | The column to sort the databases by. | Enumerated | Valid values: bkpTime bkpSize insName dbName (default) cName planName | No | No | Named
`–SortDescending` | Sorts the databases in descending order. | SwitchParameter |  | No | No | Named
`–OnlySLA` | Lists only databases that have missed Service Level Agreements (SLAs). | SwitchParameter |  | No | No | Named
`–ShowSysDB` | Includes system databases in the output. | SwithchParameter |  | No | No | Named
`–AllProperties` | Retrieves all properties of the databases. | SwitchParameter |  | No | No | Named
`–IncludeTotalCount` | Includes a total count of the databases. | SwitchParameter |  | No | No | Named
`–Skip` | This parameter allows you to skip the first 'x' number of pages from the output and then displays the rest of the pages. | UInt64 |  | No | No | Named
`–First` | This parameter allows you to display first 'x' number of records in one page and the remaining records in the next page. | UInt64 |  | No | No | Named

### Microsoft PowerShell Parameters

You can use the following Microsoft PowerShell parameters:

- Debug

- ErrorAction

- ErrorVariable

- OutBuffer

- OutVariable

- PipelineVariable

- Verbose

- WarningAction

- WarningVariable

- Force

- Confirm

- WhatIf

Note

Only a few cmdlets support Force, Confirm, and WhatIf parameters.

For more information, see "About Common Parameters" in the Microsoft PowerShell documentation.

## Input

This cmdlet does not support input.

## Output

PSCustomObject that contains SQL database properties.

## Examples

### List SQL Databases Sorted By Column

The following example returns a list of SQL databases, sorted by backup size.

    Get-CVSQLDatabase -SortColumn bkpSize

### List SQL Databases with Paging Support

The following example returns a list of SQL databases with first 5 databases in one page, without skipping any page from the output.

    Get-CVSQLDatabase -First 5 -Skip 0

×

Loading...