I have an issue with a customer DB with it being corrupted. This has been the case for a while and hence no way to revert to a backup because all the backups have the corruption as well. I am however seeing what the impact is of doing a DBCC REPAIR_ALLOW_DATA_LOSS on a copy of the database and attaching it to the farm to gauge the damage to the DB.
After trialling an attempt to attach it to a different web application and generate a new ID for it I hit the fabled 0 site collection issue and looking at various ways to overcome that involve manipulating the GUID for the root of the site collection, inside the SharePoint Config DB.. this is all fine when it comes to a test enviornment but I don't have that luxury.
One option might be to to a remove content db operation for the database with the corruption and add the repaired content db to this web application. However I'm not really willing to take the risk as I have not undertaken this operation before so at the very least will look to emulate the scenario. The idea is that the web application will see the content DB with the same GUID for the root path and identify the site collection(s) that exist.
This is a SharePoint 2010 farm SP1 - August 2011 CU applied.