共用方式為


建立 SSIS 目錄

在 SQL Server Data Tools 中設計和測試封裝之後,可以將包含封裝的專案,部署到 Integration Services 伺服器。 在您將專案部署至 Integration Services 伺服器之前,該伺服器必須包含 SSISDB 目錄。 SQL Server 2012 的安裝程式不會自動建立目錄,您必須依照下列指示手動建立目錄。

您可以在 SQL Server Management Studio 中建立 SSISDB 目錄。 您也可以使用 Windows PowerShell 以程式設計方式建立目錄。

若要在 SQL Server Management Studio 中建立 SSISDB 目錄

  1. 開啟 SQL Server Management Studio。

  2. 連接到 SQL Server Database Engine。

  3. 在 [物件總管] 中,展開伺服器節點,以滑鼠右鍵按一下 [Integration Services 目錄] 節點,然後按一下 [建立目錄]

  4. 按一下 [啟用 CLR 整合]

    目錄便會使用 CLR 預存程序。

  5. 按一下 [在 SQL Server 啟動時允許自動執行 Integration Services 預存程序],讓 catalog.startup 預存程序在每次 SSIS 伺服器執行個體重新啟動時執行。

    預存程序會執行 SSISDB 目錄之作業狀態的維護。 它會在 SSIS 伺服器執行個體效能降低時,修正正在執行之任何封裝的狀態。

  6. 輸入密碼,然後按一下 [確定]

    此密碼保護用來加密目錄資料的資料庫主要金鑰。 請將密碼儲存在安全位置。 建議您同時備份資料庫主要金鑰。 如需詳細資訊,請參閱<備份資料庫主要金鑰>。

若要以程式設計方式建立 SSISDB 目錄

  • 執行下列 PowerShell 指令碼:

    # Load the IntegrationServices Assembly
    [Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.IntegrationServices")
    
    # Store the IntegrationServices Assembly namespace to avoid typing it every time
    $ISNamespace = "Microsoft.SqlServer.Management.IntegrationServices"
    
    Write-Host "Connecting to server ..."
    
    # Create a connection to the server
    $sqlConnectionString = "Data Source=localhost;Initial Catalog=master;Integrated Security=SSPI;"
    $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $sqlConnectionString
    
    # Create the Integration Services object
    $integrationServices = New-Object $ISNamespace".IntegrationServices" $sqlConnection
    
    # Provision a new SSIS Catalog
    $catalog = New-Object $ISNamespace".Catalog" ($integrationServices, "SSISDB", "P@assword1")
    $catalog.Create()
    

    如需如何使用 Windows PowerShell 和 Microsoft.SqlServer.Management.IntegrationServices 命名空間的其他範例,請參閱 blogs.msdn.com 上的部落格文章:SQL Server 2012 中的 SSIS 和 PowerShell。 如需此命名空間的概觀和程式碼範例,請參閱 blogs.msdn.com 上的部落格文章:SSIS 目錄管理物件模型初探

請參閱

工作

備份、 還原和移動的 SSIS 目錄

概念

SSIS 目錄