Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Wednesday, May 18, 2016

How to export the ULS log based on Correlation Id?

Scenario:
Sometime we may need to export check the actual error for the Correlation Id which we got in the browser. At that time, we can use the PowerShell command to get all the error details from ULS log which are related to the specific correlation id.


How:
Run the below command in the "PowerShell for SharePoint" window (Run as Administrator".


merge-splogfile -correlation "<Correlation Id>" -path .\desktop\<filename>.csv -starttime "<Time in server time format>" -endtime "<Time in server time format>"


Example:
merge-splogfile -correlation "e2677d9d-eedf-501a-7c9b-a41fc989149d" -path .\desktop\filename5.csv -starttime "5/18/2016 10:43:00 AM" -endtime "5/18/2016 10:45:00 AM"

Sunday, October 5, 2014

How to Shrink WSS_Logging Database?

Issue:
SharePoint 2010/2013 always fill the "WSS_Logging.mdf" file continuously. If you are trying to shrink or empty the ".mdf" or ".ldf" files, you will not be able to shrink them.

Follow the below steps to shrink them immediately.

Solution:
1. Open a new Query window by right clicking the "WSS_Logging" database.
2. Paste the below query and execute it which will empty the unwanted contents from database.

DECLARE @TableName AS VARCHAR(MAX)
DECLARE table_cursor CURSOR
FOR 
SELECT TABLE_NAME 
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_TYPE = 'BASE TABLE'
AND TABLE_NAME LIKE '%_Partition%'
OPEN table_cursor
FETCH NEXT FROM table_cursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @SQLText AS NVARCHAR(4000)

SET @SQLText = 'TRUNCATE TABLE ' + @TableName

EXEC sp_executeSQL @SQLText

FETCH NEXT FROM table_cursor INTO @TableName 
END
CLOSE table_cursor
DEALLOCATE table_cursor


3. Once the above is query executed, your SQL DB is ready to shrink. (If the above query is not executed, then you will not be able to shrink the "WSS_Content.mdf" file.

4. Now right click on the database and go to the "shrink window" as mentioned below and shrink the DB to "50 MB".

























5. Now the DB size would be re-sized to 50 MB.

Thats it...

Monday, October 14, 2013

Procedure or function proc_SecGetIndividualUrlSecurityCheckEventReceivers expects parameter @MinLevel, which was not supplied.

Issues:

Unknown SQL Exception 201 occurred. Additional error information from SQL Server is included below.


Procedure or function 'proc_SecGetIndividualUrlSecurityCheckEventReceivers' expects parameter '@MinLevel', which was not supplied.











(Or)

Unable to delete the File or Folder or Library or List from SharePoint 2010 portal.

(Or)

Unknown SQL Exception 208 occurred. Additional error information from SQL Server is included below.

Invalid object name 'TVF_Sites_NoLock_Id'.

(Or)

Unknown SQL Exception 208 occurred. Additional error information from SQL Server is included below.

Invalid object name 'TVF_Docs_NoLock_Url'.
Invalid object name 'TVF_Docs_Url'.














(Or)

Unknown SQL Exception 208 occurred. Additional error information from SQL Server is included below.

Invalid object name 'TVF_EventCache_UpdLock_GTId'.
Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.

Reason:
The reason for these errors are you might have attached the SharePoint content database in the destination SQL Server and may trying to create a Web application based on this restored database.

(Or)

You might have updated / changed the "Versions" table value in SharePoint Content Database after restoring the destination SQL Server.

Solution:
You need to update or install the Latest SharePoint Server 2010 Cumulative Update (CU). In most of the cases, the installation of "SharePoint 2010 Oct 2011 CU" will solve the problem.

But make sure that you have restarted your server twice to take effect the fix.

Related Link: http://sensoft2000-sharepoint.blogspot.in/2013/09/this-content-database-has-schema.html


Thursday, September 26, 2013

This content database has a schema version which is not supported in this farm.

Error:
This content database has a schema version which is not supported in this farm.



Reason:
Once you have taken the backup from SharePoint 2010 content database, usually you will restore the database in the target SQL server.

After restoring the database, you will try to create new "Web Application" using the restored content database. In this stage, you will get the above error message.

Solution:
Your source SQL server schema and the destination SQL server schema might not be matched. So you need to update the "Versions" table values in the "Restored Database".

1. Open "Versions" table from any of the existing "Content database"  from the Target SQL Server machine in "Select" mode.












2. Now open the "Versions" table values of "Restored Content Database" in "Edit" mode  as mentioned below.



3. Replace the "Version" field value in "Restored Content Database" by "Existing Content Database" values from "Target SQL Server" machine.

4. Now you will be able to create new "Web Application".

Thats it...

Update (14-October-2013)
The actual reason for the above issue is the "Version Mismatch" of the SharePoint server. You need to apply the latest cumulative update (CU) of the SharePoint server in the destination SharePoint server.

In my case, I have updated the "SharePoint 2010 Oct 2011 CU" and then Restarted the Server twice. The application is started to work without any issue.


Unable to connect to the Synchronization Service.

Error:

----------------------------------
Synchronization Service Manager
-----------------------------------
Unable to connect to the Synchronization Service.

Some possible reasons are:
1) The service is not started.
2) Your account is not a member of a required security group.

