Oracle7 Tuning, release 7.3.3 Go to Product Documentation Library
Go to books for this product
Go to Contents for this book
Go to Index

Go to previous file in sequence Go to next file in sequence

Oracle Trace Methodology

This chapter provides an overview of the Oracle Trace product. It covers:


Server performance data can be collected using the Oracle Trace product for Oracle Server release 7.3 or higher. Oracle Trace is a general-purpose data collection product that has been introduced with the Oracle Enterprise Manager systems management product family. The Oracle Trace data collection API can be used in any software product to collect data for a variety of uses, such as performance monitoring, diagnostics, and auditing. Oracle Trace collects specific data for events defined within the host product.

The server performance data that can be collected by Oracle Trace includes:

See Also: For further information on Oracle Trace, see the Oracle Trace User's Guide contained in the Oracle Enterprise Manager Performance Pack documentation set. That book contains a complete list of events and data that can be collected for Oracle Server release 7.3.

Using Oracle Trace for Server Performance Data Collection

You can use Oracle Trace to collect server performance data for a specific database session or for the entire instance. You can also select the server event set for which you want to collect.

Oracle Trace allows host application events to be organized into event sets. This allows the user to collect data for a specific subset of all potential host application events. Oracle has defined the following event sets for Oracle Server release 7.3: ALL, DEFAULT, and EXPERT. The ALL set includes all server events, the DEFAULT set excludes server WAIT events, and the EXPERT set is specifically defined for use in the Oracle Expert tuning application. Oracle recommends using the DEFAULT event set.

Server collections can be enabled and controlled in the following ways:

The following sections describe the server-based controls. For more information on using the Oracle Trace management application, refer to the Oracle Trace User's Guide.

Using Initialization Parameters to Control Oracle Trace

Six parameters are set up by default to control Oracle Trace. By logging into the internal account in your database and executing a "show parameters trace" command, you will see the following parameters:






































Note: This chapter references file pathnames on UNIX-based systems. For the exact path on other operating systems, please see your Oracle platform-specific documentation.

A complete discussion of these parameters is provided in"Oracle Trace Initialization Parameters" on page 22-9.

The Oracle Trace parameters may be modified and used by adding them to your initialization file. To start tracing for a database using these parameters, you must at least add the following two parameters to your file:

oracle_trace_enable = TRUE 
oracle_trace_facility_name = oracled  

The "d" selects the server DEFAULT event set. Use oraclea for the server ALL event set, and oraclee for the Oracle Expert event set.

You must then shut down your database and start it up again before the parameters take effect. Once restarted, the database will start collecting data for the class of data that you selected. To stop the collection, you must shut down the database, set the parameter ORACLE_TRACE_ENABLE = FALSE, and restart the database.

If, once restarted, the database does not start collecting data, you should check the following:

Using Stored Procedure Packages to Control Oracle Trace

You can invoke an Oracle Trace collection for your own session or for another session by using the Oracle Trace stored procedure packages. To collect Oracle Trace data for your own database session, execute the following stored procedure package:

