I have an orphaned entry of a SharePoint content database pointer in the Configuration database. When I try to add a content database with the same name, I get the following error message:
Through Central Administration, mount an existing content database:
The attach operation cannot continue because another object
in this farm already contains the same ID. Each object in a
farm must have a unique ID. In order to proceed with the attach
operation you must assign a new ID to this database. To attach
this database with a new ID, use the Mount-SPContentDatabase
command with the -AssignNewDatabaseId parameter. Note that if
this new database and an existing database contain the same
site collections, attaching this database will likely result
in orphaned site collections due to conflicts between the
two databases. Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: GUIDHERE
Date and Time: 12/20/2010 2:24:36 PM
From powershell, mount an existing content database to the farm. Mount-SPContentDatabase "MyContentDatabase" -WebApplication http://mywebapplication -ClearChangeLog -AssignNewDatabaseId
Mount-SPContentDatabase : A SharePoint database named MyContentDatabase already exists. Y
ou must supply another name for the new database. At line:1 char:24 + Mount-SPContentDatabase <<<< "MyContentDatabase" -WebApplication http://mywebapplication
-ClearChangeLog -AssignNewDatabaseId + CategoryInfo : InvalidData: (Microsoft.Share...ContentDatabase: SPCmdletMountContentDatabase) [Mount-SPContentDatabase], SPDuplicateObject Exception+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMountContentDatabase
Tried dismounting the database through powershell. Dismount-SPContentDatabase "MyContentDatabase"
Dismount-SPContentDatabase : The content database could not be found. At line:1 char:27+ Dismount-SPContentDatabase <<<< "MyContentDatabase"+ CategoryInfo : InvalidData: (Microsoft.Share...ContentDatabase: SPCmdletDismountContentDatabase) [Dismount-SPContentDatabase], SPException+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletDismount ContentDatabase
Tried clearing orphans through stsadm command. stsadm -o databaserepair -url "http://mywebapplication" -databasename "MyContentDatabase"
Value does not fall within the expected range.
Verified there is an orphaned entry in the config database. Running this SQL query yields a returned record:
SELECT * FROM Objects WITH (nolock) WHEREName ='MyContentDatabase'
How do I resolve this issue in a MS-supported manner?
Frederick Lin, http://fredericklin.com









