Syntax
DBCC CHECKALLOC [ ( 'database' | database_id | 0
[ , NOINDEX | , { REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD } ]
[WITH
{ [ ALL_ERRORMSGS ]
[ , NO_INFOMSGS ]
[ , TABLOCK ]
[ , ESTIMATEONLY ]
}
]
]
Key:
REPAIR_FAST | REPAIR_REBUILD | NOINDEX - deprecated options
REPAIR_ALLOW_DATA_LOSS - Use only as a last resort
- back up the database before you run this option.
To find the repair level to use run DBCC CHECKDB without a repair option. The best and easiest way to repair errors is to restore from a backup.
Examples
-- Check disk space allocation for the current database.
DBCC CHECKALLOC;
GO
"Millions of individuals making their own decisions in the market-place will always allocate resources better than any centralized government planning process" ~ Ronald W. Reagan
Related
DBCC CHECKDB - Check allocation, and integrity of all objects.
Equivalent Oracle commands:
ALTER TABLE MODIFY CONSTRAINT VALIDATE
DBMS_REPAIR