Databases

Online section / Guides / User Guide / Databases contact | download | sitemap
 

MyARM supports different databases to store and retrieve ARM data. This section describes the basic setup and configuration for each database.

SQLite database

The simplest and easy to use database is the SQLite database which provides a complete SQL database by using just a single data file. The file used for storing all ARM data can be configured using MyARM configuration properties as described below.

<name>.type
database type which has to be sqlite3.
<name>.file
specifies the path and name for SQLite database file.
# agent uses a datasink named db_sqlite
agent.sink.name = db_sqlite
# define the type of the database
db_sqlite.type  = sqlite3
# define the SQLite database file
db_sqlite.file  = /opt/myarm/var/sqlite.db

MySQL database

For production use a MySQL database can be used to store all ARM data. The database has to be setup correctly. To setup correct databases and tables within MySQL use the myarminitdb.

Note that the configured MySQL database user needs the appropriate priviledges to create the MyARM databases. Please use the following SQL statement to grant the priviledges:

someuser@localhost: mysql -u root
GRANT ALL PRIVILEGES ON *.* TO 'someuser'@'localhost';

Since MyARM version 1.3 the MySQL database configuration is split into three new properties which defines specific databases for definition data, application instance data and transaction instance data.

These new database configuration properties should be used in production environments with high number of transaction measurements. Therefore the tentative static data like ARM definitions can be separated from the highly dynamic data like transaction measurements, context and metrics values.

By default the MyARM MySQL configuration uses the myarm user with no password. It is recommended that you create such a MySQL user and according to your security standards change the password. All changes should be written into the user.conf file which will override any standard configuration property.

To configure the MySQL database within MyARM the following properties are used:

<name>.type
database type which has to be mysql.
<name>.user
database user name. Default is myarm.
<name>.password
password for the database user. Default is an empty string ("").
<name>.host
host where the database is running. Default is localhost.
<name>.port
port number on which the MySQL server listens for incoming connections. Default is 3306.
<name>.reconnect (New since "1.4.x.0")
defines an interval value in seconds to wait before MyARM retries to connect to the MySQL database process again. Default is 30 second.
<name>.database.definition (New since "1.3.x.0")
Database name to store ARM definition data such as application and transaction definitions which are also called meta data. Default is MyARM_Def.
<name>.database.application (New since "1.3.x.0")
Database name to store ARM application instance data such as application instances and application context values. Default is MyARM_App.
<name>.database.transaction (New since "1.3.x.0")
Database name to store ARM transaction instance data such as transaction measurements, transaction properties and metrics as well as transaction correlation information. Default is MyARM_Tran.

The mysql datasink supports on the fly generation of transaction databases according to the transaction time stamp (New since "1.3.x.4") . For this purpose the transaction database name can contain '%'patterns which are replaced by appropriate values of the transaction to store. The following patterns are supported:

'%d'
is replaced by the two digit day of the month ('DD' the transaction started.
'%m'
is replaced by the two digit month of the year ('MM' the transaction started.
'%y'
is replaced by the two digit year ('YY' the transaction started.
'%Y'
is replaced by the four digit year ('YYYY' the transaction started.
# define the database name where to store the definition data
db_mysql.database.definition = MyARM_Date_Def
# define the database name where to store the application data
db_mysql.database.application = MyARM_Date_App
# define the database name where to store the transaction data
db_mysql.database.transaction = MyARM_Date_%Y%m%d_Tran
<name>.engine
MySQL storage engine to use for the database name. Starting with (New since "1.4.x.0") default is INNODB.
<name>.partitioning.scheme (New since "1.3.x.4")
Specifies which partitioning scheme for the transaction measurement table should be used. Note that MySQL supports partitioning since version 5.1. The following schemes are available:
none
disables the partitioning usage.
hours_per_day
defines that transactions are stored into different table spaces according to the transaction start hour (hour 0 til hour 23).
days_per_week
defines that transactions are stored into different table spaces according to the transaction start day in a week (day 0 til day 6).
days_per_month (New since "1.4.x.0")
defines that transactions are stored into different table spaces according to the transaction start day in a month (day 0 til day 30).
month_per_year (New since "1.4.x.0")
defines that transactions are stored into different table spaces according to the transaction start month in a year (month 0 for january til month 11 for december).

Default is none.

<name>.partitioning.distribution (New since "1.3.x.4")
specifies the partitioning distribution for the configured scheme. With this property one partition can be configured for several continues hours or days. Each hour or day is separated by a comma (','. To use a distribution of four identical quarters of a day use the string '6,12,18'which defines
  1. the first partition from hour 0 til 5 (including)
  2. the second partition from 6 til 11 (including)
  3. the third partition from 12 til 17 (including)
  4. the last partition from 18 til 23 (including)

By default is property is disabled which means that hours_per_day is divided into 24 and days_per_week into 7 partitions.

The following example configures a MySQL database used as the ARM agent datasink where the database runs on host dbhost, the database definition name is MyARM_Def, the database application name is MyARM_App and the database transaction name is MyARM_Tran. The MySQL user is set to myarm:

# agent uses a datasink named db_mysql
agent.sink.name   = db_mysql
# define the type of the datasink
db_mysql.type     = mysql
# define the host where the MySQL database runs
db_mysql.host     = dbhost
# the interval for reconnecting to the database in seconds
db_mysql.reconnect = 60
# define the user to log into the database
db_mysql.user     = myarm
# define the database name where to store the ARM definition data
db_mysql.database.definition = MyARM_Def
# define the database name where to store the ARM application data
db_mysql.database.application = MyARM_App
# define the database name where to store the ARM transaction data
db_mysql.database.transaction = MyARM_Tran
# set the default storage engine for creating tables
db_mysql.engine   = INNODB

Also MyARM provides its own compiled mysqlclient library. If you have problems connecting to the MySQL database it is possible that your MySQL installation uses another connecting socket as the library provided by the MyARM distribution. By default MySQL searchs for a connection socket named /tmp/mysql.sock in Unix environments. If your server uses a different path please setup the MYSQL_UNIX_PORT variable correctly.

Oracle database (New since "1.4.x.0")

For production use a Oracle database can be used to store all ARM data. The database has to be setup correctly. To setup correct databases and tables within Oracle use the myarminitdb. Before running the myarminitdb program the Oracle database must be configured for MyARM.

By default the MyARM Oracle configuration uses the myarm user with no password. It is recommended that you create such an Oracle user and according to your security standards change the password. All changes should be written into the user.conf file which will override any standard configuration property.

Note the configured Oracle database user need to have the following priviledges:

You can use the following SQL statements to grant the appropriate priviledges to a database user:

GRANT CREATE TABLESPACE to someuser;
GRANT DROP TABLESPACE to someuser;
GRANT UNLIMITED TABLESPACE to someuser;
GRANT CREATE TABLE to someuser;
GRANT CREATE VIEW to someuser;
GRANT CREATE SEQUENCE to someuser;
GRANT CREATE TRIGGER to someuser;
GRANT ALTER SESSION to someuser;

To configure the Oracle database within MyARM the following properties are used:

<name>.type (New since "1.4.x.0")
database type which has to be oracle.
<name>.user (New since "1.4.x.0")
database user name. Default is myarm.
<name>.password (New since "1.4.x.0")
password for the database user. Default is an empty string ("").
<name>.server (New since "1.4.x.0")
server host where the database is running including an optional SID (host[/SID]). Default is localhost.
<name>.tablespace (New since "1.4.x.0")
table space name which is created by MyARM and all MyARM tables belongs to. Default is MyARM.