Page tree

What is a Database Credential Group?

A Database Credential Group is a container for information used to query databases. They contain one or more credentials and one or more queries.

  • Credential: Contains the information (for example, database credentials, driver, IP address) to create a connection from BMC Atrium Discovery to the target database.
  • Query: The SQL query that is passed to the target database to extract the required information. The query is supplied by the pattern.

A Database Credential Group is created by the activation of a Database Pattern. A Database Pattern has its type defined as sql_discovery.

Deep database discovery

Any database driver listed on the JDBC management page can be used to create database connections for querying from patterns. The TKU shipped with BMC Atrium Discovery provides patterns for deep discovery of the following databases:

  • IBM DB2 – mainframe only
  • IBM Information Management System (IMS) – mainframe only
  • Microsoft SQL Server
  • MySQL
  • Oracle
  • Sybase

To configure a Database Credential Group

The only items that must be configured in the user interface (UI) for a Database Credential Group are the credentials (username, password, connection information). The database queries come from the database pattern.

The following example is for MySQL and uses the MySQL_AB.MySQL_RDBMS_Extended.DatabasesAndTables pattern.

This is the definitions section of the MySQL_AB.MySQL_RDBMS_Extended.DatabasesAndTables pattern. Additional comments explain various definitions.

definitions MySQLDetails 1.0
    """Queries for MySQL to recover detailed content information"""
    // provides the description text for the Credential Group

    type := sql_discovery;   // sql_discovery places the credential group in the Databases
    group := "MySQL";        // tab with the heading MySQL. The group also populates the 
                             // Name field.

    define showDatabases     // defines a query called showDatabases
        """Return a list of defined databases"""
        // provides the description text for the showDatabases query

        // the query
        query := "SHOW DATABASES";  
    end define;

    define showTables        // defines a query called showTables
        """Return a list of defined tables within the given database"""
        // provides the description text for the showTable query

        // the query
        query := "SELECT table_name FROM information_schema.tables WHERE table_schema = %db_name%"; 
        parameters := db_name;
    end define;
end definitions;
  1. Ensure that the MySQL_AB.MySQL_RDBMS_Extended.DatabasesAndTables pattern is activated.
  2. From the Discovery home page, click Credentials.
  3. Click the Databases tab.
  4. Click the MySQL credential group heading.
  5. Click the Credentials tab.
  6. Select Create New Credential.
  7. Enter the following information:

    Field

    Description

    Name

    Enter a name for the credential (for example, ExtendedMySQL).

    Enabled

    A checkbox to define whether or not the credential is enabled.

    Description

    Enter a free text description of the credential.

    Username

    The username used to log in to the target database.

    Password

    The password corresponding to the username.

    Database Driver

    Select an appropriate database driver from the drop-down list. When one is selected, additional fields are added to the form depending on the driver selected.

    Database IP Address

    Select "Match All" to match all endpoints. Deselect it to enter values that will be used to determine if this credential is suitable for a particular endpoint. They can be one or more of the following, separated by commas:
    • IPv4 address: for example 192.168.1.100.
    • IPv4 range: for example 192.168.1.100-105, 192.168.1.100/24, or 192.168.1.*.
    • IPv6 address: for example fda8:7554:2721:a8b3::3.
    • IPv6 network prefix: for example fda8:7554:2721:a8b3::/64.

    The following address types cannot be specified

    • IPv6 link local addresses (prefix fe80::/64)
    • IPv6 multicast addresses (prefix ff00::/8)
    • IPv4 multicast addresses (224.0.0.0 to 239.255.255.255)

    As you enter text, the user interface (UI) divides it into pills, discrete editable units, when you enter a space or a comma. According to the text entered, the pill is formatted to represent one of the previous types or presented as invalid.

    Invalid pills are labelled with a question mark. You can also paste a list of IP addresses or ranges into this field. There is no paste option on the context sensitive (right click) menu.

    You cannot paste a comma-separated list of IP address information into the Range field in Firefox. This may crash the browser. You can use a space separated list without any problems.

    • To edit a pill, click the pill body and edit the text.
    • To delete a pill, click the X icon to the right of the pill, or click to edit and delete all of the text.
    • To view the unformatted source text, click the source toggle switch. The source view is useful for copying to a text editor or spreadsheet. Click the source toggle switch again to see the formatted pill view.
    You can also sort the pill view by value or type. Value sorts by ascending numerical value. Type sorts by type, placing invalid pills first.
    Underneath the entry field is a filter box. Enter text in the filter box to only show matching pills.

    (info) Pills are not currently supported in Opera.

What level of credentials are required?

In order for BMC Atrium Discovery to retrieve the Database details, it will need to be able to access the Database
as a legitimate user, with privileges sufficient to execute the SQL Queries below. These examples pertain to Oracle. For other databases, see the relevant Configipedia pages.

Oracle Database Server SID

Query

Obtaining a list of Schemas for a SID

SELECT username FROM all_users ORDER BY username

Obtaining a list of Tables within a Schema

SELECT table_name FROM all_tables WHERE owner = %schema%

Obtaining a list of Tablespaces for a SID

SELECT * FROM dba_tablespaces

Obtaining a list of DataFiles within a Tablespace

SELECT * FROM DBA_DATA_FILES WHERE TABLESPACE_NAME = %tablespace_name%

Oracle Database Server service_name

Query

Obtaining a list of Schemas

SELECT username FROM all_users ORDER BY username

Obtaining a list of Tables within a Schema

SELECT table_name FROM all_tables WHERE owner = %schema%

Obtaining a list of Tablespaces

SELECT * FROM dba_tablespaces

Obtaining a list of DataFiles within a Tablespace

SELECT * FROM DBA_DATA_FILES WHERE TABLESPACE_NAME = %tablespace_name%


The following table describes the additional fields:

Field

Description

Database

The database name. If you leave the Match Regular Expression check box clear, the connection will be made to any database whose name is supplied by the pattern. If the check box is selected, the connection will be made to any database whose name matches the regular expression. Select the default value check box and specify a value to be used if none is specified by a pattern.

Database Name

The database name (Informix). If you leave the Match Regular Expression check box clear, the connection will be made to any database whose name is supplied by the pattern. If the check box is selected, the connection will be made to any database whose name matches the regular expression. Select the default value check box and specify a value to be used if none is specified by a pattern.

Database Instance Name

The database instance name (Microsoft SQL Server). If you leave the Match Regular Expression check box clear, the connection will be made to any database whose name is supplied by the pattern. If the check box is selected, the connection will be made to any database whose name matches the regular expression. Select the default value check box and specify a value to be used if none is specified by a pattern.

Server Name

The name of the Informix server as it appears in the sqlhosts file. If you leave the Match Regular Expression check box clear, the connection will be made to any server name supplied by the pattern. If the check box is selected, the connection will be made to any database whose name matches the regular expression. Select the default value check box and specify a value to be used if none is specified by a pattern.

System ID (SID)

The Oracle System ID, or instance running on the Oracle host. If you leave the Match Regular Expression check box clear, the connection will be made to any database whose SID supplied by the pattern. If the check box is selected, the connection will be made to any database whose SID matches the regular expression. Select the default value check box and specify a value to be used if none is specified by a pattern.

Service name

The Oracle service name, an alias to an instance, or multiple instances in for example a clustered environment. If you leave the Match Regular Expression check box clear, the connection will be made to any database whose service name is supplied by the pattern. If the check box is selected, the connection will be made to any database whose service name matches the regular expression. Select the default value check box and specify a value to be used if none is specified by a pattern.

Port

The port number to use to connect to the database. If you leave the Match Regular Expression check box clear, any port supplied by the pattern will be used to connect to the database. If the check box is selected, any port supplied which matches the regular expression will be used to connect to the database. Select the default value check box and specify a value to be used if none is specified by a pattern.

Additional JDBC Parameters

Any additional JDBC parameters to use when making the connection. Select the default value check box and specify a value to be used if none is specified by a pattern. These are specified as key=value pairs in a semicolon separated list.

  1. To save the details, click Apply.
  2. Click the Details tab to return to the main summary page for the Credential Group.
  • No labels