In this post I will show you how to fix the “Could not find Stored Procedure ‘Search_GetRepositoryTimePerCrawl’” exception in SharePoint 2013. This is an exception that you can get when looking at crawl log details for a Search Service Application. The error might go unnoticed since it will not affect indexing or querying.
In SharePoint 2013 when you are trying to inspect crawl logs and statistics for indexing and querying you might see exceptions that say “Could not find stored procedure ‘Search_????’”. You will also see critical errors in the ULS Trace Logs like this:
SharePoint Foundation Database 880i High System.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'Search_GetRepositoryTimePerCrawl'. SharePoint Foundation Database 5586 Critical Unknown SQL Exception 2812 occurred. Additional error information from SQL Server is included below. Could not find stored procedure 'Search_GetRepositoryTimePerCrawl'.
Note that the name of the Stored Procedure may vary.
The Trace Logs reveals that there are missing stored procedures in the Usage Database and by cranking up SQL Server Management Studio it clearly shows that there are no stored procedures with those names. You will only see one stored procedure (or sometimes none) with the Search_ prefix.
Even though these Stored Procedures are missing the Search Service Application continues to crawl and index and querying works as normal.
Cause and Resolution
There might be several causes for this error. One reason could be that the Usage Database has been recreated (for instance to increase the max total bytes in the partitions). When the Usage Database is created it will only contain the default set of stored procedures, it is not aware of any Service Application or custom Usage Providers.
In this case the Search Service Application Usage Provider has not created the necessary Stored Procedures in the database. This is done by a timer job called “Search Health Monitoring – Trace Events”. Once this timer job has executed successfully the required stored procedures should be created. Normally this timer job is executed every minute, so seeing this error should be very infrequent. But just as any timer job an admin can change the schedule or even disable it – and then when the Usage Database is re-created this error will occur.
You’ve just seen the cause and fix for the missing stored procedures when looking at crawl and query logs and statistics in SharePoint 2013. The error messages might be frightening but the fix is quick and easy. Just as anything in SharePoint once you understand the moving bits and pieces.
Finally we’re getting SharePoint Saturday to Stockholm! Next year in January, or to be more precise the 25th of January 2014, the global SharePoint Saturday event will come to central Stockholm and World Trade Center.
What is a SharePoint Saturday?
SharePoint Saturdays are a free events that happens in cities around the world, unfortunately most of them are on the other side of the pond. But once in a while we see these great events pop up in Europe. It’s free in that meaning that it is organized by volunteers, the speakers do it because they have nothing better to do on Saturdays and there is no entrance fee and if you’re lucky you can get some swag as well! But, the events are sponsored, but just to get a good venue and of course the accompanying SharePint after a full day of sessions.
SharePoint Saturday Stockholm
As I said, now for the first time we will have our first SharePoint Saturday here in Stockholm. The event is organized by my colleague Hannah Swain, Mattias Einig and fellow MCM Erwin van Hunen – a great bunch of committed people They are currently setting up the speakers, agenda, venue and all of gazillion things that needs to be done. The event will be held at World Trade Center, which is right in the middle of Stockholm and as close as you can get to all the communications.
You can be a speaker!
One of the key things, and what I really like with these events, is that everyone can and should apply for a speaker slot. It’s a great opportunity to practice your speaking skills, learn more about how it is to contribute to the community, get your name out there and perhaps boost your ego a bit. I know that there are lots of people, including shy Swedes, that can, will and should be on our very first SharePoint Saturday as a speaker. Don’t just sit there – go and submit your sessions proposals right away!
I’m really looking forward to meet all of you there!