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…
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.
Sorry, something went wrong
Could not find stored procedure ‘Search_GetRepositoryTimePerCrawl’.
Correlation ID: 9f8f759e-2620-a083-a46d-e8b0cda512ca
Date and Time: 6/28/2018 10:30:04 AM
The “Search Health Monitoring – Trace Events” timer job unexpectedly fails to execute the provisioning process and the SQL changes are rolled back.
Help it along you can 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"
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.