Running the 'ComputeFragmentation' stored procedure

Article: 100013899
Last Published: 2020-02-05
Ratings: 1 0
Product(s): Enterprise Vault

Problem

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.

Solution

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 <DatabaseName>
 
EXEC       [dbo].[ComputeFragmentation]
                @ConfigurationScanMode = @IndexScanMode,
                @PageCount = @PageCountFilter,
                @ComputerName = NULL,
                @RunNow = 1
GO
where,
<DatabaseName> 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

 

Was this content helpful?