See the Synchronization Service documentation for details.

Reason:
The Forefront synchronization service user does not have access rights in the required permission groups.

Solution:
1. Open the "Server Manager"
2. Go to the Groups Folder
3. Select the "FIMSyncBrowse" group  and double click on it.
4. Add the respective user and Click "OK" button.
5. Do the same steps to add the same user for "FIMSyncJoiners", "FIMSyncOperators", "FIMSyncPasswordSet" groups.
6. Logoff your server and Login again.
7. Now you can see that if you click on miiclient.exe file, it will be displayed without showing error.

For More information, see the below screenshot:



That's it...


Wednesday, July 31, 2013

Getting error message in Central Administration after changing the IP address of SharePoint Server.

Issue:
You will get error message in Central administration after changing the IP address of SharePoint Server.

Solution:

Solution is very simple. Just follow the below mentioned steps.

1. Go to the "hosts" file folder (file path: C:\Windows\System32\drivers\etc").

     (Pic. 1)

2. Open the "hosts" file in "Administrator" privilege as mentioned below in Pic 2 & Pic 3.
    (Pic 2)

    (Pic. 3)


3. Update your machine name and IP Address as mentioned below.
    (Pic 4)

4. Clear all temporary internet files
5. Close all Browsers windows
6. Restart "IIS Admin Service" in "Services.msc" console.
     (Pic 5) 

7. Restart "SharePoint 2010 Administration" service.
    (Pic 6)


8. Now,  Open the browser and browse the Central admin url or your SharePoint application URL. You will be able to see the working version of SharePoint.

That's it...

Monday, June 4, 2012

<nativehr>0x8107058a</nativehr><nativestack> </nativestack >Feature '75a0fea7-d31d-491a-9177-f0e461a81e3f' for list template '1010' is not installed in this farm. The operation could not be completed.

Error:
<nativehr>0x8107058a</nativehr><nativestack> </nativestack >Feature '75a0fea7-d31d-491a-9177-f0e461a81e3f' for list template '1010' is not installed in this farm.  The operation could not be completed.























(or)

SiteManager.aspx is not working properly in SharePoint 2010.


Reason:
Usually you will get this error, when you are trying to access the "SiteManager.aspx" page in SharePoint 2010, once you are upgraded the MOSS 2007 content database to SharePoint 2010 environment. 

The possible reasons are:
 1. Once upgraded from MOSS 2007 to SP 2010, some of the relationships may be missed out.
 2. Some of the required list may be deleted from the portal.
 3. “Relationship List” might not be upgraded when we are migrating the MOSS 2007 portal.
 4. Some of the list columns may be corrupted. 

 Possible solutions for the above issues:
1. We may need to deactivate the publishing feature and activate them again.
2. Check the Recycle bin and restore the deleted list
3. As the site collection administrator, deactivate the "SharePoint Server Publishing Infrastructure feature" under the "Site Settings" for that specific site collection. Then delete the "Relationships List". The relationship list path will look like "HTTP://172.16.145.21:5444/Relationships%20List/allitems.aspx". Now re-activate the SharePoint Server Publishing Infrastructure feature and the Relationships List will be recreated with the correct column types.
4.Open all the list and it’s list settings page. If any of the list settings page is throwing error, then that is the cause of the error.




Actual Solution:
"Fantastic 40" templates may be missed out in the new SharePoint 2010 server. So you need to deploy and activate the missing "Fantastic 40" templates.


You can download the missing WSP files from https://skydrive.live.com/?cid=C43A63D507D8196E&id=C43A63D507D8196E!1042&sc=documents




Thats it...




Tuesday, April 3, 2012

How to: Shrink the SQL Server 2008 Log file (Even though in Mirroring)

How to: Shrink the SQL Server 2008 Log file Even though the database is in Mirroring


Sometimes you will not be able to shrink the SharePoint database log files, if the SQL Server 2008 database is in Mirroring option.


Solution:
At that time you need to open the "SQL Server management studio" and run the below query.



USE [WSS_Content_DBName]
Go
BACKUP LOG [WSS_Content_DBName] TO DISK='NULL'
Go
DBCC shrinkfile ('WSS_Content_LogName', 1) 
Go


Update:
If the above lines are not working, just try again the same query. Because sometimes it will take few more seconds to shrink the log files.

Thursday, March 29, 2012

How to: Migrate MOSS 2007 to SharePoint 2010

Migration from MOSS 2007 to SharePoint 2010


Nowadays we are getting multiple projects to migrate MOSS 2007 to SharePoint 2010. By Default, SharePoint 2010 will support to migrate the contents from MOSS 2007 to SP 2010. 


To complete the migration successfully, I am giving some additional and easy steps to follow:


Steps to Migrate the MOSS 2007 to SharePoint 2010 Contents:
1. Take a backup of existing MOSS 2007 content database using SQL server management studio. Before taking SQL backup, you can truncate the "log" file from SQL server. The log file will slow down your migration process. 


2. Restore the Content DB in target SQL Server using SQL server management studio. 


3. Create an dummy SharePoint 2010 web application without a top level site collection. (Do not refer the newly attached database name while creating teh web application) 


4. Remove the Content Data Base from the newly created dummy website through central admin as mentioned below:


i. Go to "Application Management" --> "Manage Content Databases" --> Select the specific web application.








ii.select the "Remove content database" checkbox. and click OK twice as mentioned below.












5. Then add the Content DataBase through STSADM command to the specific web application.
stsadm -o addcontentdb -url "http://172.16.0.148:3030" -databasename "WSS_Content_Old_ContentDB"


6. Now browse the application and do the visual upgrade in "Settings" page.


Thats it....


Updates:
1. Sometimes, you will not be able to browse the application since you may not be the administrator of the migrated application. At that time you need to add your name/administrator name as "Site collection Administrator" through central admin URL as mentioned below.


i. Application Management --> "Change site collection administrators" 











ii. Select your web application and update the correct Primary and secondary administrators. 













2. If you are not able to update anything in the newly migrated application, the application may be in Read-Only mode. Or sometimes, the administrator (system account) will not be able to see the Administration links. To fix this, you need to provide read-write access to the newly created web application as I mentioned below.


stsadm -o setsitelock -url "http://servername" -lock none


3. During the migration process, you check the status of the migration in "Upgrade and Migration" section of central admin.


Sometimes, the migration status may shown as "failed". This is because of the custom solutions which are deployed in the MOSS 2007. You can simply ignore them.




But once the "Addcontentdb" command is completed, the database status should be "No action required". You can check the status under the "Upgrade and Migration" --> "Review database status" in central admin.







4. If you are getting 

 "Database is in compatibility range and upgrade is recommended" error, then you need to run the 
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures command.
....
(Do let me know, if you need any other information related to migration...)

Thursday, July 28, 2011

Issue: Calendar list is Missing in SharePoint 2010

Issue: 
Calendar list is Missing in SharePoint 2010.


Reason:
The required "site feature" may not be activated in the SharePoint portal.


Solution: 
1. Go to the "Site Settings"
2. Go to "Manage Site Features"
3. Check "Group Work Lists" feature is activated or not. If not, Activate the feature.




Thats it... 


Update:
If you are not able to view / create lists or document library or task library, you need to activate the "Team Collaboration Lists" site feature.

Thursday, July 7, 2011

Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm

Error:
Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.

Reason:
You will get this error, when you are trying to deploy the web part/solution through visual studio. The reason is the current logged-in user may not be the "db owner" in the content databases.

Solution:
To deploy the solution successfully, you need to map the current logged-in user as db_owner into the 3 databases.
1. SharePoint_Config
2. SharePoint_Admin_[GUID]
3. Your current web application that needs to deploy the Web part

For more info, check the below screenshot.



Thats it...

Wednesday, June 29, 2011

The Web application at could not found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

Error:

The Web application at could not found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.




Solution:
change the visual studio solution to 64 bit in properties as per the below screenshot.



Thats it...

Tuesday, June 28, 2011

Error: The type or namespace name 'SPSite' could not be found (are you missing a using directive or an assembly reference?)

Error:
The type or namespace name 'SPSite' could not be found (are you missing a using directive or an assembly reference?)

Reason:
Sometimes you will get this issue, while you are testing/developing your SharePoint code through console applications.

By default, visual studio 2010 will set target framework as ".Net Framework 4 Client Profile"

Solution:
We need to change the target framework as ".Net Framework 3.5"

To do this,

1. Go to Solution property in visual studio.

2. Change the target framework to ".Net Framework 3.5" as below:

3. Save all & build the solution.

Thats it...




Friday, November 12, 2010

Issue: User profiles Sync DB doesn't have Tables or Stored Procedures

Issue:
While you are trying to import the user profiles in SharePoint 2010, you will get lots of errors. Particularly, we will face some of the issues like below:

1. Forefront Identity Manager Service may not be started.
2. Forefront Identity Manager Synchronization service may not be started.
3. If you see the "eventvwr", you will get some of the errors like below:
   
Error 1:

The Forefront Identity Manager Service cannot connect to the SQL Database Server.

The SQL Server could not be contacted. The connection failure may be due to a network failure, firewall configuration error, or other connection issue. Additionally, the SQL Server connection information could be configured incorrectly.
Verify that the SQL Server is reachable from the Forefront Identity Manager Service computer. Ensure that SQL Server is running, that the network connection is active, and that the firewall is configured properly. Last, verify the connection information has been configured properly. This configuration is stored in the Windows Registry.
Error 2:
 .Net SqlClient Data Provider: System.Data.SqlClient.SqlException: Could not find stored procedure 'RegisterService'.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ResourceManagement.Data.DataAccess.RegisterService(String hostName)

Error 3:
The Forefront Identity Manager Service was not able to initialize a timer necessary for supporting the execution of workflows.The Forefront Identity Manager Service could not bind to its endpoints. This failure prevents clients from communicating with the Web services.

Error 4:


 A most likely cause for the failure is another service, possibly another instance of Forefront Identity Manager Service, has already bound to the endpoint. Another, less likely cause, is that the account under which the service runs does not have permission to bind to endpoints.

Ensure that no other processes have bound to that endpoint and that the service account has permission to bind endpoints. Further, check the application configuration file to ensure the Forefront Identity Manager Service is binding to the correct endpoints.
Solution:
I have spent lots of time to fix this issue. Hmmmm...  The solution is in SQL server side. In SQL Server database, you cannot find any "tables" or "Stored Procedures" in "Sync DB"
I have given the solution in single screenshot.  In the below screenshot, set the "db_owner" schema for "dbo".













If you set the "dbo" as "db_owner", you can able to start the "Forefront Identity Manager Service". so that you will be able to start the profile import process.
Update: 
The same permission should be assigned to all user profile service databases like "Profile DB", "Social DB".


Also you need to restart the below services
1. Forefront Identity Manager service 
2. Forefront Identity Manager Synchronization Service
3. IIS 
Thats it...

Tuesday, November 2, 2010

Error: The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

Error:
The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator. 




Reason:
You will get this error while you are trying to view the InfoPath forms in browsers. The reason is, the "State Service" may not be enabled/associated for the current web application.

Solution:
Check all the below possibilities...

(Note: I assume that you already know how to develop a browser compatible InfoPath forms)

1. Go to "Application Management" --> "Manage service applications"
2. Check whether the "State Service" is enabled or not (like the below screenshot). 

















3. If the service is not started or missed, we should configure/start the state service. OK. How to start the service?  proceed with step 4.
4. Go to the "Configuration Wizard" and start the configuration
5. Make sure the "State Service" is enabled. (Eventhough it is selected, run the wizard again.Hmmmm...That is microsoft :) )

6.Wait until you see the below screen (It will take few minutes to complete).













7. Now, check whether the InfoPath forms are rendering properly in the browser or not. If everything is fine, then continue with your work.. Again if you are getting the same error screen, you need to check the "Service Associations" for your current web application (proceed with step 8).

8. In "Central Administration", Go to "Application Management" and select the "Configure service application associations" in "Service Applications" section. 

9. Click on your web application and a pop up windows will be displayed. 






















10. Select the "State Service" Check box and click "OK".  

11. Now you can able to view the InfoPath forms in browser like below. 














Thats it...