Database not found error / Remove reference to unused database in SharePoint


When you create new service applications (Example Search application) to fix issues or for some other reasons , SharePoint has a tendency to retain list of  old databases reference in configuration database . These databases are no longer in use or are available on your database server but you will see errors in event logs which refer to database which no longer exist

Example of error message

Event ID: 3760

Event Description: SQL Database ‘Search_Application_AnalyticsReportingStoreDB_56910d48c8754b409912657ac35181fa’ on SQL Server instance “server.xyz.com” not found. Additional error information from SQL Server is included below.

 Cannot open database “Search_Application_AnalyticsReportingStoreDB_56910d48c8754b409912657ac35181fa” requested by the login. The login failed.

Login failed for user “xyz\farmaccount”.

 

Resolution :

To get rid of these errors , we need to remove the reference of the databases from configuration database by running below commands in SharePoint management shell from any server in the farm:

Get-SPDatabase | fl name,id

This will give you list of all the databases and their IDs. Note the ID of the database which you need to remove and run below command to delete it:

$db = Get-SPDatabase ID

$db.Delete()

 

 

Preupgradecheck errors – part 3


 Missing Site definitions

The following site definition(s) are referenced by the content, but they are not installed on the web server

name = Unknown, language = 1036, template id = 53, count = 1, status = Missing            
name = Unknown, language = 3082, template id = 53, count = 2, status = Missing            

Solution :

  1. Run stsadm –o enumallwebs
  2. In the output of enumallwebs and search for templateid=”53” or template name=unknown

                For example:

                <Web Id=”c81bceb5-9e18-45b0-a42a-76887316daa9″ Url=”/sites/baseline/Gregg”       LanguageId=”1036″ TemplateName=”Unknown” TemplateId=”53″ />

<Web Id=”e8268465-b11b-431c-ad1c-d868ae9fc8ee” Url=”/sites/baseline/test hcl” LanguageId=”3082″ TemplateName=”Unknown” TemplateId=”53″ />

    Once you have the webids , remove these orphan webs using deleteweb command :

stsadm -o deleteweb -webid  “e8268465-b11b-431c-ad1c-d868ae9fc8ee” -force -databasename MyWork_WSS_Content_CPGPortal_01 -databaseserver ausb3spsdbp01

Health check error after applying August 2011 CU for SP2010


After installing the August 2011 Cumulative Update (CU) for Microsoft SharePoint Server 2010, the following error is logged in the Health Reports section of Central Administration:

“Verify that the critical User Profile Application and User Profile Proxy Application timer jobs are available and have not been mistakenly deleted”

Cause: This error is thrown due to a flaw in the logic of the owning health rule.

Resolution: Microsoft acknowledges that there is a flaw in the health rule logic and will resolve this issue in an upcoming CU. In the meantime, this error can be ignored.

Reference: http://support.microsoft.com/kb/2622705

August 2011 Cumulative Updates


 August 2011 Cumulative Updates  for SharePoint 2007/2010

 
Please note that  SharePoint Server 2010 CU contains the SharePoint Foundation CU. And the SharePoint Server 2010 with Project Server CU contains Project Server CU, SharePoint Server CU and SharePoint Foundation CU.
That means only one package has to be installed for the SharePoint 2010 product family. 
 
 

Unable to open pdf attachments from SP2010 site?


By default SharePoint 2010 does not allow you to open PDF documents directly and you will get following message if you try to open the pdf documents from SP2010 directly:

why?

In Internet Explorer 8 Microsoft added a security feature to prevent script injection vulnerabilities caused by buggy client software. This feature is activated by a new HTTP header called X-Download-Options which can be set to noopen. When that header is passed with a file attachment Internet Explorer 8 will not provide the option to directly open the file, instead you must first save the file locally and then open it.
SharePoint 2010 utilizes this enhanced security feature in IE 8 to block the opening of file types it considers vulnerable to scripting or other attacks, such as PDFs.

Workaround: (This these changes only if it is really required as it adds security risk to the environment)

  • Go to SharePoint 2010 Central Administration > Application Management > Manage Web Applications
  • Select the row of your web application
  • Click General Settings in the ribbon
  • Scroll down to Browser File Handling and select Permissive
  • Click Ok

Preupgradecheck errors -Part -2


The following feature(s) are referenced by the content, but they are not installed on the web server

 Name = Unknown, Feature id = GUID, Reference count = 1, Scope = Web, Status = Missing             
 Name = Unknown, Feature id = GUID, Reference count = 2, Scope = Web, Status = Missing             
 Name = Unknown, Feature id = GUID, Reference count = 1, Scope = Web, Status = Missing            

Steps to fix the errors

    1st Method

1. Download Feature Admin tool from http://featureadmin.codeplex.com/
2. Run the exe and click “Find faulty features” in the farm which will detect the faulty features now remove the faulty feature by using “Remove Feature from farm” option.

    2nd method

1.From the PreUpgradeCheck report note the feature GUID
2. Run following query on DBs (Content db and central admin db) to verify that the feature exists on Central Admin DB

SELECT * FROM FEATURES WITH(NOLOCK) WHERE FEATUREID=’GUID’

This query will display WebId , SiteId and other details about the feature.
3. Run

STSADM -o deactivatefeature -id GUID -force            

4. Download the utility WssRemoveFeatureFromSite from http://code.msdn.microsoft.com/WssRemoveFeatureFrom
5. Go to command prompt and point to WSSRemoveFeatureSite directory and type:
WssRemoveFeatureFromSite -scope (site|sitecollection) -url -featureid -force

Preupgradecheck errors -Part -1


Missing server file or server configuration issues.
Web part Errors:
The following web part(s) are referenced by the content, but they are not installed on the web server

•Id = 72818beb-d38f-ce20-ad03-17a569674760, Type = Unknown, Reference = 29, Status = Missing             
•Id = b0361b90-8e73-425f-bcbc-2b2469198a00, Type = Unknown, Reference = 14, Status = Missing             
•Id = 19060b95-1c73-5a5b-875c-2e2c7d7cd355, Type = Unknown, Reference = 4, Status = Missing             

Steps to fix the errors
1.Logon to Database server and Run following SQL query on the content database for the Support site:

SELECT * FROM [WebParts] WITH(NOLOCK)where tp_WebPartTypeId =’ID’             
Example: SELECT * FROM [WebParts] WITH(NOLOCK)where tp_WebPartTypeId ='72818beb-d38f-ce20-ad03-17a569674760'             
            

From the results pane copy the tp_PageUrlID . These are the ids of the urls which has reference to the missing webparts .

2.Now run following query:

SELECT * FROM Alldocs WITH(NOLOCK)where id='80A251DD-1452-4199-A0BA-05120A7286EC'            

(ID is the value of the tp_PageURLID)

You will get DirName and LeafName corresponding to that PageURLID

3.Repeat step-2 for all the PageURL Ids to get complete URLs for a particular webpart ID. Step-1 and Step-2 needs to be performed multiple times to get a list of all the URLs where we need to fix the webpart error.
4.Now go to the URL, example :http://abc.amd.com/test/pages/test.aspx?contents=1
5.Check-out the page , delete the error web part and check-in/publish the page
6.To test if the issue is fixed run the below query again:

SELECT * FROM Alldocs WITH(NOLOCK)where id='80A251DD-1452-4199-A0BA-05120A7286EC'

again.

You should not get any results if all the URLs are fixed.