Pedro Lopes 9 năm trước cách đây
mục cha
commit
6d6c4c6d68

+ 2 - 1
AdaptiveIndexDefrag/CHANGELOG.txt

@@ -108,4 +108,5 @@ v1.6.3.2 - 11/4/2016 - Fixed DISABLE index applying to NCCI.
 			Fixed statistics not being updated before index rebuild - introduced in v1.6.2;
 			Fixed misplaced index disable statement if @Exec_Print = 0;
 			Fixed issue with statistics collection in SQL Server 2012 and below;
-			Added statistic related info to log table (rows, mod counter, rows sampled).
+			Added statistic related info to log table (rows, mod counter, rows sampled).
+v1.6.3.3 - 11/7/2016 - Rolled back previously reported issue with REORGANIZE and database names.

+ 2 - 1
AdaptiveIndexDefrag/usp_AdaptiveIndexDefrag.sql

@@ -590,6 +590,7 @@ v1.6.3.2 - 11/4/2016 - Fixed DISABLE index applying to NCCI.
 						Fixed misplaced index disable statement if @Exec_Print = 0;
 						Fixed issue with statistics collection in SQL Server 2012 and below;
 						Added statistic related info to log table (rows, mod counter, rows sampled).
+v1.6.3.3 - 11/7/2016 - Rolled back previously reported issue with REORGANIZE and database names.
 					
 IMPORTANT:
 Execute in the database context of where you created the log and working tables.			
@@ -1102,7 +1103,7 @@ BEGIN SET @hasIXsOUT = 1 END ELSE BEGIN SET @hasIXsOUT = 0 END'
 				, @rows_sampled bigint
 
 		/* Initialize variables */	
-		SELECT @startDateTime = GETDATE(), @endDateTime = DATEADD(minute, @timeLimit, GETDATE()), @operationFlag = NULL, @ver = '1.6.3.2';
+		SELECT @startDateTime = GETDATE(), @endDateTime = DATEADD(minute, @timeLimit, GETDATE()), @operationFlag = NULL, @ver = '1.6.3.3';
 	
 		/* Create temporary tables */	
 		IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblIndexDefragDatabaseList'))

+ 3 - 2
MaintenanceSolution/2_usp_AdaptiveIndexDefrag.sql

@@ -590,6 +590,7 @@ v1.6.3.2 - 11/4/2016 - Fixed DISABLE index applying to NCCI.
 						Fixed misplaced index disable statement if @Exec_Print = 0;
 						Fixed issue with statistics collection in SQL Server 2012 and below;
 						Added statistic related info to log table (rows, mod counter, rows sampled).
+v1.6.3.3 - 11/7/2016 - Rolled back previously reported issue with REORGANIZE and database names.
 					
 IMPORTANT:
 Execute in the database context of where you created the log and working tables.			
@@ -1102,7 +1103,7 @@ BEGIN SET @hasIXsOUT = 1 END ELSE BEGIN SET @hasIXsOUT = 0 END'
 				, @rows_sampled bigint
 
 		/* Initialize variables */	
-		SELECT @startDateTime = GETDATE(), @endDateTime = DATEADD(minute, @timeLimit, GETDATE()), @operationFlag = NULL, @ver = '1.6.3.2';
+		SELECT @startDateTime = GETDATE(), @endDateTime = DATEADD(minute, @timeLimit, GETDATE()), @operationFlag = NULL, @ver = '1.6.3.3';
 	
 		/* Create temporary tables */	
 		IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblIndexDefragDatabaseList'))
@@ -1791,7 +1792,7 @@ WHERE system_type_id IN (34, 35, 99) ' + CASE WHEN @sqlmajorver < 11 THEN 'OR ma
 				SET @operationFlag = 0	
 
 				/* Set Reorg command */
-				SET @sqlcommand = N'ALTER INDEX ' + @indexName + N' ON [' + @dbName + N'].' + @schemaName + N'.' + @objectName + N' REORGANIZE';
+				SET @sqlcommand = N'ALTER INDEX ' + @indexName + N' ON ' + @dbName + N'.' + @schemaName + N'.' + @objectName + N' REORGANIZE';
 
 				/* Set partition reorg options; requires Enterprise Edition; valid only if more than one partition exists */		
 				IF @partitionCount > 1 AND @dealMaxPartition IS NOT NULL AND @editionCheck = 1