Orphans are the objects in a SharePoint schema that live without a parent or child relationship in the database. This database inconsistencies can be created due to many different reasons, for example, if you are creating a new site and click back, or close the window in mid creation, or when you are deleting a site and stop the process in the middle, etc., etc., etc. In any case these orphan objects could be a real problem when you need to upgrade your farm installing a hotfix or a service pack. The majority of issues produced during an upgrade process are due to one or more orphan objects in the database, so it is a good practice to check and clean all orphan objects in your farm before to implement the upgrade.
As a Best Practice you should clean the old sync information in your MOSS databases periodically executing the following commands:
Stsadm –o sync –listolddatabases 2
Where 2 is the number of days old the sync info is. If it is more than a few days old it is probably orphaned. If you receive any result means that you have old sync info in your databases so you have to run this other command to delete it:
Stsadm –o sync –deleteolddatabases 2
Before to execute an update on your farm (a hotfix or service pack installation) you have to run the following commands to detect if any orphan object exist:
Stsadm –o databaserepair –url <mysiteURL> -databasename <myContentDB>
If any object is listed by this command, your farm is right and you don’t have any orphan object, you can proceed with your upgrade. If the command lists any object it means that this object is an orphan one, so you should execute the following one to delete all of these objects on the farm:
Stsadm –o databaserepair –url <mysiteURL> -databasename <myContentDB> –deletecorruption
The best way to ensure that the last command has ran fine and deleted all the orphans is to execute the first one again and ensure that any object is listed now. If any object is listed your farm is clean and you can proceed with the upgrade, in other case it means that the orphan objects are deeper and you have to jump to the second part of this post to learn how to detect and clean the deep orphan objects.
No hay comentarios:
Publicar un comentario