SPContentDatabase.Repair 方法

修复内容数据库。

命名空间:  Microsoft.SharePoint.Administration
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Function Repair ( _
    DeleteCorruption As Boolean _
) As String
用法
Dim instance As SPContentDatabase
Dim DeleteCorruption As Boolean
Dim returnValue As String

returnValue = instance.Repair(DeleteCorruption)
public string Repair(
    bool DeleteCorruption
)

参数

  • DeleteCorruption
    类型:System.Boolean

    true删除已损坏的网站集、 网站、 列表和文档 ;否则为false。

返回值

类型:System.String
一个 XML 字符串指定的类型、 名称和 ID 的网站集,Web 站点和列表将被孤立或缺少所需的子对象。下面的示例阐释了字符串的元素:

<OrphanedObjects Count="4" >
  <Orphan Type="SPSite" 
          Id="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          Deleted="No" />
  <Orphan Type="SPWeb" 
          Name="name" 
          Id="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          Deleted="No" />
  <Orphan Type="SPWeb" 
          Name="name" 
          Id="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          SiteId="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          Deleted="No" />
  <Orphan Type="SPList" 
          Name="name" 
          Id="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          SiteId="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          WebId="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" 
          Deleted="No" />
</OrphanedObjects>

备注

随着时间的推移内容数据库可能积累被损坏的对象。应该有一个父对象的对象可能会被孤立 ;应该有一个子对象的对象可能没有一个。这些事情可以发生这种情况由于各种 misfortunes: 电源故障、 丢失的连接、 应用程序超时、 软件故障或只是普通的坏运气。

要找出是否数据库包含此类损坏,调用Repair方法,然后检查该方法返回的字符串。若要从数据库中删除已损坏的对象,请作为参数调用true的Repair方法。

另请参阅

引用

SPContentDatabase 类

SPContentDatabase 成员

Microsoft.SharePoint.Administration 命名空间