Compartilhar via


Get-SCDWRetentionPeriod

Get-SCDWRetentionPeriod

Gets the data retention period for a fact table.

Syntax

Parameter Set: EntitySet
Get-SCDWRetentionPeriod [-ComputerName <String> ] [-Credential <PSCredential> ] [-EntityName <String> ] [ <CommonParameters>]

Parameter Set: DatamartConnectionSet
Get-SCDWRetentionPeriod [-DatamartComputerName] <String> [-DatamartDatabaseName] <String> [-ComputerName <String> ] [-Credential <PSCredential> ] [-EntityName <String> ] [ <CommonParameters>]

Detailed Description

The Get-SCDWRetentionPeriod cmdlet gets the data retention period, in minutes, for either a specific fact table within a specific data warehouse database or for the default fact table within the database.
The Data Warehouse grooms out rows after a predefined retention period. Data that is eligible for grooming and that is older than the retention period will be groomed out of the database.

Parameters

-ComputerName<String>

Specifies the name of the computer on which the System Center Data Access service is running. The user account that is defined in the Credential parameter must have access rights to the specified computer. You can omit this parameter only if the System Center Data Access Service is running on the same computer that has Service Manager installed.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies the credentials to use when you are connecting to the server on which the System Center Data Access service is running. The user account that is provided must have access to that server.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DatamartComputerName<String>

Specifies the name of the computer on which the datamart resides. This is usually the SQL database server that the data warehouse uses. By default, discovers the value by inspecting the data warehouse configuration.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DatamartDatabaseName<String>

Specifies the name of the database of the datamart. This is usually the SQL database server that the data warehouse uses. The default value is the data warehouse repository. It is possible to retrieve the entities from the Staging or DataMart databases.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EntityName<String>

Specifies the Dimension, Fact, or Outrigger on which to set the watermark. You can use the Get-SCDWEntity cmdlet to retrieve the entities.

Aliases

none

Required?

false

Position?

named

Default Value

none

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    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None.

    You cannot pipe input to this cmdlet.

Outputs

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

  • None.

    This cmdlet does not generate any output.

Examples

Example 1: Get the data retention period for an entity

This command gets the data retention period for a specified entity name.

PS C:\> Get-SCDWRetentionPeriod -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "DWDataMart" -EntityName "IncidentStatusDurationFact"

Example 2: Populate a hash table with entity retention period information

The first command creates a variable for a hash table.

The second, third, and fourth commands populate the hash table with the retention period for each entity in three databases (DWDatamart, CMDWDataMart, and OMDWDataMart). The key for the hash table is the entity name with its database name in parenthesis, and the value is the retention period.

PS C:\> $AllEntitiesRP = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "DWDatamart" | ForEach-Object {
>>     $ent = $_.EntityName
>>     $rp = Get-SCDWRetentionPeriod -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "DWDatamart" -Entity $ent
>>     $AllEntitiesRP.Add($ent + " (DWDatamart)", $rp.RetentionPeriodInMinutes)
>> }
>>
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "CMDWDatamart" | ForEach-Object {
>>     $ent = $_.EntityName
>>     $rp = Get-SCDWRetentionPeriod -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "CMDWDatamart" -Entity $ent
>>     $AllEntitiesRP.Add($ent + " (CMDWDatamart)", $rp.RetentionPeriodInMinutes)
>> }
>>
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "OMDWDatamart" | ForEach-Object {
>>     $ent = $_.EntityName
>>     $rp = Get-SCDWRetentionPeriod -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "OMDWDatamart" -Entity $ent
>>     $AllEntitiesRP.Add($ent + " (OMDWDatamart)", $rp.RetentionPeriodInMinutes)
}

Get-SCDWEntity