Tuesday, August 28, 2012

SharePoint 2010 - Exception: Invalid object name 'Webs'.

After running SP 2010 Cumulative update package and attempting Wizard I ran into the following error on a development box

Exception: Invalid object name 'Webs'.


Not very clear error .... but after looking in the Upgrade.log I found the following error pointing to a ContentDB


[DEBUG] [8/24/2012 7:01:02 PM]: Retrieving site definition for language 1033...
[OWSTIMER] [SPUpgradeSession] [ERROR] [8/24/2012 7:01:02 PM]: Upgrade [SPContentDatabase Name=WSS_Content] failed.
[OWSTIMER] [SPUpgradeSession] [ERROR] [8/24/2012 7:01:02 PM]: Exception: Invalid object name 'Webs'.
[OWSTIMER] [SPUpgradeSession] [ERROR] [8/24/2012 7:01:02 PM]:    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.SqlDataReader.ConsumeMetaData()

Armed with this information I checked the content DB in question using SQL loads of tables/stored procedures were missing - see pictures below

Other Tables contained many more as below
















As this was a development box I was able to remove the  web application and content DB - re-ran the upgrade wizard and all was good. 


Wednesday, March 28, 2012

SharePoint 2007 - Update multiple Site Collections quota values

Out of the box SharePoint 2007 does not offer an automated way to modify existing site collections with a quota value. For example if you have a quota "Extranet" with a size limit of 3GB that's been applied to 1000 sites currently there is no method to update this value on batch


However using the "SharePoint Administration Toolkit" you can run the following command


The following would update all the sites using the quota extranet with the new value


  • stsadm –o updatequota –quotaname Extranet

The following would update all the sites using the quota extranet with the new value but only that are contained in WSS_Content_001 


  • stsadm –o updatequota –quotaname Extranet -contentdb WSS_Content_001

For more examples follow this link 
http://technet.microsoft.com/en-us/library/ee449569(office.12).aspx


Saturday, March 10, 2012

SharePoint - Script to copy a files to SharePoint Library


Recently I was asked to automate a file copy from windows (UNC) into a SharePoint directory.  There are limitations with this especially with windows 7 and Server 2008 but luckily my requirement was from a Windows 2003 server to SharePoint 2010. You need to make sure you can view the "Explorer View" for this to work.


I used this simple DOS script, utilising  PUSHD (connects a the last free network drive) and POPD (release network drive).


rem $echo off
rem ************
set REPORT="d:\Sharepointcopy\InsiteSharepoint2010.log"
echo %date% %time% >> %REPORT%
pushd "\\contoso.com\Documents" >> %REPORT%
copy d:\*.xml /Y z:\ >> %REPORT%
popd 
echo %date% %time% >> %REPORT%
echo *Finished*>> %REPORT%