禁用或暂停报表和订阅处理Disable or Pause Report and Subscription Processing

可采用多种方法禁用或暂停 Reporting ServicesReporting Services 报表和订阅处理。There are several approaches you can use to disable or pause Reporting ServicesReporting Services report and subscription processing. 本主题中的方法从禁用订阅到中断数据源连接,无所不包。The approaches in this article range from disabling a subscription to interrupting the data source connection. 并非所有方法都支持这两种 Reporting ServicesReporting Services 服务器模式。Not all approaches are possible with both Reporting ServicesReporting Services server modes. 下表总结了方法以及支持的 Reporting ServicesReporting Services 服务器模式:The following table summarizes the methods and supported Reporting ServicesReporting Services server modes:

本文内容In this article

方法Approach 支持的服务器模式Supported server mode
启用和禁用订阅Enable and disable subscriptions 本机模式Native mode
暂停共享计划Pause a shared schedule 本机模式和 SharePoint 模式Native and SharePoint mode
禁用共享数据源Disable a shared data source 本机模式和 SharePoint 模式Native and SharePoint mode
通过修改角色分配来阻止访问报表(本机模式)Modify role assignments to prevent access to a report (Native mode) 本机模式Native mode
从角色中删除管理订阅权限(本机模式)Remove manage subscription permissions from role (Native mode) 本机模式Native mode
禁用传递扩展插件Disable delivery extensions 本机模式和 SharePoint 模式Native and SharePoint mode

启用和禁用订阅Enable and disable subscriptions

提示

SQL 2016 Reporting Services 中的新增功能,启用和禁用订阅 。New in SQL 2016 Reporting Services, enable and disable subscriptions. 使用新用户界面选项,可以快速启用和禁用订阅。New user interface options allow you to quickly enable and disable subscriptions. 已禁用的订阅可以维护自身的其他配置属性(如计划),并能轻松地重新启用。The disabled subscriptions maintain their other configuration properties such as schedule and can be easily re-enabled. 也可以编程方式启用和禁用订阅,或审核哪些订阅已遭禁用。You can also programmatically enable and disable subscriptions, or audit which subscriptions are disabled.

“订阅”页的“启用”和“禁用”按钮The Enable and Disable buttons of the Subscriptions page

在 Web 门户中,从“我的订阅” 页或单个订阅的“订阅” 页浏览到订阅。In the web portal, browse to the subscription from either the My Subscriptions page or the Subscriptions page of an individual subscription. 选择一个或多个订阅,再单击功能区中的禁用按钮或启用按钮(见上图)。Select one or more subscriptions and then click either the disable button or enable button on the ribbon (see above image). “状态”列将分别更改为“禁用”或“启用”。The status column will change to either "Disabled" or "Enabled" respectively.

启用或禁用订阅时,Reporting ServicesReporting Services 会在 Reporting ServicesReporting Services 日志中写入一行。Reporting ServicesReporting Services writes a row in the Reporting ServicesReporting Services log when a subscription is either enabled or disabled. 例如,在报表服务器日志文件中:For example, in report server log file:

C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\LogFiles\RSPortal_2019_06_20_00_49_22.log

你将看到如下行:you see rows similar to the following:

RSPortal!subscription!RSPortal.exe!93!06/20/2019-01:16:47:: i INFO: Subscription 2b409d66-d4ea-408a-918c-0f9e41ce49ca disabled at 06/20/2019 01:16:47

RSPortal!subscription!RSPortal.exe!93!06/20/2019-01:16:51:: i INFO: Subscription 2b409d66-d4ea-408a-918c-0f9e41ce49ca enabled at 06/20/2019 01:16:51

PowerShell 相关内容使用 Windows PowerShell 禁用单个订阅: 使用以下 PowerShell 脚本禁用特定订阅。PowerShell related content: Use Windows PowerShell to disable a single subscription: Use the following PowerShell script to disable a specific subscription. 更新脚本中的服务器名称和订阅 ID。Update the server name and subscription ID in the script.

#disable specific subscription  
$rs2010 = New-WebServiceProxy -Uri "https://SERVERNAME/ReportServer/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential;  
$subscriptionID = "subscription guid";  
$rs2010.DisableSubscription($subscriptionID);  
  

可以使用以下脚本列出所有订阅及其 ID。You can use the following script to list all subscriptions with their IDs. 更新服务器名称。Update the server name.

#list all subscriptions  
$rs2010 = New-WebServiceProxy -Uri "https://SERVERNAME /ReportServer/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential;  
$subscriptions = $rs2010.ListSubscriptions("/");  
$subscriptions | select subscriptionid, report, status, path  
  

PowerShell 相关内容使用 Windows PowerShell 列出所有禁用的订阅: 使用以下 PowerShell 脚本列出当前本机模式报表服务器上所有已禁用的订阅。PowerShell related content Use Windows PowerShell to list all disabled subscriptions: Use the following PowerShell script to list all of the disabled subscriptions on the current Native mode report server. 更新服务器名称。Update the server name.

