Monday, March 17, 2008

Free Controls List

Shall update this, whenever I find a good control to use..

Great controls to be aware of when building SharePoint sites

Tool to recover lost partitions

TestDisk; An open source to recover lost partitions, worth a dekho.

TestDisk can :

Fix partition table, recover deleted partition
Recover FAT32 boot sector from its backup
Rebuild FAT12/FAT16/FAT32 boot sector
Fix FAT tables
Rebuild NTFS boot sector
Recover NTFS boot sector from its backup
Fix MFT using MFT mirror
Locate ext2/ext3 Backup SuperBlock

Thursday, March 13, 2008

Protecting SharePoint customisation against SP's, hotfixes, et all

Changes to 12 Hive
Changes directly to the out-of-the-box files in the 12 hive, should be avoided whenever possible. The reason being, you risk losing those customisations whenever a service pack/hotfix is applied. And always backup the 12 hive, so that it can be restored if it all goes pear shaped. And use a good diff tool to check for changes, and merge (as against replacing) when copying the backed up file into the 12 hive.

Whenever possible deploy our customisation as features and solutions. And follow the MS best practice guideline for keeping you customisation upgrade safe. To build a comprehensive customisation policy document read policies around development and customizations.

Changes to the SharePoint DB
MS does not support modification to the SharePoint DB. If you do have to make changes, keep a backup of DB which does not contain any customisation. MS will ask you to revert back to that DB, if you ever need to lodge a disaster recovery case with them. Changes to the following are not supported:
  • Adding database triggers
  • Adding new indexes or changing existing indexes within tables
  • Adding, changing, or deleting any primary or foreign key relationships
  • Changing or deleting existing stored procedures
  • Adding new stored procedures
  • Running stored procedures manually or programmatically
  • Adding, changing, or deleting any data in any table of any of the databases for the products that are listed in the "Applies to" section
  • Adding, changing, or deleting any columns in any table of any of the databases for the products that are listed in the "Applies to" section
  • Any modification to the database schema
  • Adding tables to any of the databases for the products that are listed in the "Applies to" section
Read this article on what is supported, which basically includes DB maintenance tasks only. If you have to query SharePoint DB, I suggest you do so against a copy of the production data, and build maintenance plans to keep it in synch with prod data. Maintenance plans though can cause issues in themselves, such as index corruption as described here .

Friday, March 7, 2008

SCOM Training Videos

Can be found here

SCOM Documentation

The documentation is available here and covers:


  • Operations Manager 2007 Deployment Guide
  • Active Directory Management Pack Guide for Operations Manager 2007
  • Exchange Management Pack Guide for Operations Manager 2007
  • SQL Management Pack Guide for Operations Manager 2007
  • Windows Server Operating System Management Pack Guide for Operations Manager 2007
  • Windows Client Operating System Management Pack Guide
  • Operations Manager 2007 Terminal Services Management Pack
  • Operations Manager 2007 Security Guide
  • Operations Manager 2007 Management Pack Guide
  • Operations Manager 2007 Management Pack Terminal Services
  • Operations Manager 2007 Microsoft Management Pack Authoring Guide

The 180 days Trial version is available here.

Newsgroups :

  • microsoft.public.opsmgr.acs
  • microsoft.public.opsmgr.ad
  • microsoft.public.opsmgr.aem
  • microsoft.public.opsmgr.authoring
  • microsoft.public.opsmgr.docs
  • microsoft.public.opsgmr.exchange
  • microsoft.public.opsmgr.general
  • microsoft.public.opsmgr.iis
  • microsoft.public.opsmgr.managementpacks
  • microsoft.public.opsmgr.powershell
  • microsoft.public.opsmgr.reporting
  • microsoft.public.opsmgr.sdk
  • microsoft.public.opsmgr.setup
  • microsoft.public.opsmgr.sql
  • microsoft.public.opsmgr.ui

Other resources:

Wednesday, March 5, 2008

Recreating Orphan References

Background info:

What we are essentially trying to do here is recreating the reference between ConfigDB.sitemap.ID and ContentDB.Webs.SiteID, to get rid of Orphans. In most cases this is left best for Sharepoint to do (through detaching-attaching the content DB). This creates the reference if none exist. Manually updating the references will corrupt the indexed content on these sites and search may not work.

