Add a SQL Server Rebuild Index Job
Previous  Top  Next



Periodically, it is advantageous for the database indexes to be rebuilt. Follow these steps to create a job in SQL Server that will automatically perform this operation.

For SQL Server 2000

1.   Open the Enterprise Manager and connect to the SQL Server that houses the RMS database.
2.   Expand the Management folder and right click on the SQL Server Agent icon and click New Job.
3.   On the General tab, type in the Name of the job.
4.   Select the Steps tab and click the New button.
5.   Enter a name for the step in the Step name text box; the Type is Transact-SQL script (T-SQL); select the RMS database in the Database text box; paste the following command into the Command text box:
 
EXEC procRebuildIndexes  

6.Click OK.  
7.Select the Schedules tab and click New Schedule.  
8.Type in a name for the schedule; the Schedule type is Recurring; make sure the Enabled check box is checked; click the Change button, select Occurs to be Monthly and select what day of the month to run it; under Daily frequency select Occurs once at and select the time you wish the backup to occur (it is recommended to choose a time when few users are connected to the database and before the network tape backup occurs); under Duration, select a date within the next month as the Start date and select No end date; click OK.  
9.You may wish to add a Notification telling you via email when the job fails and/or completes. Do this on the Notification tab.