State Service 应用程序没有定义数据库 (SharePoint Server 2010)

 

适用于: SharePoint Foundation 2010, SharePoint Server 2010

上一次修改主题: 2010-06-23

**规则名称:**State Service 应用程序没有定义数据库

**摘要:**State Service 服务应用程序没有定义 State Service 数据库。这可能会导致在使用某些 SharePoint 组件(例如,InfoPath Web 浏览器表单和 Microsoft SharePoint Server 图表 Web 部件)时出现错误。

**原因:**可能有下列一种或多种原因:

  • 服务器场管理员已删除与 State Service 服务应用程序关联的所有数据库。

  • 服务器场管理员从不创建数据库或将数据库与 State Service 服务应用程序关联。

解决方案:使用 Windows PowerShell 为 State Service 服务应用程序创建新的数据库或使用现有数据库

  1. 确认您满足以下最低要求:请参阅 Add-SPShellAdmin

  2. 在“开始”菜单上,单击“所有程序”。

  3. 单击“Microsoft SharePoint 2010 产品”。

  4. 单击“SharePoint 2010 Management Shell”。

  5. 如果没有可供您使用的数据库,请在 Windows PowerShell 命令提示符处,键入以下命令:

    New-SPStateServiceDatabase -Name <DatabaseName> -DatabaseServer <ServerName> [-DatabaseCredentials <Credential>] [-ServiceApplication <ID>]
    

    其中:

    • <DatabaseName> 是字符串形式的数据库名称。

    • <ServerName> 是数据库服务器的名称。

    • <Credential> 是数据库的 SQL Server 身份验证凭据。如果未使用此参数,则将使用 Windows 身份验证。

    • <ID> 是 State Service 服务应用程序的标识符(以字符串或 GUID 表示)。如果只有一个 State Service 服务应用程序,则您无需指定此参数。

  6. 在某些环境中,您必须连接到现有的空 SQL 数据库。在此示例中,您在 Windows PowerShell 命令提示符处,键入以下命令:

    Mount-SPStateServiceDatabase -Name <DatabaseName> -DatabaseServer <ServerName> [-DatabaseCredentials <Credential>] [-ServiceApplication <ID>]
    

    其中:

    • <DatabaseName> 是字符串形式的数据库名称。

    • <ServerName> 是数据库服务器的名称。

    • <Credential> 是数据库的 SQL Server 身份验证凭据。如果未使用此参数,则将使用 Windows 身份验证。

    • <ID> 是 State Service 服务应用程序的标识符(以字符串或 GUID 表示)。如果只有一个 State Service 服务应用程序,则您无需指定此参数。

有关详细信息,请参阅 Mount-SPStateServiceDatabaseNew-SPStateServiceDatabase