My database is running really slowly. What maintenance can I perform to keep Archive Manager going as quickly as possible?
Rebuilding the indexes of the database can provide a lot of performance improvements with Archive Manager. The following SQL script will rebuild the indexes. If you are not comfortable running SQL scripts, please contact your reseller for Archive Manager.
DECLARE @TableName sysname
DECLARE @IndexID int
DECLARE @Command varchar(1000)
DECLARE @IndexName varchar(100)
DECLARE TableCursor CURSOR FOR
SELECT name FROM sysobjects WHERE type = 'U'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0 BEGIN
SET @Command = 'DBCC DBREINDEX (' + @TableName + ', '''')'
PRINT @Command
DBCC DBREINDEX (@TableName, '')
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor