If you’ve ever attempted to do a STSADM -o restore and the process got interrupted, then you KNOW what I’m talking about. When this happens and site data is not properly synchronized between the config and content databases, things get a little rough especially since you can’t restart the restore due to this state of the database.
According to a post by Keith Richie, there is some hope. Part II can be found here. In some cases, depending on the type of orphaned mismatch you have, the problem can be resolved by reattaching the content database. In the case where you have content data but not config data though, which seems to be the case most of the time, there are few options available. And if you’re thinking of just cleaning up the records yourself, for pity’s sake DON’T!!!
I REPEAT! DO NOT DIRECTLY UPDATE YOUR SHAREPOINT DATABASES! STEP AWAY FROM THE KEYBOARD!