dbms_oracle_trace_user.set_oracle_trace(true/false, collection_name, 


						EXECUTE dbms_oracle_trace_user.set_oracle_trace(TRUE,"MYCOLL","oracled"); 

To collect Oracle Trace data for a database session other than your own, execute the following stored procedure package:

dbms_oracle_trace_agent.set_oracle_trace_in_session(sid, serial#, true/
false, collection_name, server_event_set) 


EXECUTE dbms_oracle_trace_user.set_oracle_trace_in_session (8,12,TRUE,"MYCOLL", 

If the collection does not occur, you should check the following:

Using the Oracle Trace Command Line Interface

Another option for controlling Oracle Trace server collections is the Oracle Trace command line interface (CLI). The CLI collects event data for all server sessions attached to the database at collection start time. Sessions that attach after the collection is started are excluded from the collection. The CLI is invoked by the otrccol command for the following functions:

The job_id can be any numeric value. The user must remember this value in order to stop the collection. The input parameter file contains specific parameter values required for each function. Examples follow. The coll_name (collection name) and cdf_file (collection definition file) are initially defined in the start function input parameter file.

The otrccol start command invokes a collection based upon parameter values contained in the input parameter file. For example:

otrccol  start  1234  my_start_input_file
where my_start_input_file contains the following input parameters:
col_name= my_collection
dat_file= <usually same as collection name>.dat
cdf_file= <
usually same as collection name>.cdf
<server event set>.fdf
regid= <flag> <vendor> <cfnum> <cfval> <fac#> (regid_str>

The server event sets that can be used as values for the fdf_file include oraclea, oracled, and oraclee. See Using Initialization Parameters to Control Oracle Trace on page 22-3 for more information on the server event sets.

The values that must be used for the regid input parameter are: 1 for flag, 192216243 for vendor, 0 for cfnum (cross-product number), 0 for cfval (cross-product value), 5 for fac# (product number). For regid_str, type the service name for the database. For example:

 regid=  1   192216243   0   0   5 

The otrccol stop command halts a running collection, as follows:

otrccol stop 1234 my_stop_input_file
where my_stop_input_file contains the collection name and cdf_file name.

The otrccol format command formats the binary collection file to Oracle tables. An example of the format command is as follows:

	otrccol format my_format_input_file 
where my_format_input_file contains the following input parameters:
username= <database username>
password= <database password>
service= <database service name>
cdf_file= <usually same as collection name>.cdf

A full_format value of 1 will produce a full format, and a value of 0 will produce a partial format. See Formatting Oracle Trace Data to Oracle Tables on page 22-8 for information on formatting part or all of an Oracle Trace collection, and other important information on creating the Oracle Trace formatting tables prior to running the format command.

The otrccol dcf command is used to delete collection files for a specific collection. The otrccol dfd command is used to delete formatted data from the Oracle Trace formatter tables for a specific collection.

Oracle Trace Collection Results

Running an Oracle Trace collection produces the following collection files:

The Oracle Trace data in the collection files can be accessed in two ways:

Oracle Trace Detail Reports

Oracle Trace Detail Reports display statistics for all items associated with each occurrence of a server event. These reports can be quite large. You can control the report output by using command parameters. Use the following command and optional parameters to produce a Detail Report:

otrcrep  [optional parameters]  <collection_name>.cdf  

The first step that you may want to take is to run a report called PROCESS.txt. You can produce this report first to give you a listing of specific process identifiers for which you want to run the detail report.

The command parameter used to produce a Process report is:

otrcrep  -P  <collection_name>.cdf  

Other optional detail report parameters are:

Formatting Oracle Trace Data to Oracle Tables

Your Oracle Trace server collection can be formatted to Oracle tables for more flexible access by any SQL reporting tool. Oracle Trace will produce a separate table for each event collected. For example, a "parses" event table is created to store data for all parse events that occur during a server collection. Before you can format data, you must first set up the Oracle Trace formatter tables. This is done by executing the otrcfmtc.sql script on the server host machine.

Use the following command to format an Oracle Trace collection:

otrcfmt [optional parameters] <collection_name>.cdf [user/password@database]

If the user/password@database is omitted, the user will be prompted for this information.

Oracle Trace allows data to be formatted while a collection is occurring. By default, Oracle Trace will only format the portion of the collection that has not been formatted previously. If the user wants to reformat the entire collection file, the optional parameter -f can be used.

The formatter tables produced by Oracle Trace have names that are a composite of several identifiers relevant to the Oracle Trace collection. Users are advised to use synonyms for these tables in order to make them more easy to use in SQL scripts and reporting tools. The otrcsyn.sql script can be used to create synonyms for the server event tables created. You can edit this script to create your own synonyms for server events.

Oracle Trace provides several SQL scripts that can be used to access the server event tables. For more information on server event tables and scripts for accessing event data and improving event table performance, refer to the Oracle Trace User's Guide

Oracle Trace Initialization Parameters


This parameter specifies the Oracle Trace collection name. This parameter is also used in the output file names (collection definition file <.cdf> and data file <.dat>).
Default Value: operating system specific
Range of Values: valid collection name up to 16 characters long


This parameter specifies the directory pathname where Oracle Trace collection definition and data files are located. If you accept the default, the complete file specification is generally (may be different for non-UNIX systems) $ORACLE_HOME/rdbms/log/<collection name>.cdf and <collection name>.dat.
Default Value: operating system specific
Range of Values: full directory pathname


This parameter specifies the maximum size, in bytes, of the Oracle Trace collection file. Once the collection file reaches this maximum, the collection is disabled.
Default Value: 5242880
Range of Values: 0 - 4294967295


This parameter disables or enables an Oracle Trace collection. If set to TRUE, when you start the server, you automatically start an Oracle Trace collection. Server event data is collected for all database user sessions. To stop a collection, the instance must be shut down and the parameter must be reset to FALSE.
Default Value: FALSE
Range of Values: TRUE/FALSE


This parameter specifies the Oracle Trace product definition file (.fdf file). The file must be located in the directory pointed to by the ORACLE_TRACE_FACILITY_PATH parameter. The product definition file contains definition information for all the events and data items that can be collected for a product that uses the Oracle Trace data collection API. Products can have multiple product definition files (multiple event sets and data items). The Oracle Server has multiple event sets and therefore multiple product definition files. Oracle recommends that you use the "default" event set for Server collections <oracled.fdf>. (See the Oracle Trace documentation for more information on the Server event sets.)
Default Value: operating system specific
Range of Values: valid product definition file name up to 16 characters long


This parameter specifies the directory pathname where Oracle Trace product definition files are located.
Default Value: operating system specific
Range of Values: full directory pathname

Go to previous file in sequence Go to next file in sequence
Prev Next
Copyright © 1997 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Go to books for this product
Go to Contents for this book
Go to Index