Monday, March 8, 2010

How to restart SharePoint Central Administration service after stopping it via Central Admin GUI

If you've stopped the Central Administration service within the GUI, here's how you get it started again:

From the command prompt type (assumming STSADM path is defined in environment variables)

stsadm -o provisionservice -action start -servicename WSS_Administration -servicetype Microsoft.SharePoint.Administration.SPWebService

Once this command successfully completes, run an IISREST t

How to force a SQL database log file to shrink via SQL Manager UI

I’ve sometimes found that when trying to shrink a SharePoint SQL via the SQL Management interface, the database refuses to shrink, and in some cases even grows!

A colleague showed me an easy fix today which requires a simple (temporary) change to the database options.

Simply follow these steps (but bear in mind that you are following this advice at your own risk)

  1. Ensure you have a FULL backup of the database because you will be essentially "breaking" the full transaction log by carrying out this procedure.
  2. Right click the database and choose PROPERTIES, then click on Options
  3. Change the Recovery Model to ‘Simple
  4. Click OK
  5. Right click the DB, select Tasks > Shrink > Files
  6. Select ‘Log’ under file type
  7. Under shrink action, select ‘Reorganize pages…” and then set the new size to shrink the log down to
  8. Click OK and your database log file will be resized.
  9. Be sure to change the Recovery Model back to ‘FULL’ when completed’