#list all disabled subscriptions  
$rs2010 = New-WebServiceProxy -Uri "https://uetestb03/ReportServer/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential;  
$subscriptions = $rs2010.ListSubscriptions("/");  
Write-Host "--- Disabled Subscriptions ---";  
Write-Host "----------------------------------- ";  
$subscriptions | Where-Object {$_.Active.DisabledByUserSpecified -and $_.Active.DisabledByUser } | select subscriptionid, report, status, lastexecuted,path | format-table -auto  

PowerShell 相关内容使用 Windows PowerShell 启用所有禁用的订阅: 使用以下 PowerShell 脚本启用当前已禁用的所有订阅。PowerShell related content Use Windows PowerShell to enable all disabled subscriptions: Use the following PowerShell script to enable all subscriptions that are currently disabled. 更新服务器名称。Update the server name.

#enable all subscriptions  
$rs2010 = New-WebServiceProxy -Uri "https://SERVERNAME/ReportServer/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential;  
$subscriptions = $rs2010.ListSubscriptions("/") | Where-Object {$_.status -eq "disabled" } ;  
ForEach ($subscription in $subscriptions)  
{  
    $rs2010.EnableSubscription($subscription.SubscriptionID);  
    $subscription | select subscriptionid, report, path  
}  
  

PowerShell 相关内容使用 Windows PowerShell 禁用所有订阅: 使用以下 PowerShell 脚本列出禁用的所有 订阅。PowerShell related content Use Windows PowerShell to DISABLE all subscriptions: Use the following PowerShell script to list disable ALL subscriptions.

#DISABLE all subscriptions  
$rs2010 = New-WebServiceProxy -Uri "https://SERVERNAME/ReportServer/ReportService2010.asmx" -Namespace SSRS.ReportingService2010 -UseDefaultCredential;  
$subscriptions = $rs2010.ListSubscriptions("/") ;  
ForEach ($subscription in $subscriptions)  
{  
    $rs2010.DisableSubscription($subscription.SubscriptionID);  
    $subscription | select subscriptionid, report, path  
}  

暂停共享计划Pause a shared schedule

如果报表或订阅按照某个共享计划运行,您可以通过暂停该计划来阻止这些报表或订阅的处理。If a report or subscription runs from a shared schedule, you can pause the schedule to prevent processing. 在恢复计划之前,会延迟由该计划驱动的所有报表和订阅处理。All report and subscription processing driven by the schedule is deferred until the schedule is resumed.

  • SharePoint 模式: 在“站点设置” 的 SharePoint 设置中,选择“管理共享计划” 。SharePoint mode: SharePoint Settings In Site settings, select Manage shared schedules. 选择计划,并单击“暂停所选计划” 。Select the schedule and click Pause selected schedules.

  • 本机模式: 在 Web 门户中,从 Web 门户屏幕顶部的菜单栏中选择“设置” 按钮设置按钮,并从下拉菜单中选择“站点设置” 。Native mode: In the web portal, select the Settings button Settings button from the menu bar at the top of the web portal screen, and select Site Settings from the drop-down menu. 选择“计划” 选项卡以显示计划页。Select the Schedules tab to display the schedules page. 选中要启用或禁用的计划旁边的复选框,然后分别选择“启用” 或“禁用” 按钮,以执行所需的操作。Select the checkbox(es) next to the schedule(s) you want to enable or disable, and then select the Enable or Disable button respectively to perform the desired action. “状态”列将相应地更新为“禁用”或“启用”。The status column will update to "Disabled" or "Enabled" accordingly.

禁用共享数据源Disable a shared data source

使用共享数据源的一个优点是您可以通过禁用它来阻止报表或数据驱动订阅运行。One advantage to using shared data sources is that you can disable it to prevent a report or data-driven subscription from running. 禁用共享数据源会断开报表与其外部源的连接。Disabling a shared data source disconnects the report from its external source. 禁用共享数据源后,所有原来使用该数据源的报表和订阅将无法再继续访问该数据源。While it is disabled, the data source is unavailable to all reports and subscriptions that use it.

请注意,即使数据源不可用,你也仍可加载相应的报表。Note the report still loads even if the data source is unavailable. 该报表不包含任何数据,但具有适当权限的用户可以访问与该报表关联的属性页、安全设置、报表历史记录和订阅信息。The report does not contain data, but users with appropriate permissions can access the property pages, security settings, report history, and subscription information associated with the report.

  • SharePoint 模式: 若要在 SharePoint 模式报表服务器中禁用共享数据源,请浏览到包含该数据源的文档库。SharePoint mode: To disable a shared data source in a SharePoint mode report server, browse to the document library that contains the data source. 共享数据源图标单击数据源,然后清除“启用此数据源” 复选框。Shared data source icon Click the data source and then clear the Enable this data source check box.

  • 本机模式: 若要在本机模式报表服务器中禁用共享数据源,请在 Web 门户中打开相应数据源,再清除“启用此数据源” 复选框。Native mode: To disable a shared data source on a native mode report server, open the data source in the web portal, and clear the Enable this data source check box.

通过修改角色分配来阻止访问报表(本机模式)Modify role assignments to prevent access to a report (native mode)