Note: Please backup ContentDB & Config DB before even firing a query on these. Also do so after hrs, as you may lockup these tables.

Issue with multiple sites with same URL in the farm:

One of the issues we had, was that multiple sites existed with the same URL. So if users type that URL, Sharepoint has no way to uniquely identify the site being referenced. For this very reason detach-attach also does not work, nor does other stsadm tools like databaserepair (it will give you zarro results). We would need to fix this issue before trying to proceed further into recreating references.


Run the stored proc :

create proc dbo.proc_GetOrphanedSites
as
Drop table orphanlist
CREATE TABLE [dbo].[orphanlist]( [farm] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [databasename] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SiteID] [uniqueidentifier] NULL, [sitepath] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [type] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)
drop table orphan_hopper declare @dbname as varchar(250), @cmdstr as varchar(2000), @dbid as varchar(250),@configdb as varchar(250) /** only change the following line and nothing else, change spskills_config_db to your config db name **/select @configdb = 'Sharepoint_Config'
/** Change nothing below this line **/select @cmdstr = 'select distinct b.name as ''databasename'', b.id as ''dbid'' into orphan_hopper from [' + @configdb + '].dbo.sitemap as a inner join [' + @configdb + '].dbo.objects as b on a.databaseid=b.id inner join [' + @configdb + '].dbo.objects as c on c.id=a.applicationid inner join [' + @configdb + '].dbo.objects as d on b.parentid=d.id inner join [' + @configdb + '].dbo.objects as e on d.parentid=e.id ' exec (@cmdstr) DECLARE DBCursor CURSOR For Select databasename, dbid From orphan_hopper OPEN DBCursor FETCH NEXT FROM DBCursor into @DBName, @dbid WHILE @@FETCH_STATUS =0 BEGIN INSERT INTO orphanlist([Type], farm, databasename,[sitepath], SiteID) EXEC (' select ''Potential ConfigDB orphan:'' + '''+@dbname+''' as [Type], '''+@configdb+''' as [farm], '''+@dbname+''' as [databasename],path as [sitepath], id as [SiteID] from ['+@configdb+'].dbo.sitemap where id not in (select id from ['+@dbname+'].dbo.sites) and databaseid = '''+@dbid+''' union select ''Potential ConfigDB orphan:'' + '''+@dbname+''' as [Type], '''+@configdb+''' as [farm], '''+@dbname+''' as [databasename],path as [sitepath], id as [SiteID] from ['+@configdb+'].dbo.sitemap where id not in (select siteid from ['+@dbname+'].dbo.webs where parentwebid is null) and databaseid = '''+@dbid+''' union select ''Potential ContentDB orphans:'' + '''+@dbname+''' as [Type], '''+@configdb+''' as [farm], '''+@dbname+''' as [databasename],fullurl as [sitepath], siteid as [SiteID] from ['+@dbname+'].dbo.webs where parentwebid is null and siteid not in (select id from ['+@configdb+'].dbo.sitemap where databaseid = '''+@dbid+''') union select ''Potential ContentDB orphan:'' + '''+@dbname+''' as [Type], '''+@configdb+''' as [farm], '''+@dbname+''' as [databasename],fullurl as [sitepath], siteid as [SiteID] from ['+@dbname+'].dbo.webs where parentwebid is null and siteid not in (select id from ['+@dbname+'].dbo.sites) ') FETCH NEXT FROM DBCursor into @DBName, @dbid END CLOSE DBCursor DEALLOCATE DBCursor select * from orphanlist

GO

· If there are no duplicates (URL’s) then all you need to do is attach/detach the content db (use stsadm for this, as you may experience script timeouts if you try it through CA-UI)

· If there are duplicates but belong to different databases, then you need to restore the site collections on a different path (stsadm). And then detach-attach the databases one by one.

· If they all happen to reside in the same database, then either we need to change the path associated with each of them, or figure out the one you need to restore and delete the rest (Query Analyser). Then detach-attach the content DB.
No techie it seems is worth his for loop without a blog, however I start this more as a tool to collect information for future reference.