Get-SCDWEntity
Get-SCDWEntity
Gets the list of fact tables, dimensions, tables, and outriggers that exist in a data warehouse.
Syntax
Parameter Set: DatamartConnectionSet
Get-SCDWEntity [-ComputerName <String> ] [-Credential <PSCredential> ] [-DatamartComputerName <String> ] [-DatamartDatabaseName <String> ] [ <CommonParameters>]
Detailed Description
The Get-SCDWEntity cmdlet gets the list entity names and their types. Entities include act tables, dimensions, tables, and outriggers that exist in the data warehouse.
Entity names are required for setting watermarks, and for setting and getting retention periods; by using the Set-SCDWWatermark, Set-SCDWRetentionPeriod, and Get-SCDWRetentionPeriod cmdlets.
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. Typically, this is the Structured Query Language (SQL) database server that the data warehouse uses. If no value is provided, inspects the configuration of the data warehouse and discovers the value.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DatamartDatabaseName<String>
Specifies the name of the database of the datamart. Typically, this is the SQL database server that the data warehouse uses. The default value is the data warehouse repository. Entity values can be retrieved from the Staging or from the DataMart databases.
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.
Microsoft.EnterpriseManagement.Warehouse.Cmdlets.GetSCDWEntity
A collection of Microsoft.EnterpriseManagement.Warehouse.Cmdlets.GetSCDWEntity objects.
Examples
Example 1: Display entity name and type values
This command displays the EntityName values and their EntityType, and displays the output in pages.
PS C:\> Get-SCDWEntity -ComputerName "serverDW72" | Format-Table -AutoSize | Out-Host -Paging
Example 2: Display entity data using stored credentials
The first command stores user credentials for the Credential parameter.
The second command displays the entity data using the specified credentials.
PS C:\> $credUser = Get-Credential
PS C:\> Get-SCDWEntity -ComputerName "serverDW72" –Credential $credUser| Format-Table -AutoSize | Out-Host -Paging
Example 3: Display entity names sorted by entity type
This command displays the EntityName values sorted by their EntityType.
PS C:\> Get-SCDWEntity -ComputerName "serverDW72" | Sort-Object -Property EntityType, EntityName | Format-Table –AutoSize | Out-Host -Paging
Example 4: Display all entity names of a specific type
This command displays the EntityName values whose EntityType value is Fact.
PS C:\> Get-SCDWEntity -ComputerName "serverDW72" | Where-Object {$_.EntityType -eq "Fact"} | Sort-Object -Property EntityType, EntityName | Format-Table -AutoSize
Example 5: Display all entities
This command displays the entities in the OMDWDatamart
database.
PS C:\> Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName OMDWDatamart | Format-Table -AutoSize | Out-Host -Paging
Example 6: Use hash tables to investigate entity data
This command and the one that follows show how to use hash tables to investigate the entity data. This example shows how to create hash tables of the entities according to their database and then how to derive hash tables from them to obtain specific data.
The first, third, and fifth command create hash tables.
The second, fourth, and sixth commands populate the hash tables with the entity names and types in the DWDatamart
, OMDWDatamart
, and CMDWDatamart
databases. The key is the entity name, and the value is the entity type.
PS C:\> $DWDatamart = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "DWDatamart" | ForEach-Object {$DWDatamart.Add($_.EntityName, $_.EntityType)}
PS C:\>$OMDWDatamart = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "OMDWDatamart" | ForEach-Object {$OMDWDatamart.Add($_.EntityName, $_.EntityType)}
PS C:\>$CMDWDatamart = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "CMDWDatamart" | ForEach-Object {$CMDWDatamart.Add($_.EntityName, $_.EntityType)}
Example 7: Create a hash table and populate it with entity data
This example assumes you still have the $DWDatamart
hash table created in the previous example.
The first command creates a hash table named $DWDatamart_Outrigger
.
The second command populates the $DWDatamart_Outrigger
hash table with the Outrigger entities in the DWDatamart
database.
PS C:\> $DWDatamart_Outrigger = @()
PS C:\>foreach ($key in $DWDatamart.Keys) {
>> if ($DWDatamart[$key] -eq "Outrigger") {
>> $DWDatamart_Outrigger.Add($key,$DWDatamart[$key])
>> }
>>}