Export-SPAccessServicesDatabase

透過 Data-Tier 架構將 Access Services 資料庫匯出至 DACPAC。

Syntax

Export-SPAccessServicesDatabase
      [-AssignmentCollection <SPAssignmentCollection>]
      -DatabaseName <String>
      -ServerReferenceId <Guid>
      [<CommonParameters>]

Description

此 Cmdlet 會將 Access Services 資料庫匯出至 DACPAC。 Cmdlet 需要在執行 Cmdlet 的 SharePoint 伺服器上安裝Data-Tier架構。 您可以在Microsoft® SQL Server Data-Tier ® Application Framework (17.4.1 GA DacFx) 找到 Data-Tier Framework 套件。 從下載安裝下列 MSI:

EN\x86\DacFramework.msi

注意:需要 x86 套件。 x64 套件與這個 Cmdlet 不相容。

如需Data-Tier架構的詳細資訊,請參閱 資料層應用程式

範例

範例 1

$contentdb = Get-SPContentDatabase ContentDbName
$accessDb = Get-SPAccessServicesDatabase -ContentDb $contentdb -EA 0 | Select -First 1
Export-SPAccessServicesDatabase -DatabaseName $accessDb.DatabaseName -ServerReferenceId $accessDb.ServerReferenceId | Set-Content -Path C:\accessDb.bacpac -Encoding Byte

此 Cmdlet 會從指定的內容資料庫擷取第一個 Access 資料庫,並將 Access 資料庫匯出至 BACPAC。 然後,您可以透過SQL Server Management Studio匯入此 BACPAC 檔案,以還原 Access 資料庫。

參數

-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 2016, SharePoint Server 2019

-DatabaseName

Access 資料庫的名稱。

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2016, SharePoint Server 2019

-ServerReferenceId

用於 Access 資料庫的 ServerReferenceId。

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2016, SharePoint Server 2019

輸入

System.String

System.Guid Microsoft.SharePoint.PowerShell.SPAssignmentCollection

輸出

系統.物件