Creating databases and users on SQL Server
This topic describes how to set up product-related databases and users for the Microsoft SQL Server database.
You can create databases and users by using one of the following methods:
- Before starting configuration of the product by using the create_tssadw_sqlserver_users.sql script, which is located in the TSSA-DW<version>-external-files.zip: You can download external files from the BMC Electronic Product Distribution (EPD) website.
- During configuration by using the create_tssadw_sqlserver_users.sql script, which you can download by clicking the Download the scripts to create users/database/schema link in the post-installation configuration wizard.
SQL Server databases and users
By default, the create_tssadw_sqlserver_users.sql script creates the databases shown in the following table. You can also use different database names from those used in the table examples by modifying the script. Make a note of the database names for reference during the TrueSight Server Automation - Data Warehouse configuration.
SQL Server databases
Database name | Purpose |
---|---|
TSSADW_DW_DB | To store the reports data warehouse tables |
TSSADW_ETL_MASTER_DB | To store the extract, transform, and load (ETL) tool repository |
TSSADW_ETL_WORK_DB | To store the ETL tool repository |
The following settings are recommended:
- Set the database recovery model to Simple.
- Set the server-level setting of Maximum Server Memory to 80% of the physical memory on the server. For example, if the server has 6 GB of memory, set Maximum Server Memory to 4.7 GB.
By default, the create_tssadw_sqlserver_users.sql script creates the users shown in the following table. You can use different logon names from those used in the following table by modifying the script. Make a note of the usernames and passwords for reference during the TrueSight Server Automation - Data Warehouse configuration.
SQL Server users
User | Responsibilities |
---|---|
TSSADW_DW |
|
TSSADW_ETL_MASTER |
|
TSSADW_ETL_WORK |
|
To create databases and users
- Before you start creating databases and users, ensure that the prerequisites are met.
- On the reports data warehouse computer, navigate to the directory in which script is located.
- Log in to the SQL Server Management Studio.
- Locate the create_tssadw_sqlserver_users.sql script and open it.
- Edit the script as follows:
- If you do not want to create databases with the default names, replace the following default database names with the desired names (for example, TSSADW_DW_DATABASE and TSSADW_PR_DATABASE).
- $TSSADW_DW_DB
- $TSSADW_ETL_WORK_DB
$TSSADW_ETL_MASTER_DB
For each database, change the value of the FILENAME parameter for the .mdf and .ldf files.
The following example shows the FILENAME parameter with a sample path for the .mdf and .ldf files of the warehouse database, TSSADW_DW_DB on Windows.
CREATE DATABASE [TSSADW_DW_DB] ON PRIMARY (NAME = N'TSSADW_DW_DB', FILENAME = N'C:\Program Files\MYSQL\TSSA-DW\MSSQL\DATA\\TSSADW_DW_DB.mdf', SIZE = 10MB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB)LOG ON (NAME = N'TSSADW_DW_DB_log', FILENAME = N'C:\Program Files\MYSQL\TSSA-DW\MSSQL\DATA\\TSSADW_DW_DB_log.ldf', SIZE = 1024KB, MAXSIZE = 2048GB, FILEGROWTH = 10%)- If you do not want to create users with the default names, replace the following default user names with the desired names (for example, TSSADW_DW_USER and TSSADW_PR_USER) for each user :
- $TSSADW_DW
- $TSSADW_ETL_WORK
$TSSADW_ETL_MASTER
For each user, modify the PASSWORD parameter as required.
The following example shows the LOGIN and PASSWORD parameters with sample values for the TSSADW_DW_USER user.
CREATE LOGIN [TSSADW_DW_USER] WITH PASSWORD='password', DEFAULT_DATABASE=[TSSADW_DW_DB], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
EXEC sys.sp_addsrvrolemember @loginame = N'TSSADW_DW', @rolename = N'dbcreator'
GO
EXEC sys.sp_addsrvrolemember @loginame = N'TSSADW_DW', @rolename = N’sysadmin'- Match the SQL Server collation sequence for the TrueSight Server Automation database with the collation sequence for the reports data warehouse as follows:
- Search for COLLATE SQL_Latin1_General_CP1_CI_AS and remove comments ( -- characters) from this line.
- Replace SQL_Latin1_General_CP1_CI_AS with the collation sequence for the TrueSight Server Automation database.
- Ensure that adequate size is assigned to the .mdf and .ldf files. To know the size requirements, use the Sizing tools, depending on your environment.
- If you do not want to create databases with the default names, replace the following default database names with the desired names (for example, TSSADW_DW_DATABASE and TSSADW_PR_DATABASE).
- Open New Query.
- Copy the contents of the script file and paste the contents into the query window.
- Run the script.
After creating all databases, run the following commands, replacing the names of the database as needed to match your environment
ALTER DATABASE TSSADW_DW_DB SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE TSSADW_DW_DB SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE TSSADW_ETL_WORK_DB SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE TSSADW_ETL_WORK_DB SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE TSSADW_ETL_MASTER_DB SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE TSSADW_ETL_MASTER_DB SET READ_COMMITTED_SNAPSHOT ON;