Created
October 27, 2024 20:22
-
-
Save EitanBlumin/1115d31ced67462fafc1317416b6cf72 to your computer and use it in GitHub Desktop.
DatabaseIntegrityCheck - Allocation and Catalog Checks Only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @MaxEndTime datetime = DATEADD(HOUR, 2, GETDATE()) | |
DECLARE @TimeLimitSeconds int; | |
SET @TimeLimitSeconds = DATEDIFF(second, GETDATE(), @MaxEndTime) | |
EXEC dbo.DatabaseIntegrityCheck | |
@Databases = 'ALL_DATABASES', | |
@DatabaseOrder = 'DATABASE_LAST_GOOD_CHECK_ASC', | |
@CheckCommands = 'CHECKALLOC,CHECKCATALOG', | |
--@PhysicalOnly = 'Y', | |
@TimeLimit = @TimeLimitSeconds, | |
@LogToTable= 'Y', | |
@Execute = 'Y' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment