SSRS 服務應用程式的佈建訂閱及警示Provision Subscriptions and Alerts for SSRS Service Applications

Reporting ServicesReporting Services 訂閱和資料警示需要 SQL Server Agent,並且需要 SQL Server Agent 的權限組態。subscriptions and data alerts require SQL Server Agent and require the configuration of permissions for SQL Server Agent. 如果您看到錯誤訊息指出需要 SQL Server Agent,而您已確認 SQL Server Agent 正在執行,則請更新或驗證權限。If you see error messages that indicate SQL Server Agent is required and you have verified SQL Server Agent is running, then update or verify permissions. 本主題的範圍是 SharePoint 模式的 Reporting ServicesReporting Services ,且本主題說明三種可以用 Reporting ServicesReporting Services 訂閱來更新 SQL Server Agent 權限的方法。The scope of this topic is Reporting ServicesReporting Services in SharePoint mode and the topic describes three ways you can update the permissions of SQL Server Agent with Reporting ServicesReporting Services subscriptions. 在本主題中用來執行步驟的認證必須要有足夠的權限,才能針對服務應用程式、msdb 和 master 資料庫中的物件授與 RSExecRole 的執行權限。The credentials you use for the steps in this topic need to have sufficient permissions to grant execute permissions to the RSExecRole for objects in the service application, msdb, and master databases.

適用於:Applies to: SharePoint 2013 | SharePoint 2010適用於:Applies to: SharePoint 2013 | SharePoint 2010

服務應用程式資料庫的 SQL Agent 權限SQL Agent permissions to Service Application DBs

描述Description
11 主控 Reporting Services 服務應用程式資料庫的 SQL Server Database Engine 執行個體。The instance of SQL Server Database engine that is hosting the Reporting Services service application databases.
22 SQL Database Engine 執行個體的 SQL Server Agent 執行個體。The instance of SQL Server agent for the instance of the SQL database engine.
33 Reporting Services 服務應用程式資料庫。The Reporting Services service application databases. 這些名稱會以用於建立服務應用程式的資訊為基礎。The names are based on the information used for creating the service application. 以下是範例資料庫名稱:The following are example database names:

ReportingService_2fbae157295d49df86d0b85760c704b0ReportingService_2fbae157295d49df86d0b85760c704b0

ReportingService_2fbae157295d49df86d0b85760c704b0_AlertingReportingService_2fbae157295d49df86d0b85760c704b0_Alerting

ReportingService_2fbae157295d49df86d0b85760c704b0TempDBReportingService_2fbae157295d49df86d0b85760c704b0TempDB
44 SQL Server Database Engine 執行個體的 master 和 MSDB 資料庫。The master and MSDB database of the instance of the SQL Server Database engine.

使用下列三種方法之一來更新權限:Use one the following three methods to update the permissions:

  1. 從 [條款、訂閱和警示] 頁面上鍵入認證,然後按一下 [確定] 。From the Provisions and Subscriptions and Alerts page, type credentials and click ok.

  2. 從 [提供訂閱和警示] 頁面按一下 [下載指令碼] 按鈕,下載可用來設定權限的 Transact SQL 指令碼。From the Provisions and Subscriptions and Alerts page, click the Download Script button to download a transact SQL script that can be used to configure permissions.

  3. 執行 PowerShell Cmdlet,以建立可用來設定權限的 Transact-SQL 指令碼。Run a PowerShell cmdlet to build a transact SQL script that can be used to configure permissions.

若要使用佈建頁面更新權限To update permissions using the provision page

  1. 從 SharePoint 管理中心,按一下 [應用程式管理] 群組中的 [管理服務應用程式] 。From SharePoint Central Administration, in the Application Management group click Manage Service Applications

  2. 在清單中尋找服務應用程式,並按一下應用程式的名稱,或按一下 [類型] 欄選取服務應用程式,然後按一下 SharePoint 功能區中的 [管理] 按鈕。Find your service application in the list and click the name of the application or click the Type column to select the services application and click the Manage button in the SharePoint ribbon.

  3. 在 [管理 Reporting Services 應用程式] 頁面上,按一下 [提供訂閱和警示] 。On the Manage Reporting Services Application page, click Provision Subscriptions and Alerts.

  4. 如果 SharePoint 管理員對 Master 資料庫和服務應用程式資料庫有足夠的權限,請輸入這些認證。If the SharePoint administrator has enough privileges to the Master database and the service application databases, type those credentials.

  5. 按一下 [確定] 按鈕。Click the OK button.

