Get-SPDatabase

擷取資料庫的所有屬性。

Syntax

Get-SPDatabase
   [[-Identity] <SPDatabasePipeBind>]
   [-AssignmentCollection <SPAssignmentCollection>]
   [<CommonParameters>]
Get-SPDatabase
   -ServerInstance <SPDatabaseServiceInstancePipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [<CommonParameters>]
Get-SPDatabase
   [-AssignmentCollection <SPAssignmentCollection>]
   -Name <String>
   [<CommonParameters>]

Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.

Get-SPDatabase Cmdlet 會將資料庫的所有公用屬性顯示到目前的視窗。 如果指定 Identity 參數,則只會顯示該識別碼的屬性。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

--------------------範例 1---------------------

Get-SPDatabase | ?{$_.TypeName -eq 'Microsoft.Office.Server.Administration.ProfileDatabase'}

此範例會取得 User Profile Service 應用程式所使用的設定檔資料庫。

--------------------範例 2---------------------

Get-SPDatabase -Name 'Profile DB'

這個範例會依名稱取得設定檔資料庫。 僅適用于 SharePoint Server 2016 SharePoint Server 2019。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要顯示公用屬性的資料庫名稱。

此類型必須是格式 1234-3456-567kg 的有效 GUID。

Type:SPDatabasePipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ServerInstance

指定 SQL 執行個體的名稱,其包含的資料庫格式非為預設 SQL 執行個體的 "Server",即為具名 SQL 執行個體的"Server\Instance"。

Type:SPDatabaseServiceInstancePipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-名稱

指定資料庫的名稱。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition