1 Introducing Management Repository Views

This chapter provides an introduction to Management Repository views. It contains the following sections:

For examples of how to use views, see Chapter 20, "Examples".

1.1 About Management Repository Views

The Enterprise Manager Management Repository views provide access to target, metric, and monitoring information stored in the Management Repository. Accessing the Management Repository allows you to perform the following:

  • Obtain relevant application-specific information at the right level of granularity and density for a wider variety of users, such as IT staff, executives, and developers.

  • Send alerts for metric threshold violations.

  • Perform historical analysis or additional computation on stored data.

  • Integrate Enterprise Manager alerts seamlessly with user ticketing systems, such as iSupport and Remedy.

While the information in these views is used mainly by the Cloud Control console, it can be used in other ways, such as by programmers building extensibility on top of Enterprise Manager. For example, as a plug-in developer, you might want to extend Enterprise Manager to manage your own, custom-developed targets, or expand on the target types that Oracle provides out-of-the-box. You might want to write your own scripts to query historical data from these views, or build your own custom reports to run from SQL Developer or other products. For more information about extending Enterprise Manager, see the Enterprise Manager Cloud Control Extensibility Programmer's Guide and the Enterprise Manager Cloud Control Extensibility Programmer's Reference.

To facilitate easy access to information stored in the Management Repository, Enterprise Manager supplies a comprehensive set of views rather than forcing the user to access repository base tables directly. Views buffer custom applications from any underlying changes to the repository schema and ensures up-stream applications will not break when the repository schema changes due to patching or new releases.

1.2 Using Management Repository Views

Note:

You must use the views that are documented in this guide and in the Extensibility Development Kit (EDK) only. Any other view that is not documented must not be used and backward compatibility for undocumented views and tables is not guaranteed.

Because the views are simple queries to a database, users can imbed these queries within any application code used to return information for further processing and display in the Enterprise Manager Cloud Control console.

As shown in Example 1-1, the Java code uses Enterprise Manager views to query the Management Repository rather than accessing the repository tables directly. For each of the four time windows, there are four SQL statements with questions marks ('?') as placeholders for the parameters.

See Also:

Chapter 20, "Examples" provides examples of how to use the Management Repository views.

Example 1-1 View Usage

public static final String hour_stmt = 

"SELECT collection_timestamp, value "+
"FROM mgmt$metric_details " +
"WHERE target_type = ? and target_name = ? and metric_name = ? and metric_column= ? " +
"and collection_timestamp > sysdate - 1/24 " +
"ORDER BY collection_timestamp ";

public static final String day_stmt =

"SELECT rollup_timestamp, average "+
"FROM mgmt$metric_hourly " +
"WHERE target_type = ? and target_name = ? and metric_name = ? and metric_column= ? " +

"and rollup_timestamp > sysdate - 1 " +
     "ORDER BY rollup_timestamp";

public static final String week_stmt =

"SELECT rollup_timestamp, average "+
"FROM mgmt$metric_daily " +
"WHERE target_type = ? and target_name = ? and metric_name = ? and metric_column= ? " +
"and rollup_timestamp > sysdate - 7 " +
"ORDER BY rollup_timestamp";

public static final String month_stmt =

"SELECT rollup_timestamp, average "+
"FROM mgmt$metric_daily " +
"WHERE target_type = ? and target_name = ? and metric_name = ? and metric_column= ? " +
"and rollup_timestamp > sysdate - 31 " +
"ORDER BY rollup_timestamp";