Setting up a SQL Server database, user, and schema for BMC Server Automation
This topic provides instructions for setting up a Microsoft SQL Server database, user, and schema for the fresh installation of the BMC Server Automation database. For a list of supported SQL Server database platforms, see Minimum-software-requirements.
To set up a SQL Server database, user, and schema (video)
The following video provides a quick demonstration of the process of setting up a SQL Server database, user, and schema.
To set up a SQL Server database, user, and schema
- Copy install scripts from external-files.zip to a location that you can access from the SQL Server console. For information on external-files.zip, see Obtaining-the-installation-files.
If you extract the entire contents of external-files.zip, the relevant scripts appear in the /db_scripts/sqlserver directory. - Start SQL Server Management Studio.
- Expand the database server.
- Right-click the Databases folder and choose New Database.
Provide a name for the database, such as bladelogic.
- Create a user account for the database and make this user the owner of all objects in the database.
Use SQL Server Authentication and create a password for the user you created in the previous step.
- Set the default database to the database you created in step 4 and step 5.
- Set the default language for the database.
- Set the collation as case-insensitive for the default language.
If you are setting up BMC Server Automation to support a language other than English, for Collation name, select the collation for your language that is case-insensitive, accent-sensitive, and (where appropriate) kana-sensitive. For example, if you are setting up BMC Server Automation for French, use French_Cl_AS. If you are setting up BMC Server Automation for Japanese, use Japanese_Cl_AS_KS.
The new database appears under the Databases folder. You can set other options at this time too, but they are not required. - To reduce the likelihood of database deadlocks, perform the following steps:
- Right-click the database server node and select New Query.
- Execute the following query:
ALTER DATABASE <db_name> SET ALLOW_SNAPSHOT_ISOLATION ON; - Execute the following additional query:
ALTER DATABASE <db_name> SET READ_COMMITTED_SNAPSHOT ON;
- Exit SQL Server Management Studio.
- Open a command prompt window.
- Change (cd) to /db_scripts/sqlserver.
Run the master script that corresponds to the character sets for which your database is configured, using the following syntax:
<master_script.bat> <db_server> <db_name> <bl_user> <bl_pwd>
Replace the variables with the following values:<master_script.bat>
sqlserver_master.bat if your database is configured for char/varchar character sets or sqlserver_nchar_master.bat if your database is configured for nchar/nvarchar character sets
<db_server>
Name of the database server.
If the server uses a nonstandard port, the server name and port number must be enclosed in quotation marks, as shown in the following example: "QLDS0002,1381"
To use a named server instance, append the named instance, including the complete path, as shown in this example:
sqlserver_master.bat <db_server>\<instance_name> <db_name> <db_user> <db_password><db_name>
<bl_user>
Logon name for the BMC Server Automation database user
<bl_pwd>
BMC Server Automation database user password
Database maintenance: Recommendation for gathering statistics
As with other products which use Microsoft SQL database, some performance problems in a BMC Server Automation environment can be caused by stale SQL statistics on the BMC Server Automation schema, due to changing data volumes or changes in column values. BMC strongly recommends that you gather statistics for the core BMC Server Automation database one time per week.
Use the EXEC sp_updatestats command to run the SQL server built-in procedure against all tables in the schema, to gather statistics and optimize the database. For more information on gathering statistics, see Microsoft documentation.