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.
- These tasks should be performed by a database administrator (DBA). Perform the steps in these tasks in the exact order in which they are described. If you are not using the following scripts to create the schema, refer to them to determine the privileges required.
BMC does not recommend, nor does it support database schema changes.
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.
- Use only Latin alphabet letters, numbers, and underscores (_) in database names. Do not begin database names with a number. Do not use hyphens (-). While database names with hyphens work in the BMC Server Automation system, they do not work in BMC BladeLogic Decision Support for Server Automation.
- SQL Server database names are case-sensitive. You must use the same case when specifying the JDBC connections, or the load process for the BMC BladeLogic Decision Support for Server Automation data warehouse will fail.
- 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.
Do not specify BMC Server Automation database password that begins with an equal sign (=).
- 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:
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
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:
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>
Logon name for the BMC Server Automation database user
BMC Server Automation database user password
When the master script runs, the following warnings might appear:
Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'rsave_cond_result_subtree'. The stored procedure will still be created. Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'rsave_cr_group_result_subtree'. The stored procedure will still be created.
These warnings are expected and can be ignored.
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.
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.
Gathering statistics is a resource-intensive task and you may experience a fall in database performance while executing this task.