TFS 2012 - TF400013:发生意外的数据库错误 [英] TFS 2012 - TF400013: An unexpected database error occurred

查看:30
本文介绍了TFS 2012 - TF400013:发生意外的数据库错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个严重的问题:我有一个 TeamProjectCollection.在这个集合中,我有一个项目.我需要重新创建相同的项目.我删除这个项目并再次创建项目.在此之后,我在 TFS 上遇到下一个错误:

当我尝试打开此集合中的任何项目时出现此错误.我该如何解决这个问题?

解决方案

可能为时已晚,无法帮助 OP,...但是对于遇到此TF400013:发生意外的数据库错误"的任何其他人,我是如何解决此问题的我的 TFS2013 系统.

  1. 使用管理员帐户在 TFS 服务器上启动 Microsoft SQL Server Management Studio (SMS).
  2. 从 SMS 的顶级菜单启动 [工具|SQL Server Profiler]
  3. 当提示输入 [Trace Properties] 时,为 [Use the template:] 组合框选择 TSQL;因为默认值通常只会在 [TextData] 列中显示加密文本".
  4. 执行违规操作.就我而言,我列出了来自 TFS Web 应用程序的项目的高级 [TEST] 页面.
  5. 在 SQL Profiler 中停止跟踪并筛选相关的 [TextData] 列,以查找产生意外数据库错误"的违规 SQL.
  6. 这可以通过将 [TextData] SQL 从 SQL Profiler 复制到 SMS 中的查询窗口来实现.您可能需要添加 USE Tfs_xxx,其中 xxx 替换为您的 [Team Project Collection] 名称.请注意,某些查询旨在与 USE Tfs_TFSConfiguration 的上述 SQL 一起运行,标识 TFSConfiguration 数据库而不是项目集合数据库.
  7. 您可以使用 SMS 中的违规 SQL 来修复意外数据库错误",获得更好的诊断错误消息,并获得对您的 TFS 系统进行 UI 或数据库更正所需的可能洞察力.

<块引用>

!!!请注意,您从 SMS 对 TFS 数据库所做的任何更改都将使您的 Microsoft TFS 支持协议无效.!!!

在我的系统上,TFS [TEST] Web 应用程序损坏,因为有人(我)向对话框中列出的页面查询添加了 [列选项](来自页面的 UI),但显然不受支持.页面的数据表查询因无效列名"的内部数据库错误而失败.在 SQL Profiler 中,在数据表填充 SQL 之前,有一个要显示的列的查询,其中在 SQL 结果中包含有问题的未知列名":

exec prc_QueryRegistry@partitionId=1,@registryPath=N'#\Users\f64...91f\WebAccessTestManagement\b81...cb7\TestHub\ColumnSettings\'

对我来说,最快的解决方法是取消我不存在的 Microsoft TFS 支持协议,是通过在 SMS 中执行以下 SQL 来清除此列设置

exec prc_SetRegistryValue @partitionId=1,@key=N'#\Users\f64...91f\WebAccessTestManagement\b81...cb7\TestHub\ColumnSettings\',@值='',@identityName='你的名字在这里'

I have critical problem: I have a TeamProjectCollection. In this collection i had a project. And i need re-create project with same same. I delete this project and create project again. After this i get next error on TFS:

This error apear whe i try to open any project from this collection. How can i fix this?

解决方案

Probably too late to help OP, ... But for any others running into this 'TF400013: An unexpected database error occured' here is how I resolved it on my TFS2013 system.

  1. Launch the Microsoft SQL Server Management Studio (SMS) on the TFS server from an Administrator's account.
  2. From SMS's top level menu Launch the [Tools|SQL Server Profiler]
  3. When prompted for the [Trace Properties] select TSQL for the [Use the template:] combo box; as the default will generally only show you 'encrypted text' in the [TextData] column.
  4. Perform the offending action. In my case I was listing the high-level [TEST] page for a project from the TFS Web Application.
  5. Stop the trace in the SQL Profiler and sift through the related [TextData] column to find the offending SQL that is generating the 'unexpected database error'.
  6. This can be accomplished by copying the [TextData] SQL from the SQL Profiler to a Query window in SMS. You might have to add a USE Tfs_xxx, where xxx is replaced by your [Team Project Collection] name. Note that some queries are intended to be run with the preceding SQL of USE Tfs_TFSConfiguration, identifying the TFSConfiguration database instead of the project collection database.
  7. You can play with the offending SQL in SMS to remedy for the 'unexpected database error', get better diagnostic error messages, and gain the possible insight needed to make the UI or database correction to your TFS system.

!!! BEWARE that any changes by you to the TFS database from SMS will void your Microsoft TFS Support Agreement. !!!

On my system the TFS [TEST] Web application broke because someone (me) added a [Column option] (from the page's UI) to the page's query that was listed in the dialog, but obviously not supported. The datatable query for the page failed from an internal database error for an 'Invalid column name'. In the SQL Profiler, ahead of the datatable fill SQL, there was a query for the columns to display which included the offending 'unknown column name' in the SQL result:

exec prc_QueryRegistry
 @partitionId=1
,@registryPath=N'#\Users\f64...91f\WebAccessTestManagement\b81...cb7\TestHub\ColumnSettings\'

The quickest fix for me, voiding my non-existant Microsoft TFS support agreement, was to clear this column setting by executing the following SQL in SMS

exec prc_SetRegistryValue @partitionId=1
,@key=N'#\Users\f64...91f\WebAccessTestManagement\b81...cb7\TestHub\ColumnSettings\'
,@value=''
,@identityName='your name here'

这篇关于TFS 2012 - TF400013:发生意外的数据库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