Updated: 2007-09-13
Detects and removes orphaned items from content databases in Windows SharePoint Services. In some situations, a content database that is used by Windows SharePoint Services may become corrupted. The corrupted database may contain orphaned items. For example, a document may not have a parent document library or a list may not have a parent Windows SharePoint Services Web site. The databaserepair operation can detect and repair database corruption for only the following types of orphaned items in a content database:
A Windows SharePoint Services Web site that does not have a parent Windows SharePoint Services Web site
A subweb that does not have a parent Windows SharePoint Services Web site
A list that does not have a parent Windows SharePoint Services Web site
A document that does not have a parent document library
A list item that does not have a parent list
A Web page that does not have a parent Windows SharePoint Services Web site
This operation will not repair any other type of database corruption.
stsadm -o databaserepair
-url <url name>
-databasename <database name>
[-deletecorruption]
url
A valid URL, such as http://server_name
Yes
The URL name of the Web application that is being repaired.
databasename (dn)
A valid database name, such as "DB1"
The name of the content database that is to be repaired.
deletecorruption
<none>
No
Removes corruption from a content database.
To detect orphaned items, use the following syntax:
stsadm -o databaserepair -url http://<URL_of_WindowsSharePointServices_Site> -databasename <name of database that contains the orphan item>
To delete orphaned items, use the following syntax:
stsadm -o databaserepair -url http://<URL_of_WindowsSharePointServices_Site> -databasename <name of database that contains the orphan item that is to be deleted> -deletecorruption
%CommonProgramFiles%\microsoft shared\web server extensions\12\bin\stsadm.exe(c:\Program Files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe)