Some SharePoint critical errors thrown frequently and repeatedly might end up in an unexpected titanic growth of the SharePoint_Config transactional log. It can get seriously big, believe me... and the worst of all, it keeps growing and growing *fast*!
This will lead us to an unstable working environment where nothing actually works as it should, slow, unresponsive and likely to be hit by collateral damage (i.e. Out of disk space just to name one). Well, my client fully suffer it the other day, the actual log hit the 1 TB mark! Woohoo!
So, no panic, before we get to diagnose and fix the cause of issue, let's quickly shrink the transactional log so we can get back to 'healthier' and quicker environment.
Executing the following SQL script against the SharePoint_Config database will compress the size of SharePoint_Config_log regardless of its size.
USE SharePoint_Config
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE SharePoint_Config
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (SharePoint_Config_log, 1); -- here 2 is the file ID for trasaction log file,you can also mention the log file name (dbname_log)
GO
-- Reset the database recovery model.
ALTER DATABASE SharePoint_Config
SET RECOVERY FULL;
GO
From this point, the size of the log should be significally smaller. Hope you can can solve the issue/s now. Good luck!
Thursday, October 06, 2011
Wednesday, October 05, 2011
Return only documents in search results
A few days ago my client came up with this new requirement where the SharePoint search should only display nothing but documents. Everything else will go ignored.
To achieve that I would recommend to create a Search Scope and then apply a set of rules that will basically prevent the unwanted items to show up.
The rules are:
*://*allitems.aspx* Exclude
*://*webfldr.aspx* Exclude
*://*mod-view.aspx* Exclude
*://*my-sub.aspx* Exclude
*://*/lists/* Exclude
*://*lists* Exclude
And here is how it should look once you entered them
For us, PowerShell entusiasts, here's how it looks :)
write-host "Enter the Search Service Application Url where you need to apply the crawling rules:"
[string]$SearchServicerUrl = Read-Host #i.e. Enterprise Search Service Application
New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServicerUrl -Path "*://*webfldr.aspx*" -CrawlAsHttp 1 -Type ExclusionRule
New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServicerUrl -Path "*://*mod-view.aspx* " -CrawlAsHttp 1 -Type ExclusionRule
New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServicerUrl -Path "*://*my-sub.aspx*" -CrawlAsHttp 1 -Type ExclusionRule
New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServicerUrl -Path "*://*allitems.aspx*" -CrawlAsHttp 1 -Type ExclusionRule
New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServicerUrl -Path "*://*/lists/*" -CrawlAsHttp 1 -Type ExclusionRule
New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServicerUrl -Path "*://*all forms.aspx*" -CrawlAsHttp 1 -Type ExclusionRule
Happy Powershelling!
Happy Powershelling!
Labels:
Powershell,
Search,
Sharepoint 2007,
Sharepoint 2010
Subscribe to:
Posts (Atom)