使报表不可用的方法之一是,暂时删除提供报表访问权限的角色分配。One way to make a report unavailable is to temporarily remove the role assignment that provides access to the report. 无论采用哪种数据源连接,对所有报表都可以使用这种方法。This approach can be used on all reports regardless of how the data source connection is made. 这种方法只针对目标报表,不会影响其他报表或项的操作。This approach targets only the report, without affecting the operation of other reports or items.

若要删除角色分配,请在 Web 门户中打开报表的“安全” 页。To remove the role assignment, open the Security page of the report in the web portal. 如果报表的安全设置是从父报表继承而来,你可以依次选择“自定义安全设置” 和“项安全性” 对话框中的“确认” ,以创建忽略提供广泛访问权限的角色分配的限制性安全策略(例如,可以删除为每个人提供访问权限的角色分配,而保留为一小部分用户(如管理员)提供访问权限的角色分配)。If the report inherits security from a parent, you can select Customize security and then select Confirm in the Item security dialog box to create a restrictive security policy that omits role assignments that provide widespread access (for example, you can remove a role assignment that provides access to Everyone, and keep the role assignment that provides access to a small group of users, such as Administrators).

从角色中删除管理订阅权限(本机模式)Remove manage subscription permissions from role (native mode)

若要阻止用户创建订阅,请从角色中清除“管理单独的订阅” 任务。To prevent users from creating subscriptions, clear the Manage individual subscriptions task from the role. 删除此任务后,“订阅”页将不可用。When you remove this task, the Subscription pages are not available. 在 Web 门户中,“我的订阅”页显示为空(无法删除它),即使它以前包含订阅,也不例外。In the web portal, the My Subscriptions page appears to be empty (it cannot be deleted), even if it previously contained subscriptions. 删除与订阅相关的任务会使用户无法创建和修改订阅,但这不会删除现有的订阅。Removing subscription-related tasks prevents users from creating and modifying subscriptions, but does not delete existing subscriptions. 现有订阅将继续执行,直到你删除它们。Existing subscriptions continue to execute until you delete them. 若要删除权限,请执行以下操作:To remove the permission:

  1. 打开 SQL Server Management StudioSQL Server Management StudioOpen SQL Server Management StudioSQL Server Management Studio.

  2. 连接到 Reporting ServicesReporting Services 报表服务器。Connect to the Reporting ServicesReporting Services report server.

  3. 展开“安全性” 节点。Expand the Security node.

  4. 展开“角色” 节点,然后选择所需的角色。Expand the Roles node and select the desired role.

  5. 右键单击相应角色,并选择“属性” 。Right-click the role and select Properties.

  6. 清除“管理单独的订阅” 和“管理所有订阅” 任务。Clear the Manage individual subscriptions and the Manage all subscriptions tasks.

  7. 单击“确定” ,以应用更改。Select OK to apply the changes.

禁用传递扩展插件Disable delivery extensions

对于有权创建对某个给定报表的订阅的任何用户,可以使用报表服务器上安装的所有传递扩展插件。All delivery extensions installed on a report server are available to any user who has permission to create a subscription to a given report. 可以自动使用并配置下列传递扩展插件:The following delivery extensions are available and configured automatically:

  • Windows 文件共享Windows File Share

  • SharePoint 库(只能从 SharePoint 站点使用,该站点与 SharePoint 集成模式报表服务器集成在一起)SharePoint Library (available only from a SharePoint site that is integrated with a SharePoint integrated mode report server)

电子邮件传递必须进行配置才能使用。E-mail delivery must be configured before it can be used. 如果未对它进行配置,它将不可用。If you do not configure it, it is not available. 有关详细信息,请参阅电子邮件设置 - Reporting Services 本机模式(配置管理器)For more information, see E-Mail Settings - Reporting Services Native mode (Configuration Manager).

如果要关闭特定的扩展插件,可以在 RSReportServer.config 文件中删除与该扩展插件相对应的条目。If you want to turn off specific extensions, you can remove extension entries in the RSReportServer.config file. 有关详细信息,请参阅 Reporting Services 配置文件电子邮件设置 - Reporting Services 本机模式(配置管理器)For more information, see Reporting Services Configuration Files and E-Mail Settings - Reporting Services Native mode (Configuration Manager).

删除的传递扩展插件在 Web 门户或 SharePoint 站点中不再可用。After you remove a delivery extension, it is no longer available in the web portal or a SharePoint site. 删除传递扩展插件可能会使订阅变为非活动状态。Removing a delivery extension can result in inactive subscriptions. 在删除扩展插件之前,请确保删除这些订阅或者将它们配置为使用其他传递扩展插件。Be sure to delete the subscriptions or configure them to use a different delivery extension before removing an extension.

另请参阅See also

订阅和传递 (Reporting Services) Subscriptions and Delivery (Reporting Services)
Reporting Services 配置文件 Reporting Services Configuration Files
配置 Web 门户 Configure the web portal
Reporting Services 报表服务器(本机模式) Reporting Services Report Server (Native Mode)
报表服务器的 Web 门户(SSRS 本机模式) The web portal of a report server (SSRS Native Mode)
安全对象Securable Items