Running the 'ComputeFragmentation' stored procedure

book

Article ID: 100013899

calendar_today

Updated On:

Description

Notes

Resolution

Use the following command in the SQL query window to run the fragmentation computation stored procedure:
USE [EnterpriseVaultDirectory]
GO
 
DECLARE @IndexScanMode AS NVARCHAR(20)
DECLARE @PageCountFilter AS smallint
 
SELECT @PageCountFilter = settingValueNumeric
FROM [dbo].[ExtendedSetting]
WHERE [settingTypeId] = 9801
 
SELECT @IndexScanMode = [settingValueText]
FROM [dbo].[ExtendedSetting]
WHERE [settingTypeId] = 9802
 
USE
 
EXEC       [dbo].[ComputeFragmentation]
                @ConfigurationScanMode = @IndexScanMode,
                @PageCount = @PageCountFilter,
                @ComputerName = NULL,
                @RunNow = 1
GO
where,
is the name of the Directory, Vault Store or Fingerprint database of which fragmentation computation to be done
 
Examples:
o    To compute fragmentation of ‘EnterpriseVaultDirectory’ database:
 
USE [EnterpriseVaultDirectory]
GO
 
DECLARE @IndexScanMode AS NVARCHAR(20)
DECLARE @PageCountFilter AS smallint
 
SELECT @PageCountFilter = settingValueNumeric
FROM [dbo].[ExtendedSetting]
WHERE [settingTypeId] = 9801
 
SELECT @IndexScanMode = [settingValueText]
FROM [dbo].[ExtendedSetting]
WHERE [settingTypeId] = 9802
 
EXEC               [dbo].[ComputeFragmentation]
        @ConfigurationScanMode = @IndexScanMode,
        @PageCount = @PageCountFilter,
        @ComputerName = NULL,
        @RunNow = 1
GO
 
 
o    To compute fragmentation of Vault Store database named ‘EVVSExpressVaultStore_1’:
 
USE [EnterpriseVaultDirectory]
GO
 
DECLARE @IndexScanMode AS NVARCHAR(20)
DECLARE @PageCountFilter AS smallint
 
SELECT @PageCountFilter = settingValueNumeric
FROM [dbo].[ExtendedSetting]
WHERE [settingTypeId] = 9801
 
SELECT @IndexScanMode = [settingValueText]
FROM [dbo].[ExtendedSetting]
WHERE [settingTypeId] = 9802
 
USE [EVVSExpressVaultStore_1]
 
EXEC               [dbo].[ComputeFragmentation]
        @ConfigurationScanMode = @IndexScanMode,
        @PageCount = @PageCountFilter,
        @ComputerName = NULL,
        @RunNow = 1
GO

 

Issue/Introduction

Enterprise Vault database fragmentation computation runs according to a schedule that is set by an Enterprise Vault administrator. You can run the fragmentation computation manually if you wish. Since this stored procedure execution may take time and consume SQL Server resources, it is recommended that you do not run it in core working hours, such as during the Enterprise Vault archive window, periodical database backup and maintenance window, or any other activity that is critical. This stored procedure is present in the Directory, Vault Store, and Fingerprint databases.