Hello,
I am trying to upgrade TFS 2010 SP1 to TFS 2013. I have 5 collections and 4 of them upgraded successfully except the 5<sup>th</sup> one which fails with an error message "Possible Schema Corruption".
I run dbcc checkdb on the problematic collection database and see the following error messages:
Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. Msg 0, Level 20, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded.
The error reported in SQL Logs are:
Error: 211, Severity: 23, State: 113.
Possible schema corruption. Run DBCC CHECKCATALOG. When I run "DBCC CHECKCATALOG" it shows the results "DBCC execution completed. If DBCC printed error messages, contact your system administrator."
I further investigated the problematic collection database and found that the problem is only with the stored procedures. I cannot see the list of stored procedures for the problematic collection database. All other collection databases are fine and I can see the list of their SPs without any issue.
1. There are 729 stored procedures in each and every collection databases and all the stored procedures are encrypted.
2. I can select all the stored procedures from all 4 out of 5 collections database with the help of below query. But when I run this query on the problematic collection database it returns 301 stored procedures and then give the error "Possible Schema corruption error". This query should return 729 rows.
select * from information_schema.routines where routine_type = 'Procedure'
Please note that the below query return 729 for all the 5 collection databases including the problematic collection database.
select count(*) from information_schema.routines where routine_type = 'Procedure'
3. Is there any way to rebuild the schema of this particular collection database?
4. All the stored procedure are locked (Encrypted) and there is lock sign with all the SPs and I cannot get the definition of these stored procedures.
Important is:
- I can take the backup of the problematic collection database and restore it without any problem.
- Team members are using the projects inside the problematic collection databases without any issues.
Below is the detailed error message when I click on the Stored Procedures node in the Management studio.
Possible schema corruption. Run DBCC CHECKCATALOG.A severe error occurred on the current command. The results, if any, should be discarded. (.Net SqlClient Data Provider)------------------------------For help, click: "http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=211&LinkId=20476"------------------------------Server Name: (local)Error Number: 211Severity: 23 State: 113Line Number: 9------------------------------Program Location: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.HasMoreRows() at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) at System.Data.SqlClient.SqlDataReader.Read() at Microsoft.SqlServer.Management.Smo.DataProvider.ReadInternal() at Microsoft.SqlServer.Management.Smo.DataProvider.Read() at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.NavigableItemBuilderDataReader.Read(Object[]& values) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NonContextFilterNavigableItemBuilder.Build(IList`1 targetList, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)
Regards
Waseem