SharePoint Log - [MissingFeature] Database [SharePoint_Content] has reference(s) to a missing
来源:互联网 发布:java虚拟机用什么写的 编辑:程序博客网 时间:2024/06/15 08:37
原文参见:http://get-spscripts.com/2011/06/removing-features-from-content-database.html
Error Message:
[MissingFeature] Database [SharePoint_Content_Portal] has reference(s) to a missing feature: Id = [8096285f-1463-42c7-82b7-f745e5bacf29], Name = [My Feature], Description = [], Install Location = [Test-MyFeature]. The feature with Id 8096285f-1463-42c7-82b7-f745e5bacf29 is referenced in the database [SharePoint_Content_Portal], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary.从错误信息中可以看出,名为“SharePoint_Content_Portal”的数据库中的一个feature,并没有安装在SharePoint farm中或者曾经安装过,但是已经被移除了。通常情况下,在移除solution的时候,会自动禁用feature,然后再移除solution,但是有些情况下,移除得并不干净,例如web application 级别的feature,或者没有移除自定义的event receiver或者webpart等等。
下面的powershell可以解决这个问题。
function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly){ $db = Get-SPDatabase | where { $_.Name -eq $ContentDb } [bool]$report = $false if ($ReportOnly) { $report = $true } $db.Sites | ForEach-Object { Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report $_ | Get-SPWeb -Limit all | ForEach-Object { Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report } }}function Remove-SPFeature($obj, $objName, $featId, [bool]$report){ $feature = $obj.Features[$featId] if ($feature -ne $null) { if ($report) { write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red } else { try { $obj.Features.Remove($feature.DefinitionId, $true) write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Red } catch { write-host "There has been an error trying to remove the feature:" $_ } } } else { #write-host "Feature ID specified does not exist in" $objName ":" $obj.Url }}
有两种方法使用以上代码,
1. 如果你只是想查找哪些站点或者站点集中包含缺失的feature,使用如下方法:
Remove-SPFeatureFromContentDB -ContentDB "SharePoint_Content_Portal" -FeatureId "8096285f-1463-42c7-82b7-f745e5bacf29" –ReportOnly这个方法会遍历所有的站点,列出类似以下的内容:
Feature found in site : http://portal/site
2. 如果你想从数据库中移除缺失的feature,可以使用下面的方法:
Remove-SPFeatureFromContentDB -ContentDB "SharePoint_Content_Portal" -FeatureId "8096285f-1463-42c7-82b7-f745e5bacf29"这个方法会输出类似如下的信息:
Feature successfully removed from site : http://portal/site
0 0
- SharePoint Log - [MissingFeature] Database [SharePoint_Content] has reference(s) to a missing
- How to Shrink SharePoint Content Database Log File?
- java.sql.SQLException: Your password has expired. To log in you must change it using a client that s
- QUESTION 169 A database has three online redo log groups with one member each. A redo log member wit
- SQL to clear database log
- has leaked IntentReceiver ...that was originally registerd here.Are you missing a call to unregister
- Activity has leaked IntentReceiver that was originally registered here. Are you missing a call to un
- Activity has leaked IntentReceiver that was originally registered here. Are you missing a call to u
- Physical Database Design: the database professional's guide to exploiting indexes, views, storage, a
- android.database.StaleDataException: Attempted to access a cursor after it has b
- android.database.StaleDataException: Attempted to access a cursor after it has been closed
- android.database.StaleDataException: Attempted to access a cursor after it has been clos
- android.database.StaleDataException: Attempted to access a cursor after it has been closed
- 异常:android.database.StaleDataException: Attempted to access a cursor after it has been closed
- android.database.StaleDataException: Attempted to access a cursor after it has been closed.
- Caused by: android.database.StaleDataException: Attempted to access a cursor after it has been close
- ERROR in Error encountered resolving symbol values statically. Reference to a non-exported class Log
- Your password has expired. To log in you must change it using a cl...
- long long 类型的网络字节顺序转换
- 【笔记】JS毫秒时间轻松换算
- svn A conflict in the working copy obstructs the current operation
- unity关于StartCoroutine的简单线程使用
- Listview的重要属性
- SharePoint Log - [MissingFeature] Database [SharePoint_Content] has reference(s) to a missing
- web.xml 中的listener、 filter、servlet 加载顺序及其详解
- ASP.NET出现[No relevant source lines]问题
- SpringMVC之配置用于@ResponseBody的HttpMessageConverter转换器
- jconsole监控远程linux下tomcat运行情况的配置
- 使用java6开发WebService服务端和客户端
- Source Insight 添加新类型文件
- destoon分类树状列表
- OJ刷题之找出N之内的所有完数