Oracle Enterprise Manager Oracle Trace User's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Oracle Trace allows host application events to be organized into event sets. This allows you to collect data for a specific subset of all potential host application events. Oracle Corporation 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 Corporation recommends using the DEFAULT event set.
Server collections can be enabled and controlled in the following ways:
For a complete list and description of the Oracle Trace INIT.ORA parameters, see Additional Information: Oracle Trace INIT.ORA Parameters on page A-7.
The Oracle Trace parameters may be modified and used by adding them to your INITsid.ORA file. To start tracing for a database using these parameters, you must minimally add the following 2 parameters to your .ORA file:
oracle_trace_enable = TRUE
oracle_trace_facility_name = oracled
The "d" selects the server DEFAULT event set. Use oracle for the server ALL event set, and oraclee for the Oracle Expert event set.
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, server_event_set)
EXECUTE dbms_oracle_trace_user.set_oracle_trace(TRUE,"MYCOLL","oracle");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,"NEWCOLL", "oracled");If the collection does not occur, you should check the following:
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_filewhere my_start_input_file contains the following input parameters:
col_name= my_collectionThe server event sets that can be used as values for the fdf_file include oracle, oracled, oraclee. See Using INIT.ORA Parameters to Control Oracle Trace on page A-2 for more information on the server event sets.
dat_file= <usually same as collection name>.dat
cdf_file= <usually same as collection name>.cdf
fdf_file= <server event set>.fdf
regid= <flag> <vendor> <cfnum> <cfval> <fac#> <regid_str>
The values that must be used for the regid input parameter are:
regid= 1 192216243 0 0 5 allofa1.world.
otrccol stop 1234 my_stop_input_filewhere my_stop_input_file contains the collection name and cdf_file name.
The otrccol format command formats the binary collection file to tables in the Oracle database. An example of the format command is as follows:
otrccol format my_format_input_filewhere my_format_input_file contains the following input parameters:
username= <database username>A full_format value of 1 will produce a full format, and a value of 0 will produce a partial format. See Additional Information: Oracle Trace INIT.ORA Parameters on page A-7 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.
password= <database password>
service= <database service name>
cdf_file= <usually same as collection name>.cdf
full_format= <0/1>
Use the otrccol dcf command to delete collection files for a specific collection. Use the otrccol dfd command 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 located in the directory specified in INIT.ORA:
Default Value: operating-system specific
Range of Values: valid collection name up to 16 characters long
Default Value: operating-system specific
Range of Values: full directory pathname
Default Value: 5242880
Range of Values: 0 to 4294967295
Default Value: FALSE
Range of Values: TRUE/FALSE
Default Value: operating-system specific
Range of Values: valid product definition file name up to 16 characters long
Default Value: operating-system specific
Range of Values: full directory pathname
The Oracle7 Server Application Registration, Wait, Fetch, Execute, and Parse events can be associated with the transaction and database connection from which they occurred using cross-product items 3 and 4.
There are two types of events: point events and duration events. Point events represent an instantaneous occurrence of something in the instrumented product. An example of a point event is an error occurrence. Duration events have a beginning and ending. An example of a duration event is a transaction. Duration events can have other events occur within them; for example, the occurrence of an error within a transaction.
Table A-1 lists the Oracle Server events instrumented for Oracle Trace. For more detailed descriptions, refer to the section for the event in which you are interested.
Data Items Collected for Events
Specific kinds of information, known as items, are associated with each event. There are three types of items:
The standard resource utilization items are described in Table A-2. Items specific to Oracle Server release 7.3 are described in Table A-4.
Cross-Product Items
Oracle Trace provides a set of items called cross-product items. These data items allow programmers to relate events for different products. For example, a transaction may generate events in two products: an application and the database. The cross-product data items allow these disparate events to be joined for analysis of the entire transaction.
Cross-product 2 (CROSS_FAC_2) is reserved for use by a future release of Oracle Forms. Instrumented applications and Oracle Forms will pass identification data to the Oracle Server collection through these cross-product items.
Note:
In this version of Oracle Trace, the term `facility' has been changed to `product'. Therefore, the items named CROSS_FAC_x are cross-product items.
Items Specific to Oracle Server Events
The Oracle Server product definition file defines several items specific to the Oracle Server. The following table describes the Oracle Server-specific items. The Edit Product function of the Oracle Trace Manager displays items in the order of their item number. Use the item's number to locate it within the list. The formatted datatype describes how the Oracle Trace formatter defines the item when it formats data into an Oracle database.
Items Associated with Each Event
The following sections describe each event in more detail and provide tables that list the items associated with each event. For item descriptions, refer back to Table A-4.
When you format data, Oracle Trace creates a table for each event collected. The name of the event data table is V_vendor#_F_product#_E_event#_version. Any periods in the product version are replaced with underscores. You can use the otrcsyn.sql script, described in Defining Synonyms on page 4-8, to create synonyms for these tables.
The Oracle Trace formatter creates a column for each event item. For point events, the column name is the same as the item name. For duration events, the items for the start event have _START appended to the item name and the items for the end event have _END appended to the item name.
Event Statistics Block
Items relating to database performance appear in several events. For convenience, these items are referenced as the Event Statistics Block. The items in the Event Statistics block are:
Connection Event
The Connection event records every time a connection is made to a database. The name of the formatted table is V_192216243_F_5_E_1_7_3.
Session_Index
|
Session_Serial
|
Oracle_PID
|
Login_UID
|
Login_UName
|
SID
|
OS_UName
|
OS_Term
|
OS_Mach
|
OS_Image
|
Cross-Product Items 1-5
|
|
The Oracle Server uses the combination of Session_Index and Session_Serial to uniquely identify a connection. SQL*Net uses the connection ID, stored in CROSS_FAC_3, to uniquely identify a connection.
Disconnect Event
The Disconnect event records every time a database disconnection is made. The name of the formatted table is V_192216243_F_5_E_2_7_3.
Session_Index
|
Session_Serial
|
Event Statistics Block
|
Oracle_PID
|
Cross-Product Items 1-5
|
|
A Disconnect event will correspond to at most one Connection event. Therefore, the same fields uniquely identify a disconnect: either the combination of Session_Index and Session_Serial, or CROSS_FAC_3.
ErrorStack Event
The ErrorStack event identifies the process that has the error. The name of the formatted table is V_192216243_F_5_E_3_7_3.
Session_Index
|
Session_Serial
|
Oracle_PID
|
P1
|
P2
|
P3
|
P4
|
P5
|
P6
|
P7
|
P8
|
Cross-Product Items 1-5
|
The ErrorStack event does not have an explicit identifier. The combination of Session_Index, Session_Serial, Timestamp, and Timestamp_Nano should uniquely identify a specific ErrorStack event.
Migration Event
The Migration event is logged each time a session migrates to a shared server process. The name of the formatted table is V_192216243_F_5_E_4_7_3. This event is disabled for Oracle Server release 7.3.2.
Session_Index
|
Session_Serial
|
Oracle_PID
|
Cross-Product Items 1-5
|
|
|
The Migration event does not have an explicit identifier. The combination of Session_Index, Session_Serial, Timestamp, and Timestamp_Nano should uniquely identify a specific Migration event.
ApplReg Event
The ApplReg event registers with Oracle Trace where the application is at a certain point in time. The name of the formatted table is V_192216243_F_5_E_5_7_3.
Session_Index
|
Session_Serial
|
App_Module
|
App_Action
|
Cross-Product Items 1-5
|
|
The ApplReg event does not have an explicit identifier. The combination of Session_Index, Session_Serial, Timestamp, and Timestamp_Nano should uniquely identify a specific ApplReg event.
RowSource Event
The RowSource event logs the number of rows processed by a single row source within an execution plan. The name of the formatted table is V_192216243_F_5_E_6_7_3.
Session_Index
|
Session_Serial
|
Cursor_Number
|
Position_ID
|
Row_Count
|
Cross-Product Items 1-5
|
The combination of Session_Index, Session_Serial, Cursor_Number, and Position_ID uniquely identifies a RowSource event.
SQLSegment Event
The SQLSegment event is a description of an SQL statement. The name of the formatted table is V_192216243_F_5_E_7_7_3.
Session_Index
|
Session_Serial
|
Cursor_Number
|
SQL_Text_Hash
|
Lib_Cache_Addr
|
SQL_Text_Segment
|
SQL_Text
|
Cross-Product Items 1-5
|
|
An SQL segment does not have an explicit identifier. The SQL_Text_Hash field will always be the same for each occurrence of an SQL statement but multiple statements can have the same hash value. If a statement is forced out of the library cache and then swapped back in, the same statement can have multiple values for Lib_Cache_Addr. The combination of Session_Index, Session_Serial, SQL_Text_Hash, and Lib_Cache_Addr should usually identify a particular SQL statement for a session. If you add Cursor_Number, you will identify a particular occurrence of an SQL statement within the session.
Wait Event
The Wait event shows the total waiting time in hundredths of seconds for all responses. The name of the formatted table is V_192216243_F_5_E_13_7_3.
Session_Index
|
Session_Serial
|
Wait_Time
|
P1
|
P2
|
P3
|
Description
|
Cross-Product Items 1-5
|
|
The Wait event does not have an explicit identifier. The combination of Session_Index, Session_Serial, Description, Timestamp, and Timestamp_Nano should uniquely identify a specific Wait event.
Parse Event
The Parse event records the start and end of the parsing phase during the processing of an SQL statement. The parsing phase occurs when the SQL text is read in and broken down (parsed) into its various components. Tables and fields are identified, as well as which fields are sort criteria and which information needs to be returned. The name of the formatted table is V_192216243_F_5_E_8_7_3.
The combination of Session_Index, Session_Serial, Cursor_Number, and SQL_Text_Hash uniquely identifies a specific Parse event.
Execute Event
The Execute event is where the query plan is executed. That is, the parsed input is analyzed to determine exact access methods for retrieving the data, and the data is prepared for fetch if necessary. The name of the formatted table is V_192216243_F_5_E_9_7_3.
The combination of Session_Index, Session_Serial, Cursor_Number, and SQL_Text_Hash uniquely identifies a specific Execute event.
Fetch Event
The Fetch event is the actual return of the data. Multiple fetches can be performed from the same statement to retrieve all the data. The name of the formatted table is V_192216243_F_5_E_10_7_3.
The combination of Session_Index, Session_Serial, Cursor_Number, SQL_Text_Hash, Timestamp, and Timestamp_Nano uniquely identifies a specific Fetch event.
LogicalTX Event
The LogicalTX event logs the start and end of a logical transaction (that is, a statement issued that may cause a change to the database status. The name of the formatted table is V_192216243_F_5_E_11_7_3.
The transaction identifier stored in CROSS_FAC_4 should uniquely identify a specific transaction.
PhysicalTX Event
The PhysicalTX event logs the start and end of a physical transaction (that is, one in which database status is actually changed).
The transaction identifier stored in CROSS_FAC_4 should uniquely identify a specific transaction.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |