Professional Documents
Culture Documents
DM 1012datastudiohealth PDF
DM 1012datastudiohealth PDF
This tutorial introduces the IBM® Data Studio Health Monitor tool for IBM DB2® for Linux®,
UNIX®, and Windows® databases. It walks you through the steps for monitoring the health
of your databases, drilling down into the alert details, and changing the out-of-the-box default
thresholds. It also describes the advanced health monitoring features that are available in
the Optim™ Performance Manager 4.1.0.1 release, and the seamless integration in the Data
Studio and Optim Database Administrator offerings.
First steps
Introduction
In October 2010, IBM extended its Data Studio offering with a new health monitor that allows
you to monitor the health of your DB2 for Linux, UNIX, and Windows databases, and view alerts,
application, utilities, and storage. Data Studio Health Monitor (DSHM) is a server process that you
install separately. It includes a browser-based client, but you can seamlessly launch it from the
Data Studio or Optim Database Administrator Eclipse client.
The health monitoring features are also available in Optim Performance Manager 4.1.0.1, and
include more advanced functionality. See the Related topics section for more information about
Optim Performance Manager. This tutorial will take you on a tour of the free DSHM function.
Installation of Data Studio Health Monitor is quick and easy, and you do not have to install as a
root user. No additional software needs to be installed on the machine where DSHM is installed,
or on the machines where the monitored databases reside. See the Related topics section
for information on the installation and configuration process. You can also choose to skip any
configuration steps marked "optional", until you are ready to take advantage of them.
Getting started
After you have installed Data Studio Health Monitor, you will find the scripts you need to start or
stop the server in the installation /bin directory. The Config/ directory has some of the property files
that are needed by the server, but you shouldn't have to manually update these files. The logs/
directory is where you will find the install logs, as well as logs created during the regular operation
of the server.
Start the server. From Windows, you can start the server from the menu option under Programs-
>IBM Data Studio->Start Data Studio Health Monitor 2.2.1, or directly from Control Panel. From
Linux/UNIX, you need to use the start.sh script from the DSHM installation /bin directory. You do
not need to run the DSHM server as root. If your system administrator sets up an init.d script for
DSHM to be automatically started on system startup, it is recommended that it still be started as
the install user (from sudo), and not as root. If you decide to start this process as a user other than
the one who installed it, just make sure you have permissions to read, write, and execute in the
installation directory (including the Config and logs directories).
Connect to the DSHM server from a web browser with the Adobe FlashPlayer plug-in installed,
using a URL with the following information: http://<hostwhereDSHMisinstalled>:<port>/
datatools. The default port number for DSHM is 11080, but you can modify it at install time.
During the installation process, an administrator (usually 'admin', but you can change this) is
created. The first time you log in, you will need to log in to the Web console as the administrator,
using the password you provided during the installation. Figure 1 shows you the Welcome page
after you log in.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 2 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
import a list of databases from comma-separated files. From the samples folder, use the
DatabaseConnectionsImportCSV.txt file in the install directory as an example for imports.
Once a database is added, health monitoring is automatically enabled, and you are ready to
monitor your databases!
Note that the credentials provided here are used only for periodic background monitoring of the
database. Any interactive connections to the database require you to enter your credentials. For
more information, see the Database Privileges section.
The ability to identify problems and generate alerts is central to the DSHM health monitoring
capability. A default configuration of thresholds and settings is used to identify problems of interest
that you have identified in the databases. The Health alert configurations section will show you
how to alter the default configurations.
Alerts are stored in the repository database, or in the file system if a Configuration Repository
database has not been identified. From the Task Manager, you can look at the Health Summary
and Alert List pages as a way to interactively view the alerts.
The Health Summary provides a grid of summary health information for each monitored database,
as shown in Figure 3.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 3 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
The alert icons in the grid cells identify a database status (Normal, Warning, or Critical) across
categories such as data server, connections, storage, and recovery. A double dash -- in a cell
indicates that no alerts were issued in the selected timeframe. For example, see the time direction
selection in the upper left hand corner of Figure 3. Each icon represents a summation of one or
more individual alerts that were encountered for the selected duration of that specific database.
For example, if you had two Storage alerts for a database, one Critical and one Warning, then
the alert summary icon would identify this as Critical. When you click on the cell, you can drill-
down to the individual alerts themselves that detail the problems, including any appropriate actions
you should take.
The selected timeframe, as shown in Figure 4, governs the alerts that are shown. The per-
database, per-category summarizations include all of the alerts, as well as highlighting only those
alerts that occurred in that time period. Also note that the Data Server Status category is special,
since its summary represents the latest state of the database at the end of the time period.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 4 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
The historical setting allows you to view alert summaries by a specific time period. In this way you
can review alerts that may have occurred while you were away, for example, overnight or over a
weekend.
Alerts
While the Health Summary page provides an aggregated view, the Alert List page provides a
detailed view of the individual alerts. By using the time selector, and sorting and applying filters,
you can browse through the set of alerts that you are interested in.
Data Studio Health Monitor generates alerts for the following categories and situations:
• Data Server Status - Creates an alert for different data server states including: Available,
Unreachable, Quiesced, Quiesce Pending, and Rollforward.
• Connections - An alert is generated when the number of connections to the database exceeds
the threshold. This alert is disabled by default.
• Storage - An alert is generated for the following situations:
• Table Space utilization exceeds the threshold
• Table Space container utilization exceeds the threshold. This alert is disabled by default.
• Table Space container is inaccessible
• Table Space is in Quiesce state
• Table Space is Offline
• Recovery - An alert is generated for the following situations:
• Table Space is in Restore Pending or Rollforward Pending state
• Table Space is in Backup Pending state
• Table Space is in Drop Pending state
• Primary HADR is disconnected
For example, look at the Data Server Status Alert category. When the MIR_DEV database is
available, the Data Server status summary cell is green, as shown in Figure 5. Now let's say the
database SALESDB has been quiesced. With the default configuration settings, a critical alert will
be generated for the SALESDB database as shown in Figure 5.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 5 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
You can view more information about the alert by clicking on the red icon under Data Server Status
as shown in Figure 6.
Figure 6 also shows the list of individual alerts for the Data Server Status category. The Start Time
and End Time columns show when the alerts originated, and if and when they ended. An alert
without an end time indicates that the problem is still ongoing. For example, if the database is
unquiesced, the next monitoring cycle for this database will identify this situation, and the critical
alert will be closed. An end time is displayed, and the Health Summary grid shows the summary
status as green. The Data Server Status is a special category that represents the status of the
monitored database. It displays the status as green when the database is available and reachable.
As a second example, let's look at a Table Space Utilization alert. The SALESDB database has
two warning alerts and one critical alert. The summary cell icon will identify this combined state as
critical (see Figure 7). Click the Actions tab to see a link to the Current Table Spaces dashboard
which lists the current table space status and storage information.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 6 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
Collaborating
You can add comments for an alert and share them with other users to help you keep track of your
own investigations or responses to a problem, and collaborate better with other users. As shown in
Figure 9, you can select an alert and click the Add Comment button on the Alert List page to add
comments.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 7 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Once a comment is added, you can select an alert from the grid, as shown in Figure 10, and then
click the Comments tab to view it.
You can select an alert and click the Send button to notify other users about the problem. The
recipient can quickly access the specific alert by clicking the URL in the email. Prior to using the
email notification facility, you need to have the DSHM Administrator provide the correct SMTP
settings by clicking Task Manager > Setup > Services.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 8 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
Note that in the Current Applications Connections page you will need to connect to the selected
database with your own credentials to retrieve data and perform other actions, like forcing
applications. If you do not have the right privileges on the database, then the operations will fail.
The prompt screen provides you with the option to save your credentials for subsequent logons to
make this easier.
Note that in the Current Table Spaces and Current Utilities pages, you will need to connect to the
selected database with your own credentials to retrieve data and perform other actions, like forcing
applications. If you do not have the right privileges on the database, then the operations will fail.
The prompt screen provides you with the option to save your credentials for subsequent logons to
make this easier.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 9 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Current utilities
The Current Utilities page, as shown in Figure 13, displays the status of any utilities currently
running in the selected database, such as RUNSTATS or BACKUP.
Configuration repository
It is highly recommended that you select a configuration repository database (DB2 LUW v9.5 or
later) to more reliably store configuration and monitored data. If the repository database is not
set up, the server will still function, but all information will be stored internally in the file system.
Other tools, such as Optim Database Administrator or Optim Performance Manager, will not be
able to access any data stored in the file system. To set up a configuration repository, select
Configuration Repository from Task Manager > Setup.
In addition, you can control access to the server from the Console Security page when you select
a configuration repository database.
Remember that when you select a database as the repository (or change to a different one),
previously saved configuration and monitoring information will not automatically transfer over to
the new database. While you can export the monitored database setting, and import it into another
configuration repository, it may be easiest to select a repository database as early as possible.
Console security
When you install Data Studio Health Monitor, a single user credential is requested, and is used
for login to the server. However, for day-to-day use, it is recommended that you set up Console
Security so that you can grant appropriate privileges to users/groups/roles. You may delay this
step until you are ready to publish this URL to more users.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 10 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
• Web container authentication. This is the install-time default security mechanism. You would
have provided an administrator username and password during installation. Think of web
container authentication, and this install-time user account, as just for maintenance or setup.
Repository database authentication is the recommended mechanism for normal operation.
• Repository database authentication. Any user who can connect to the repository database
can log in to the web console. The user's credentials are authenticated directly against
this database. To use the repository database authentication mechanism, you need to first
set up a configuration repository. Typically the DBA of the repository database can then
grant or revoke the Administrator, Operator, and Viewer privileges to other users. Only
Administrators have special privileges, including the ability to change Console Security,
change log levels, and so on.
Note that the Console security page is only concerned about access to the Data Studio Health
Monitor server itself, but to work with individual databases, you are expected to have privileges on
those individual databases. For more information, see the Database Privileges section.
You can click Edit to modify the default threshold values, or disable alerts for an alert type. Editing
alert configuration settings is restricted to users who have the Can Manage Alerts privilege for that
database, as described in the Database Privileges section. For example, look at the editing of the
Database Availability alert type configuration as shown in Figure 15.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 11 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Database privileges
The Data Studio Health Monitor server typically monitors multiple databases from different
organizational units in an enterprise, so it is important that the users and privileges boundaries
defined in these databases are respected. For example, there are two databases called SALES
and PAYROLL defined in the system. Just because the DBA for PAYROLL is able to log in to the
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 12 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
Data Studio Health Monitor server, it does not mean she can modify alert settings for the SALES
database.
A DBA can use Manage Privileges to grant or revoke Can Manage Alerts privileges to other users
of that database. For example, a DBA for the SALESDB can grant Can Manage Alerts privilege to
another DBA so that person can edit the alert configuration for the SALESDB database, as shown
in Figure 17.
To keep things simple for this exercise, you will create these error scenarios in a controlled
manner, and lower thresholds to more quickly cause situations to be flagged as alerts. This section
includes scenarios for the following alert types:
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 13 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Alternatively, you can also click the Refresh icon on the toolbar, as shown in Figure 3 to manually
refresh the Health Summary, or Alert List grid.
Database availability
The Database Availability Alert checks the following status types for a database: Normal, Quiesce
Pending, Quiesced, Rollforward, and Unreachable. By default, a warning alert is generated if the
database is in Quiesce Pending or Rollforward state. A critical alert is generated if the database is
in Quiesced or Unreachable state.
The following error scenario will put the database in Quiesced state, so that a critical alert will be
generated.
For example, perform the following steps to generate only a warning for a database in Quiesced
state, instead of the currently defined critical alert.
1. Navigate to the Health Alerts Configuration page from the Task Manager.
2. Select the database that is in Quiesced state.
3. Highlight the Database Availability row and click Edit.
4. Ensure that the Enabled checkbox is selected.
5. In the Critical section, clear the Quiesced checkbox.
6. In the Warning section, select the Quiesced checkbox.
7. Click OK.
Once the monitoring refresh occurs on the Health Summary page, you will see the Data Server
Status change from Critical (Red) to Warning (Yellow). The Warning Count should now be
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 14 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
raised by 1. Do not be alarmed if the Critical Count is still showing 1. The counts are a cumulative
(summary) history of how many alerts have occurred within the past xx minutes. If you select
the critical alert, you will also see that there is now an end time for it - meaning that the alert has
closed. The start-end time duration is the time during which this problem was present.
Finally, you can do the following steps to unquiesce the database to get it back into normal status:
Once the monitoring refresh occurs on the Health Summary page, you should see the Data Server
Status change from Warning (yellow) back to Normal (green). The previous warning alert should
now also be ended. Even though the situation has returned to normal, the fact that the database
was quiesced in the first place is an important event, which is reflected in the summary counts, as
well as in the Alert List view for that time duration.
Connections
The Connections Alert is used to warn DBAs when there are too many connections to a database
at the same time. By default, the Connections Alert is turned off, but preset to generate a warning
alert if the number of connections detected is greater than or equal to 100, and a critical alert if
greater than or equal to 150. Typically, DBAs need to decide what number constitutes a critical
level, and what constitutes a warning level. What may be a perfectly reasonable limit for one
database, may not be so for another database.
For this exercise, do the following steps to lower the thresholds for the alert, so you don't have to
create over 100 connections to trigger it.
1. Navigate to the Health Alerts Configuration page from the Task Manager.
2. Select the database that you want to use for this scenario.
3. Highlight the Connections row and click Edit.
4. Select the Enabled checkbox (if it is not already selected).
5. Lower the values for Warning threshold to 1, and Critical threshold to 5.
6. Click OK.
Connect to this monitored database from the DB2 command line, or from Data Studio/Optim
Database Administrator, and leave the connections active. Once the monitoring refresh occurs
on the Health Summary page, you should see the Connections status change from No Alerts to
either Critical (red) or Warning (yellow), depending on how many connections are currently active
on that database.
Closing the connections to below the threshold value should close the alerts. Note that the critical
or warning summary icon would still be present to indicate that there had been problems in that
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 15 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
selected duration, but that these alerts now have an end time. This is unlike the Status summary
icon with the Data Server Status alert category.
Remember to reset this alert parameter (or disable the alert) to whatever is appropriate for your
database when you finish with this tutorial, because the thresholds chosen for this tutorial are
unrealistically low.
Once the monitoring refresh occurs on the Health Summary page, you should see the Storage
status change from No Alerts to Warning (yellow). To unquiesce the table space, issue the
command: db2 quiesce tablespaces for table <tbname> reset.
Do the following steps to put a table space into Backup Pending state:
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 16 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
Once the monitoring refresh occurs on the Health Summary page, you should see the Recovery
status change from No alerts to Critical (red).
Prerequisites:
• ODA must be version 2.2.3 or later.
• The DSHM 2.2.1 server has to be installed, either on the same machine as ODA, or on a
remote machine.
• The server location and appropriate credentials must be available for ODA users.
3. Click Configure the Data Studio Health Monitor URL and preferences to open the
preferences window as shown in Figure 20, and set up the connection to the DSHM server.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 17 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
6. To identify the DSHM server, enter the URL (required). It is the same as the URL used with
the Web browser, and resembles this format: http://<hostwhereDSHMisinstalled>:<port>/
datatools. You should also fill in the appropriate user name and password fields.
7. Optionally, you can select the Save Password checkbox to save the password for
subsequent logins to the DSHM server. If the Save Password option is cleared, then
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 18 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
whenever a Monitoring feature is launched, you must enter your credentials as shown in
Figure 21.
8. Optionally, you can select the Launch Data Studio Health Monitor in an external browser
checkbox to launch the DSHM server in an external Web browser to take advantage of other
features, such as context sensitive help, or to alter alert configurations.
Figure 22 - DSHM Health Summary shown within ODA
Figure 22 shows how the Health Monitor features will open up inside the Monitor tab within
the Eclipse workspace.
9. Click OK.
When launched from the Administration explorer, the selected database serves as the content
when the monitoring task is launched. For the Application Connections, Table Space Usage, and
Utilities tasks, such a launch causes the same database to be pre-selected in the monitor page.
• From the Monitor tab of Task Launcher, if you select any one of the view health summary,
view alerts list, view application connections or view table space storage usage monitoring
tasks, then the appropriate page will open up in the DSHM Monitor tab.
• From the Administration Explorer, right-click on a database to find the Monitor menu group.
As shown in Figure 23, under the Monitor menu you find the following health monitoring
options: Health summary, Alerts, Application Connections, Table spaces, and Utilities.
• From the View menu option in Administration Explorer, the same Monitor menu is available as
shown in Figure 24.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 19 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 20 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
In OPM, when you select an application, you can also view the application's SQL details by
clicking the View SQL Details button. Additional details such as the SQL statements, Statement
Operation type, and Elapsed Time are also viewable, are shown in Figure 26.
You can view the SQL statement text in the area below the grid, as shown in Figure 27. You can
also view the complete SQL statement text by clicking the Show All Text button. Note that if the
SQL statement text is too long (exceeds 4000 characters), then the SQL statement text will be
launched in another Web browser window. Otherwise it will be launched in a pop-up view.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 21 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Alternatively, you can also click the SQL tab, as shown in Figure 28 to view the running SQL
statements for all connections in the selected database.
As shown in Figure 29, when you select a SQL statement, you can see the related details such as
the Agent ID, Application name, and Authorization ID.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 22 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
You can choose to subscribe one or more email address for Warning or Critical alerts, or both.
You can also choose to receive reminders if a problem persists for a lot longer than anticipated. To
avoid notifications at inappropriate times, you can also set a blackout time.
The alert notification email includes specific details about the alert, and a URL to the alert itself. As
part of the email notification, you can also include additional comments as part of the Notes field,
as shown in Figure 32.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 23 of 25
Studio Health Monitor
developerWorks® ibm.com/developerWorks/
Conclusion
In this tutorial, you've gotten a detailed look at the health monitoring features in Data Studio Health
Monitor, and learned how to alter configurations to better suit your monitoring requirements for
each database. You also learned how to try out some of the alerting features of DSHM, as well as
how to invoke the monitoring features from within Optim Database Administrator, or Data Studio
Eclipse environment.
Acknowledgements
Special thanks to Holly Hayes for her input on this tutorial.
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 24 of 25
Studio Health Monitor
ibm.com/developerWorks/ developerWorks®
Related topics
• DSHM installation and configuration process
• Data Studio Health Monitor
• Optim Performance Manager
Monitor DB2 for Linux, UNIX, and Windows databases with Data Page 25 of 25
Studio Health Monitor