Database configuration


All systems where you have installed BMC AMI Ops Console Management require a configuration database to store the configuration data.  BMC AMI Ops Console Management is delivered with an Apache Derby database manager, which stores all the configuration data. 

Other database systems such as Oracle and PostgreSQL may also be configured for use with the product. 

Warning

Important

Each computer where you have BMC AMI Ops Console Management installed requires its database. Databases cannot be shared between installations.

Related topics

General database configuration

The database configuration is defined in the file $AMICM_HOME/iocinst/config/datasource.properties. If this file is not present, the built-in Apache Derby database is used.

Perform the following steps to configure an alternate database:

  1. Copy $AMICM_HOME/iocinst/apps/db-derby/datasource.properties.template to $AMICM_HOME/iocinst/config/datasource.properties.
  2. Edit the datasource.properties configuration file to match the connection information for your database.
  3. Use the amicm_validate_db tool to validate the connection
  4. Reboot the system to restart all of the product daemons. 

The template version of the configuration file has commented out sections for various databases. 

Property name

Description

Sample value

javax.persistence.jdbc.driver

The Java class of the JDBC driver

oracle.jdbc.OracleDriver

javax.persistence.jdbc.url

This is the connection URL for your database. The format of the URL varies according to the given JDBC

jdbc:oracle:thin:@hostname.domain.com:1521:db_instance_name

javax.persistence.jdbc.user

The username provided to the database for authentication

jack

javax.persistence.jdbc.password

The password provided to the database for authentication

tiger

javax.persistence.jdbc.epassword

The password (encrypted) provided to the database for authentication. Use the mvcm_encrypt_text.sh tool to encrypt the password.

<$:dec10.51>n/Sc0vIZnUxxyzlT57QK0kW1RDssO

hibernate.dialect

The class name of the Hibernate Dialect implementation. The actual code is provided with the product.

org.hibernate.dialect.Oracle12cDialect

You can enter either the password or the encrypted password. 

Using Oracle

The Oracle database system may be used to store configuration data. To enable Oracle, follow the steps above to copy the datasource.properties.template file to $AMICM_HOME/iocinst/config/datasource.properties and remove the commenting symbols # from the beginning of the following lines: 

javax.persistence.jdbc.url=jdbc:oracle:thin:@hostname.domain.com:1521:db_instance_name
javax.persistence.jdbc.user=bmcuser
javax.persistence.jdbc.epassword=<$:dec10.51>n/Sc0vIZnUxxyzlT57QK0kW1RDssO
javax.persistence.jdbc.driver=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle12cDialect

You must modify URL, user, and password for your site. Your database administrator can provide these values. The minimum supported version is Oracle 12.

Use PostgreSQL

PostgreSQL is a popular open source database available on many Linux systems. To configure the product to be used with PostgreQL, copy the datasource.properties file and remove the comment symbols before the following lines:

javax.persistence.jdbc.url=jdbc:postgresql://hostname.domain.com:5432/db_instance_name
javax.persistence.jdbc.user=postgresuser
javax.persistence.jdbc.password=postgrespassword
javax.persistence.jdbc.driver=org.postgresql.Driver
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

You must modify URL, user, and password for your site. Your database administrator can provide these values. The minimum supported version is PostgreSQL 9.2.

Testing and initializing the database connection

Two scripts are provided to test and initialize the database connection using the connection properties in the datasource.properties file. 

To test the database connection, run the following command:

$ <installdirectory>/iocinst/bin/amicm_db_check_connection.sh
Warning

Important

Replace installdirectory with the directory name where you installed the product.

This script attempts to make the connection. If the connection fails, the output enables you to detect an issue and how to fix the problem.

Here is some sample output for a successful connection:

[root@yourdevice bmcuser]# /opt/bmc/ami_cm/iocinst/bin/amicm_db_check_connection.sh
18:09:20  [DEBUG] Reading configuration file: /opt/bmc/ami_cm/iocinst/config/datasource.properties
18:09:20  [INFO ] Creating EnityManagerFactory
18:09:20  [INFO ]      Driver = org.postgresql.Driver
18:09:20  [INFO ]         URL = jdbc:postgresql://yourdevice.bmc.com:nnnn/amicm_config_db
18:09:20  [INFO ]        User = bmcuser
18:09:20  [INFO ]        Unit = amicm-db
18:09:23  [INFO ] Version record not found. Perhaps the database is not initialized.
18:09:23  [INFO ] Database connection validation complete.

Once the connection check passes, you may initialize the database with the following command:

$ <installdirectory>/iocinst/bin/amicm_db_init.sh

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Ops Console Management, BMC AMI Ops Console Automation, and BMC AMI Ops SecureHMC 4.1