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!
Showing posts with label Sharepoint 2007. Show all posts
Showing posts with label Sharepoint 2007. Show all posts
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
Thursday, March 31, 2011
SharePoint 2010: Changing Regional Settings and Locale Settings in Powershell
I just had a client scenario where I have the SharePoint implementation has up to 40 different site collections to maintain. Well, I'm London based and so is my client... what about the default regional settings? Eng-US right? Is my client happy with it? Not really: en-GB, please!.
All right, first of all, let's change the Regional Settings at the level of the Web Application. That's the easy one, as it can be leveraged from SP "Central Admin" site. So simply follow the steps below:
- Go to "Central Admin"
- Click "Application management" from the quick launch.
- Click "manage web applications" under "Web application" heading
- Select web application on which you want to change the regional settings.
- From the ribbon click "General setting" and select "General Settings" from the dropdown.
- Setting modal dialog will appear, you can change the "default time zone" and other settings if you want to change, and click OK.
- IISReset
[Reflection.Assembly]::LoadWithPartialName("System.Globalization") | out-null
clear-host
$SiteCols = Get-SPWebApplication "<SiteCol URL>" | Get-SPSite -Limit ALL | Select URL
foreach ($siteCol in $SiteCols)
{
write-host "---- Site Collection: " + $siteCol.url + "----"
get-spweb -site $siteCol.url -limit all |% {
$_.Locale = [System.Globalization.CultureInfo]::GetCultureInfo("en-GB");
$_.Update()
}
#check if culture has been updated
get-spweb -site $siteCol.url -limit all |% {
$_.Locale
}
}
By the way, make sure you are running the script under a site collection administrator; otherwise you'll get a nasty Access Denied exception.
Get-SPWeb : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At line:4 char:12
+ get-spweb <<<< -site "<SiteCol URL>" -limit all |% {
+ CategoryInfo : InvalidData: (Microsoft.Share....SPCmdletGetWeb:SPCmdletGetWeb) [Get-SPWeb], UnauthorizedAccessException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetWeb
Make Powershell your buddy when it comes to pre-deploy | post-deploy tasks. It will save a lot time that's for granted, but also it will save you heaps of headaches when deploying SharePoint application between different environments.
Wednesday, February 02, 2011
Unable to add a lookup field using AddFieldAsXml –Solved!
I recently had a problem when trying to add a new lookup field programmatically. It turns out that Field ID was actually the culprit. You can't use a fixed field ID when using web.Fields.AddFieldAsXml(sColumnDefinitionXml) which is what the XML for a field is supposed to have when it is used as an element file in a feature, but not when you are adding the field using code.
Then:
Wrong XML definition for sColumnDefinitionXml
<Field Type=\"Lookup\" DisplayName=\"Chat Waiting Time\" Required=\"FALSE\" List=\"4c00bad4-e57d-417e-ad6e-d29fcad06c3f\" ShowField=\"AdvisorResultText\" Group=\"ChildLine Site Columns\" ID=\"{D4654C7B-7DDD-4c79-9CB1-7130B567C3BC}\" StaticName=\"ChatWaitingTimeLookUp\" Name=\"ChatWaitingTimeLookUp\" xmlns=\"http://schemas.microsoft.com/sharepoint/\" />"
Right XML definition for sColumnDefinitionXml
<Field Type=\"Lookup\" DisplayName=\"Chat Waiting Time\" Required=\"FALSE\" List=\"4c00bad4-e57d-417e-ad6e-d29fcad06c3f\" ShowField=\"AdvisorResultText\" Group=\"ChildLine Site Columns\" StaticName=\"ChatWaitingTimeLookUp\" Name=\"ChatWaitingTimeLookUp\" xmlns=\"http://schemas.microsoft.com/sharepoint/\" />"
Took it off and it worked like a charm. Now all lookup fields can be safely added by my feature receiver J.
Friday, March 05, 2010
SharePoint administration user accounts (MOSS and SP 2010)
| Account | Account Name | Scope | Used By | Needed at | Requirements |
| Install Account | DOMAIN\SVCMossSetup | Farm | Person Installing | Setup | Member of the administrator group on each Web front-end (WFE) server and application server computer in the farm. Member of the following SQL Server groups with SQL Security administrator and database creator rights on SQL servers. |
| Farm Administrator Account | DOMAIN\SVCMossFarmAdmin | Farm | Central administration site application pool identity | Setup | Member of administrators group on each WFE server and application server computer in the farm with SQL security administrator and database creator rights on SQL Servers. Database Owner (DBO) for all databases and additional permissions on WFE server and application server computers are automatically configured for this account when SharePoint is installed. |
| SSP Admin Process Account | DOMAIN\SVCMossSSPAdmin | Farm | SSP Timer service; SSP Web services SSP App Pool Identity | SSP Creation | No configuration is necessary. The following permissions are automatically configured for this account when SharePoint is installed: DBO for the Share Service Provider (SSP) content database, read/write permissions for the SSP content database, read/write permissions for content databases for Web applications that are associated with the SSP, read permissions for the configuration database, read permissions for the central administration content database, and additional permissions on WFE server and application server computers. |
| Crawl / Content Access Account | DOMAIN\SVCMossCrawl | Farm | Windows SharePoint Services 3.0 Search service | SSP Creation | Must be a domain account, but must not be a member of the farm administrators group. Permissions automatically configured for this account when SharePoint is installed include the following: read/write permissions for content databases for Web applications, read permissions for the configuration database, and read/write permissions for the Windows SharePoint Services Search database. |
| Content Account | DOMAIN\SVCMossContent | App | Web Applications | App Pool Creation | No configuration is necessary. SQL Server privileges that are automatically assigned to this account are member of Database Owners Group for content databases associated with the Web application, read/write access to the associated SSP database only, and read permission for the configuration database. Additional privileges for this account on WFE servers and application servers are automatically configured by SharePoint. |
Thursday, March 04, 2010
SharePoint PDF iFilter Installation Guide
Windows SharePoint Services 3.0
[Indexing Server]
- Install the PDF IFilter (see below for a list of available IFilters)
- Add the .pdf file type to the index list:
- Open the Registry Editor (Start > Run > regedit)
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Applications_<GUID>_\Gather\Search\Extensions\ExtensionList
- Add a new String Value
- Value name: <next value in line>
- Value data: pdf
- Value name: <next value in line>
- Open the Registry Editor (Start > Run > regedit)
- Change the registry keys pointing to the IFilter's GUID
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
- Add or change the (Default) key value
- Old value:
{4C904448-74A9-11D0-AF6E-00C04FD8DC02} - (Foxit x64 PDF IFilter) New value:
{987F8D1A-26E6-4554-B007-6B20E2680632} - (Adobe x64 PDF IFilter) New value:
{E8978DA6-047F-4E3D-9C78-CDBE46041603}
- Old value:
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
- Repeat step (b) above
- Perform an iisreset
- Perform a Full Update on the Search content indexes
- Open a Command Prompt on the Indexing Server
- net stop spsearch
- net start spsearch
- cd "C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\BIN"
- stsadm.exe -o spsearch -action fullcrawlstop
- stsadm.exe -o spsearch -action fullcrawlstart
[Web Front End Server]
- Open a Command Prompt on the Indexing Server
- Copy the ICPDF.GIF () file to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images"
- Edit the file C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\Template\Xml\DOCICON.XML
- Add an entry for the .pdf extension
<Mapping Key="pdf" Value="icpdf.gif"/>
[Indexing Server]
- Install the PDF IFilter (see below for a list of available IFilters)
- Add the .pdf file type to the index list:
- Go to Central Administration, then to the Shared Services Administration Web of the current SSP, go to Search Settings and next to File Type
- Add a new file type pdf
- Go to Central Administration, then to the Shared Services Administration Web of the current SSP, go to Search Settings and next to File Type
- Add the .pdf file type to the index list:
- Open the Registry Editor (Start > Run > regedit)
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Applications_<GUID>_\Gather\Search\Extensions\ExtensionList
- Add a new String Value
- Value name: <next value in line>
- Value data: pdf# Change the registry keys pointing to the IFilter's GUID
- Value name: <next value in line>
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
- Add or change the (Default) key value
- Old value:
{4C904448-74A9-11D0-AF6E-00C04FD8DC02} - (Foxit x64 PDF IFilter) New value:
{987F8D1A-26E6-4554-B007-6B20E2680632} - (Adobe x64 PDF IFilter) New value:
{E8978DA6-047F-4E3D-9C78-CDBE46041603}
- Old value:
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
- Repeat step (e) above
- Open the Registry Editor (Start > Run > regedit)
- Perform an iisreset
- Perform a Full Update on the Search content indexes
- Open a Command Prompt on the Indexing Server
- net stop osearch
- net start osearch
- Go to Central Administration, then to the Shared Services Administration Web of the current SSP, go to Search Settings and start a full crawl of all locations containing PDF files
[Web Front End Server]
- Open a Command Prompt on the Indexing Server
- Copy the ICPDF.GIF () file to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images"
- Edit the file C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\Template\Xml\DOCICON.XML
- Add an entry for the .pdf extension
<Mapping Key="pdf" Value="icpdf.gif"/>
- Add an entry for the .pdf extension
Available IFilters
Adobe PDF IFilter 9.0
- free (always good !)
- 32 bit: the IFilter is included with Adobe Reader. You must download and install the whole Adobe Reader package onto the server.
- 64 bit: download the standalone x64 IFilter(64 bit released recently, applies to the [Indexing Server])
- free for desktops, servers require a license
- 32 bit and 64 bit (IA64 currently being tested, applies to the [Indexing Server])
Labels:
IFilter,
MOSS,
PDF,
Registry,
Sharepoint 2007,
Sharepoint 2010
Subscribe to:
Posts (Atom)
