Import-SPAccessServicesDatabase

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

Syntax

Import-SPAccessServicesDatabase
      [-AssignmentCollection <SPAssignmentCollection>]
      -Bacpac <Byte[]>
      -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

$accessDb = Get-SPAccessServicesDatabaseServer -ServiceContext http://site_url -DatabaseServer SQLSERVERNAME -DatabaseServerGroup DEFAULT
Import-SPAccessServicesDatabase -DatabaseName accessDatabaseName -ServerReferenceId $accessDb.ServerReferenceId -Bacpac (Get-Content -Path C:\accessDb.bacpac -Encoding Byte)

本範例會取得 Access Services 服務應用程式之SQL Server的 ServerReferenceId 值;-DatabaseServerGroup 預設會設定為 DEFAULT 值。 下一個步驟是將 bacpac 檔案匯入位元組陣列,最後將 Access Services 資料庫作為指定的 SQL 資料庫名稱匯入至指定的SQL Server。

參數

-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

-Bacpac

bacpac 檔案的位元組陣列。

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

-DatabaseName

要從 bacpac 檔案建立的資料庫名稱。

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 System.Byte[] Microsoft.SharePoint.PowerShell.SPAssignmentCollection

輸出

系統.物件