Microsoft makes it tough with simple things like finding and deleting the orhpaned sites/site collections. There seems to be no well documented way to do this task. After googling for many search strings, below are few resources and steps you can take to clean up your content and config databases.
- Run the following command:
stsadm -o databaserepair -url http://<URL_of_WindowsSharePointServices_Site> -databasename <name of database that contains the orphan item>
- If the above command reveals any orhpaned sites, then run the above command with -deletecorruption parameter:
stsadm -o databaserepair -url http://<URL_of_WindowsSharePointServices_Site> -databasename <name of database that contains the orphan item that is to be deleted> -deletecorruption
[http://sharenotes.wordpress.com/2007/11/19/ deleting-purging-removing-orphaned-sites-or-site-collections/]