This post has been republished via RSS; it originally appeared at: SharePoint Support Blog articles.
Summary
Have you experienced an issue where "Crawl History" is inaccessible in your Farm and throwing error, "Could not find stored procedure 'Search_GetRepositoryTimePerCrawl'"?
If so, you may have some across this blog https://blogs.msdn.microsoft.com/sambetts/2014/12/10/sharepoint-2013-crawl-history-error/ which details how the store procedure is created and the issue could be that the timer job to complete the provisioning is disabled. In these cases, just enabling and stating the "Search Health Monitoring - Trace Events" timer job does the trick.
However, if this didn't work in your case, please keep reading for possible workaround...
Problem Description
Unable to access "Crawl History" with error, "Could not find stored procedure 'Search_GetRepositoryTimePerCrawl'"
and the "Search Health Monitoring - Trace Events" timer job is enabled.
Example:
Result:
Sorry, something went wrong
Could not find stored procedure 'Search_GetRepositoryTimePerCrawl'.
Technical Details
Correlation ID: 9f8f759e-2620-a083-a46d-e8b0cda512ca
Date and Time: 6/28/2018 10:30:04 AM
Cause
The "Search Health Monitoring - Trace Events" timer job unexpectedly fails to execute the provisioning process and the SQL changes are rolled back.
Resolution
To resolve this, force the provisioning process associated with the "Search Health Monitoring - Trace Events" Timer Job, by executring the following PowerShell commands.
Add-PSSnapin microsoft.sharepoint.powershell -EA 0 $diag = Get-SPDiagnosticsProvider -identity "Search Health Monitoring - Trace Events" $diag.OnProvisioning()
This process should force the initialization of the missing tables and stored procedures within the Search DB according to the definition of "Search Health Monitoring - Trace Events" diagnostic provider.
More Information
Get-SPDiagnosticsProvider
https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/get-spdiagnosticsprovider?view=sharepoint-ps
SPDiagnosticsProvider.OnProvisioning method
https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.diagnostics.spdiagnosticsprovider.onprovisioning.aspx