Sybase ASE Dataserver - Database Detail Pattern
Pattern Goal
The goal of the Sybase ASE Dataserver Database Detail pattern is to obtain the list of databases being managed by the Sybase Database server and furthermore to obtain (optionally, disabled by default) the list of schemas and tables within these databases.
The information is then stored within the BMC Discovery model as DatabaseDetail nodes. In Atrium Discovery 8.3 and later, the DatabaseDetail node representing each Sybase database has additional attributes added which permit easy mapping by the CMDB sync mechanism to the BMC_Database CIs in BMC CMDB.
The pattern connects to the SQL Server using a JDBC connection.
If the pattern is unable to connect to a Sybase Database Server instance using a JDBC connection, it will attempt to obtain the list of managed databases by executing a command to interrogate the server instance's .log file.
Obtaining Database List from Database Query
Configuration Options
There are several configuration options available for this product:
- ignore_databases := [ "tempdb" ]; - allows to ignore a list of databases
- retrieve_schemas := false; - allows to retrieve a list of schemas
- retrieve_tables := false; - allows to retrieve tables for each schema
- use_log_files := false; - allows to use log files for deep discovery if direct query of the database fails
Setting of Database Integration Point
- Set the Connection Parameters, including Username and Password.
Setting the port:
Atrium Discovery 8.0 and 8.1
The core TKU Sybase ASE Dataserver Pattern will attempt to obtain the listening port for the database server dynamically. In case where it fails the Database Detail pattern will use the default port which is set in its configuration parameters. If the default port is likely to be different in your environment, the pattern configuration should be altered. Changing Pattern Configuration is detailed in Atrium Discovery Documentation .
Atrium Discovery 8.2 and later
The option to set the default port no longer exists in the Sybase ASE Database Detail pattern.
The Sybase ASE Database Detail pattern behavior is now as follows:
- If the core TKU Sybase ASE Dataserver or Sybase ASE CE Dataserver Pattern discovers the listening port, this is the port that will be used
- Alternatively, the Sybase ASE Database Detail pattern will use the port that has been set in the database credentials by the user.
- If no port was retrieved and port DB listening port was not set by the user, the Sybase ASE Database Detail pattern will not attempt to perform database queries.
The reason for this change is to minimize the number of configuration steps required and prevent errors due to forgotten changes in pattern configuration.
Editing pattern configuration further
- Decide whether the Schemas pattern should attempt to retrieve schemas or not, whether the Tables pattern should attempt to retrieve tables or not and whether any specific databases should be ignored
Database User Configuration
In order for BMC Discovery to retrieve the database details, it will need to be able to access the database as a legitimate user with privileges to execute the SQL queries below.
The database user BMC Discovery uses to access the database needs to have enough privileges to execute the SQL queries listed below.
SQL Queries Executed
The pattern executes the following SQL queries.
- Obtaining a list of databases being managed: ''sp_databases''
- Obtaining a list of schemas and tables within a database: ''"use <database_name>", "sp_tables @table_qualifier = <database_name>, @table_type = \"'TABLE'\"''
- Obtaining sort order: "select value from master..syscurconfigs where config = 123"
- Obtaining char set: "select value from master..syscurconfigs where config = 131"
- Checking case sensitivity: "select name from master..syscharsets where id = <sort_order> and csid = <char_set>"
Obtaining Database List from Log Files
If the DatabasesAndTables pattern cannot obtain database information via a database query, and the "Use log files for deep discovery if direct query of the database fails" option is set, the pattern attempts to obtain the information from parsing a log file. This is only attempted when the pattern can identify the Sybase Database Server instances and installation root
The pattern performs the following searches on file <install root>/install/<instance>.log :
- Search for "found during startup" or "using license file" to determine the last database boot time.
- Search for "<some string> is now (online|offline)" to determine the database name
A DatabaseDetail node is then created for each database that was reported in the log after the last database boot time