Running SQL Scripts for Microsoft Databases

StarTeam Server comes with some SQL scripts written specifically for use with your database. These scripts help you maintain and tune StarTeam Server databases. You run some SQL scripts after installation, some on a weekly basis for database performance maintenance, and some scripts are run for you automatically by StarTeam Server.

The SQL scripts for Microsoft SQL Server and Microsoft SQL Server Express databases that you may run are located in the Micro Focus\Hub\DBScripts\Sqlserver_Scripts folder.

Note: The Sqlserver_Scripts folder contains several subfolders: Create_Stored_Procedures, Drop_Stored_Procedures, Install, Preinstall, Generic, and DW (for Data Warehouse). The scripts in these subfolders are run by StarTeam Server as needed. Never execute any of them directly from an external database user interface, such as SQL Query Editor.

The following table lists the SQL scripts that you are most likely to need. Some should be run manually on a regular basis. The table recommends the frequency for running these scripts. You may adjust the frequency depending on the StarTeam Server usage at your facility. Run scripts at times when the server is least used, such as overnight or on weekends.

In addition to running these scripts, you should also run a Purge option from the Server Administration tool to remove deleted views from the database. We recommend purging the database after you have deleted one or more views from a project. See the Server Administration Tool Help for information on the Purge option.

StarTeam Server Script Name Run Frequency
starteam_sqlserver_dbcc.sql Weekly
starteam_sqlserver_dbcc_reindex.sql Twice a week (minimum)
starteam_sqlserver_dbcc_showcontig.sql Twice a week (minimum)
starteam_sqlserver_dropall.sql Only if necessary
CAUTION:
  • Before running any of the StarTeam Server SQL scripts for a Microsoft SQL Server or Microsoft SQL Server Express database, ensure that the database compatibility mode is set correctly. For Microsoft SQL Server 2008-based configurations, set the database compatibility mode to 90.
  • Be sure to backup your StarTeam Server database, as necessary, and verify these backups periodically. You should restore and test backups of your StarTeam Server project data on a test system. Restoring and testing your backups helps to ensure that your data is being backed up correctly.

To run a script for a Microsoft SQL Server or Microsoft SQL Server Express database:

  1. Install SQL Server Management Studio or SQL Server Management Studio Express from Microsoft. Enter the result of your step here (optional).
  2. Click Start > Microsoft SQL Server [or Microsoft SQL Server Express] > SQL Server Manager Studio [or SQL Server Manager Studio Express].
  3. Design a new query or open an existing one in SQL Server Manager Studio.
  4. Click Query > Connection > Connect to connect to the server that contains the database you want to access.
  5. Select the appropriate StarTeam Server database.
  6. Open the tuning script, by choosing File > Open > foldername\scriptname.
  7. Execute the script, by clicking the Execute button on the toolbar or by pressing F5.