Oracle Enterprise Manager Oracle Trace User's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Know Why You Are Instrumenting
When you instrument your application, you must clearly understand your purpose and goals for using Oracle Trace. You must be sure of what you want to know about your application as it runs. This means knowing your application well and taking a close look at how it works before you instrument. For example:
Usually when an application is instrumented, the focus is on business-level and functional-level events. An example of a business-level event is individual transactions such as making, changing, canceling, and confirming reservations in an airline reservations application. An example of a functional-level event is a routine that reads and writes information to and from a disk.
Once you decide exactly what you want to know about your application as it runs, you can instrument it by adding calls to Oracle Trace routines that log the events and items you want to collect.
For a complete description of Oracle Trace routines, refer to Chapter 8, Oracle Trace Routines.
Know How Oracle Trace Interacts with an Application
To instrument effectively, you should understand how Oracle Trace will ultimately interact with the instrumented application. To better and more fully understand this, you need to know the definitions for a few terms as they pertain to Oracle Trace.
Required Oracle Trace Routines
Every product must contain a call to the epc_init routine to register with Oracle Trace. The call must precede any other calls to Oracle Trace and should be done early in the application's execution. No event data can be collected from a product until the epc_init routine has been called. Decide What You Want to Know About Each Event
For every event in a product, you can collect specific pieces of information called items. You need to decide which items you want to collect for each event. An item belongs to one of the following three categories:
Compiling Your Instrumented Application
Before compiling your application, make sure it contains the following include statement:#include "$ORACLE_HOME/otrace/public/epc.h"
Your instrumented application should be compiled using the appropriate commands for your operating system's C compiler. Also, the application must be linked against the following libraries: libepc, libepcpt, libcore3, and libnlsrt13. These libraries are located in the ORACLE_HOME directory. Create a Definition File for Your Product
Before you can collect data for your product, you must create a product definition file. This file defines all the events, items, and event sets for a product. Oracle Trace uses the product definition to match collected data with the appropriate event, so it is important that the product definition file be complete and accurate.
Performance Impact of Instrumentation
To minimize the impact of data collection on an application's performance, Oracle Trace buffers data before writing it to disk. Oracle Trace writes the contents of these buffers out to a data file under the following circumstances:
For a complete description of Oracle Trace routines, refer to Chapter 8, Oracle Trace Routines.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |