Configuring database credentials

To retrieve the Database details, BMC Atrium Discovery needs access to the database as a legitimate user, with privileges sufficient to execute the SQL queries. This topic gives an overview of the database credentials and provides steps for adding new credentials for database discovery.

Before you begin

  • Ensure you understand how the database credentials are used in BMC Atrium Discovery
    See Understanding database credentials for more information.
  • Ensure that necessary patterns are activated
    Database credentials are bound to the patterns that include sql_discovery definition (for the example, see Database credentials definition in a pattern). There is no one general database pattern that covers any database discovery, so you might want to activate the patterns based on the types of databases you expect to discover.

To add new database credentials

  1. Open the Discovery page and click Credentials.
  2. On the Device Credentials page, open the Databases tab.
    You can see the list of database credential groups. Every group corresponds to the particular pattern with an sql_discovery definition and contains queries from that definition and credential  for database connection created by BMC Atrium Discovery users.

  3. Click Credentials in the necessary group.
  4. Click Create.
  5. Enter the following general information:

    Field

    Description

    Name

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

    Enabled

    A check box 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.

  6. Select the Database Driver from the list.

    Note

    You can manage existing JDBC drivers on the Administration > JDBC Drivers page.

    The page expands to show additional database-specific fields.

  7. Specify Database IP Address: 

    • If you do not need to limit the credentials use to specific IP addresses (for example, when you do not have a complete list of hosts with databases), select Match All.

    • To use these credentials only for particular IP addresses, deselect Match All and enter the endpoint IP address(es) as a comma separated list of values that will be used to determine if this credential is suitable for a particular IP address.

       Expand for more information on supported IP address types:

      They can be:

      • IPv4 address: for example 192.168.1.100.

      • IPv4 range: for example 192.168.1.100-105192.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 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 labeled with a question mark. You can also paste a list of IP addresses or ranges into this field. If any pills are invalid, a message stating the number of invalid pills is displayed above the range field. Clicking the link applies a filter which shows only invalid pills which you can then edit or delete. The filter can be removed by clicking clear in the Showing n of n label below the Range field. There is no paste option on the context sensitive (right click) menu. Warning: You cannot paste a comma-separated list of IP address information into the Range field in Firefox. This can 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. 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.

  8. Fill in other fields that depend on the database driver:

    • For Microsoft SQL Server database:

      Field

      Description

      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.

      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.

      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.

    • For Oracle database version 8i:

      Field

      Description

      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.

      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.

    • For Oracle database versions from 9i to 11g:

      Field

      Description

      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.

      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.

    • For Sybase database or PostgreSQL database version 7.2 and higher:

      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.

      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.

    • For Informix databases:

      Field

      Description

      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.

      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.

  9. To save the details, click Apply.
  10. Click the Details tab to return to the main Creadntials summary page.

Understanding database credentials

When you activate a Database Pattern (a pattern of sql_discovery type) that aims for deeper database discovery, the corresponding Database Credential Group is created. A Database Credential Group is a container for information used to query databases that includes any number of the following elements:

  • 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.

Deep database discovery

Any JDBC Driver that is activated on the Administration > JDBC Drivers page can be used to create database connections from patterns and query the database using these connections, being properly authenticated.

The Technology Knowledge Update 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

Database credentials definition in a pattern

This is the definitions section of the MySQL_AB.MySQL_RDBMS_Extended.DatabasesAndTables pattern. 

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;

Sample Queries

Description

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%

Was this page helpful? Yes No Submitting... Thank you

Comments