下載 Transact-SQL 指令碼To download the Transact-SQL Script

  1. 從 SharePoint 管理中心,按一下 [應用程式管理] 群組中的 [管理服務應用程式] 。From SharePoint Central Administration, in the Application Management group click Manage Service Applications

  2. 在清單中尋找服務應用程式,並按一下應用程式的名稱,或按一下 [類型] 欄選取服務應用程式,然後按一下 SharePoint 功能區中的 [管理] 按鈕。Find your service application in the list and click the name of the application or click the Type column to select the services application and click the Manage button in the SharePoint ribbon.

  3. 在 [管理 Reporting Services 應用程式] 頁面上,按一下 [提供訂閱和警示] 。On the Manage Reporting Services Application page, click Provision Subscriptions and Alerts.

  4. 在 [檢視狀態] 區域中,確認 SQL Server Agent 正在執行。In the View Status area, verify SQL Server Agent is running.

  5. 按一下 [下載指令碼] ,下載您可以在 SQL Server Management Studio 中執行以授與權限的 Transact-SQL 指令碼。Click Download Script to download a transact SQL script you can run in SQL Server Management studio to grant permissions. 建立的指令碼檔案名稱會包含 Reporting Services 服務應用程式的名稱,例如 [服務應用程式的名稱]-GrantRights.sqlThe script file name that is created will contain the name of your Reporting Services service application name, for example [name of the service application]-GrantRights.sql.

使用 PowerShell 產生 Transact-SQL 陳述式To generate the Transact-SQL statement with PowerShell

  1. 您也可以在 SharePoint 2010 管理命令介面中使用 Windows PowerShell Cmdlet 建立 Transact-SQL 指令碼。You can also use a Windows PowerShell cmdlet in the SharePoint 2010 Management Shell to create the Transact-SQL script.

  2. 在 [開始] 功能表上,按一下 [所有程式] 。On the Start menu, click All Programs.

  3. 依序展開Microsoft SharePoint 2010 產品然後按一下SharePoint 2010 管理命令介面Expand Microsoft SharePoint 2010 Products and click SharePoint 2010 Management Shell.

  4. 透過取代報表伺服器資料庫的名稱、應用程式集區帳戶及陳述式的路徑,來更新下列 PowerShell Cmdlet。Update the following PowerShell cmdlet by replacing the name of the report server database, application pool account, and the path of the statement.

    Cmdlet 的語法: Get-SPRSDatabaseRightsScript -DatabaseName <ReportingServices database name> -UserName <app pool account> -IsWindowsUser | Out-File <path of statement>Syntax of cmdlet: Get-SPRSDatabaseRightsScript -DatabaseName <ReportingServices database name> -UserName <app pool account> -IsWindowsUser | Out-File <path of statement>

    範例 Cmdlet: Get-SPRSDatabaseRightsScript -DatabaseName ReportingService_46fd00359f894b828907b254e3f6257c -UserName "NT AUTHORITY\NETWORK SERVICE" -IsWindowsUser | Out-File c:\SQLServerAgentrights.sqlSample cmdlet: Get-SPRSDatabaseRightsScript -DatabaseName ReportingService_46fd00359f894b828907b254e3f6257c -UserName "NT AUTHORITY\NETWORK SERVICE" -IsWindowsUser | Out-File c:\SQLServerAgentrights.sql

使用 Transact-SQL 指令碼Using the Transact-SQL Script

下列程序可搭配從佈建頁面下載的指令碼,或透過 PowerShell 建立的指令碼使用。The following procedures can be used with scripts download from the provisions page or scripts created using PowerShell.

在 SQL Server Management Studio 中載入 Transact-SQL 指令碼To load the Transact-SQL script in SQL Server Management Studio

  1. 若要開啟 SQL Server Management Studio,在開始功能表上,按一下Microsoft SQL Server 2012然後按一下SQL Server Management StudioTo open SQL Server Management Studio, on the Start menu, click Microsoft SQL Server 2012 and click SQL Server Management Studio.

  2. 在 [連接到伺服器] 對話方塊上,設定下列選項:In the Connect to Server dialog box set the following options:

    • 在 [伺服器類型] 清單中,選取 [資料庫引擎] In the Server type list, select Database Engine

    • 在 [伺服器名稱] 中,鍵入您要設定 SQL Server Agent 的 SQL Server 執行個體名稱。In Server Name, type the name of the SQL Server instance on which you want to configure SQL Server Agent.

    • 選取驗證模式。Select an authentication mode.

    • 如果使用 SQL Server 驗證連接,請提供登入和密碼。If connecting using SQL Server Authentication, provide a login and password.

  3. 按一下 [連接]Click Connect.

執行 Transact-SQL 陳述式To run the Transact-SQL statement

  1. 在 SQL Server Management Studio 的工具列上,按一下 [新增查詢] 。On the toolbar of SQL Server Management Studio, click New Query.

  2. 在 [檔案] 功能表上,按一下 [開啟] ,然後按一下 [檔案] 。On the File menu, click Open, and then click File.

  3. 瀏覽至您在 SharePoint 2010 管理命令介面中產生之 Transact-SQL 陳述式的儲存所在資料夾。Navigate to the folder where you saved the Transact-SQL statement that you generated in SharePoint 2010 Management Shell.

  4. 按一下檔案,然後按一下 [開啟] 。Click the file and then click Open.

    陳述式隨即會加入查詢視窗。The statement is added to the query window.

  5. 按一下 [執行]Click Execute.