建立 SSIS 目錄

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

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

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

  1. 開啟 SQL Server Management Studio。

  2. 連線到 SQL Server 資料庫引擎。

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

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

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

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

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

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

    此密碼保護用來加密目錄資料的資料庫主要金鑰。 請將密碼儲存在安全位置。 建議您同時備份資料庫主要金鑰。 如需相關資訊,請參閱 Back Up a Database Master Key

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

  1. 執行下列 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 目錄