Setting up an Oracle database for BMC Server Automation
This topic provides instructions for setting up an Oracle database for a fresh installation of the BMC Server Automation database.
This topic includes the following sections:
- Requirements and recommendations
- To configure the Oracle database
- To configure BMC Server Automation databases for a non-English locale
- To create an Oracle database user and database tablespaces
- To manually populate the Oracle database schema (not required if you using the unified product installer)
- To optimize an Oracle database for BMC Server Automation
- Where to go from here
Requirements and recommendations
- If you decide not to use the provided scripts to create the schema, refer to them to determine the privileges required. BMC does not recommend, nor does it support database schema changes.
- Use only Latin alphabet letters, numbers, and underscores (_) in the 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.
- For a list of steps you can take to optimize the database, see To optimize an Oracle database for BMC Server Automation.
To configure the Oracle database
To configure the Oracle database for BMC Server Automation, do the following:
- Edit the init.ora file to set the following initialization parameters:
- db_block_size must be set to 8192
- Processes must be set to at least 200
Ideally, the number of processes should be 30 to 40 greater than the total number of job-related and nonjob-related database connections configured for all Application Servers in your environment.
If you are running BMC BladeLogic Decision Support for Server Automation, the number of processes should ideally be 20 to 30 higher than the total number of job-related and nonjob-related database connections.
For more information about configuring Application Servers, see Configuring-the-Application-Server.
All other configuration parameters can be set at the discretion of the database administrator.
- If the database is configured for the UTF8 or AL32UTF8 character set (NLS_CHARACTERSET parameter) in a LATIN-1 locale, and the CHAR schema is used as an underlying persistent schema, set the NLS_LENGTH_SEMANTICS parameter of the database to CHAR to prevent column field overflow. Set this parameter before you run the master schema script to set up the database schema.
- Ensure that all synonyms are public.
To configure BMC Server Automation databases for a non-English locale
To use BMC Server Automation in a locale other than English, follow these guidelines:
- Configure your BMC Server Automation databases using the settings recommended by your database vendor for that language.
(Oracle only) If the database is configured for the UTF8 or AL32UTF8 character set (NLS_CHARACTERSET parameter) in a LATIN-1 locale and the CHAR schema is used as an underlying persistent schema, set the NLS_LENGTH_SEMANTICS parameter of the database to CHAR to prevent column field overflow. Set this parameter before you run the master schema script to set up the database schema. - (Oracle or SQL) If the database is configured for a multibyte locale or a non-LATIN-1 locale, when you set up the database schema, run the master script that corresponds to the nchar character set.
- If you are using SQL Server, specify the appropriate collating sequence as described in Setting up an SQL Server database schema for BMC Server Automation.
To create an Oracle database user and database tablespaces
A database administrator must manually create a database user and database tablespaces, before installing BMC Server Automation (even if you are installing using the unified product installer).
The create_oracle_instance.sql creates the database user (typically BLADELOGIC). In addition to creating the database user, this script creates the BLADELOGIC and BLADELOGIC_INDEX tablespaces and grants privileges to the database user.
Perform the following steps to set up the Oracle database:
- Create the directory to be used for the tablespace for the new schema.
BMC recommends creating a directory on a disk separate from the Oracle system tables located at .../oradata/<SID>. - Copy installation scripts from the db_scripts directory into the directory that you created for the tablespace. For details on the db_scripts directory, see Downloading-the-installation-files. The relevant scripts appear in the /db_scripts/oracle/ and /db_scripts/oracle/schema directories.
- Change (cd) to /db_scripts/oracle/schema.
(Optional) If required by your company policy, you can modify the create_oracle_instance.sql script to revoke the RESOURCE and UNLIMITED TABLE SPACE privileges, and replace them with more granular privileges.
- EXECUTE ON DBMS_LOCK (required for carrying out a handshake between BMC Server Automation database and the BMC BladeLogic Decision Support for Server Automation ETL during database clean up.)
- CONNECT
- CREATE VIEW
- RESOURCE
- SELECT ANY DICTIONARY
- UNLIMITED TABLESPACE
Modify the create_oracle_instance.sql script and change the path for data files to match the directory you created for the tablespace for the new schema.
Note: Be sure to change both the CREATE TABLESPACE and ALTER DATABASE commands. You must change the path in four places.
Start SQL*Plus using a user name that has sysdba privileges. For example, you might enter the following commands:
sqlplus /nolog
SQL> connect sys/manager as sysdbaRun the create_oracle_instance.sql script by using the following commands:
SQL> @create_oracle_instance.sql
SQL> exit
To manually populate the Oracle database schema (not required if you using the unified product installer)
The following steps describe how to manually complete the Oracle database schema by populating it with the required database objects.
- Change (cd) to /db_scripts/oracle.
Log on to the BMC Server Automation database by using the following command: sqlplus <bl_user>/<bl_pwd>@<bl_tns_entry>Replace the variables with the following values:
Variable
Value
<bl_user>
Logon name of the BMC Server Automation database user that you created inTo set up an Oracle database user
<bl_pwd>
BMC Server Automation database user password. Do not specify a password that begins with an equal sign (=).
<bl_tns_entry>
tns entry for the BMC BladeLogic database instance
Start a log and run the master script that corresponds to the character sets for which your database is configured.
SQL> spool create_bladelogic_schema.log
SQL> start <master_script.sql> <BL_DATA> <BL_INDEX>
SQL> spool offReplace the variables with the following values:
Variable
Value
<master_script.sql>
oracle_master.sql if your database is configured for char/varchar character sets or oracle_nchar_master.sql if your database is configured for nchar/nvarchar character sets
<BL_DATA>
BMC Server Automation data tablespace name. This name must match the data tablespace name in the create_oracle_instance.sql script (by default, BLADELOGIC).
<BL_INDEX>
BMC Server Automation index tablespace name. This name must match the index tablespace name in the create_oracle_instance.sql script (by default, BLADELOGIC_INDEX).
- After executing the master script, check the create_bladelogic_schema.log file for errors.
BMC does not recommend, nor does it support database schema changes.
To optimize an Oracle database for BMC Server Automation
BMC provides the following recommendations to optimize the performance of an Oracle database serving BMC Server Automation:
- Recommendations for gathering statistics
- Recommendations for configuring the database
- Recommendations for physical implementation
Recommendations for gathering statistics
As with other products which use an Oracle database, some performance problems in a BMC Server Automation environment can be caused by stale Oracle 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 reports data warehouse and the core BMC Server Automation database and then clear the query caches after each data warehouse load.
To facilitate the running of the statistics gathering command, BMC Server Automation has a stored procedure. After the stored procedure is created in the BMC Server Automation schema, you can easily execute the procedure to gather statistics on a regular basis. BMC recommends that you gather statistics one time per week. Running the procedure more frequently than one time per week does not yield any additional performance improvement.
The statistics gathering procedure supplied by BMC Server Automation:
- Collects Oracle optimizer statistics on the tables and indexes for the BMC Server Automation database at regular intervals.
- Generates a PL/SQL script to collect statistics, which can be reviewed and modified (if necessary) before execution.
|
|
---|---|
Location of the BMC Server Automation statistics gathering package | The statistics gathering stored procedures are located in the ..\db_scripts\oracle\utility\gather_schema_stats folder, which is created when you extract BBSA<version>-<platform>.zip. For information about this file, see Downloading-the-installation-files.
Note: Before you run the script, ensure that you have met the following prerequisites:
|
Gathering statistics at the time of invocation | To gather statistics immediately, perform any of the following:
The following list describes the stored procedure input parameters.
|
Generating a script to gather statistics at later time | Instead of gathering statistics when you invoke the stored procedure, you might want to generate a PL/SQL script that can be reviewed, edited and executed at later time.
|
Running gather statistics from the blcli | To run the gather statistics procedures from the BLCLI (for example, from a scheduled NSHScript Job), you can use the BLCLI command DBManager - blGatherSchemaStats command. |
Verifying that statistics are current | You can run a database diagnostic to see if the DBMS_STATS on the Oracle schema are stale based on a parameter that you specify. If the previous run of DBMS_STATS is older than the time frame you specified, you are prompted to run the BL_GATHER_SCHEMA_STATS stored procedure to update the statistics. You can also instruct the diagnostic to perform autoremediation by automatically invoking the stored procedure. dbdiagnostics runDiag diagId=1000006 STATSExpiresDays=7 STATSRemediateFlg=Y
To view the results of the diagnostic, run the dbdiagnostics command with the getResLastExec parameter, which displays the results of the last execution for this diagnostic. dbdiagnostics getResLastExec diagId=10000006 For a description of all available database diagnostics, see Monitoring-and-diagnosing-issues-in-the-BMC-Server-Automation-environment. |
Recommendations for configuring the database
The following recommendations are for a 10 GB database. Scale the configuration recommendations up or down based on the relative size of your database.
Configuration parameter | Recommended value |
---|---|
db_cache_size | 1 GB |
log_buffer | 512 KB |
pga_aggregate_target | 360 MB |
undo tablespace size | 2 GB |
Recommendations for physical implementation
To avoid disk contention and increase input-output throughput when accessing data, store the physical data and index data files in different tablespaces (that is, across multiple disks).
Where to go from here