12 Diagnosing Problems

This chapter describes how to use the Oracle Fusion Middleware Diagnostic Framework to collect and manage information about a problem so that you can resolve it or send it to Oracle Support for resolution.

12.1 Understanding the Diagnostic Framework

Oracle Fusion Middleware includes a Diagnostic Framework, which aids in detecting, diagnosing, and resolving problems. The problems that are targeted in particular are critical errors such as those caused by code bugs, metadata corruption, customer data corruption, deadlocked threads, and inconsistent state.

When a critical error occurs, it is assigned an incident number, and diagnostic data for the error (such as log files) are immediately captured and tagged with this number. The data is then stored in the Automatic Diagnostic Repository (ADR), where it can later be retrieved by incident number and analyzed.

The goals of the Diagnostic Framework are:

First-failure diagnosis

Limiting damage and interruptions after a problem is detected

Reducing problem diagnostic time

Reducing problem resolution time

Simplifying customer interaction with Oracle Support

The Diagnostic Framework includes the following technologies:

Automatic capture of diagnostic data upon first failure: For critical errors, the ability to capture error information at first failure greatly increases the chance of a quick problem resolution and reduced downtime. The Diagnostic Framework automatically collects diagnostics, such as thread dumps, DMS metric dumps, and WebLogic Diagnostics Framework (WLDF) server image dumps. Such diagnostic data is similar to the data collected by airplane "black box" flight recorders. When a problem is detected, alerts are generated and the fault diagnosability infrastructure is activated to capture and store diagnostic data. The data is stored in a file-based repository and is accessible with command-line utilities.

Standardized log formats: Standardized log formats (using the ODL log file format) across all Oracle Fusion Middleware components allows administrators and Oracle Support personnel to use a single set of tools for problem analysis. Problems are more easily diagnosed, and downtime is reduced.

Diagnostic rules: Each component defines diagnostic rules that are used to evaluate whether a given log message should result in an incident being created and which dumps should be executed. The diagnostic rules also indicate whether an individual dump should be created synchronously or asynchronously.

In addition, you can define custom rules that apply to a domain, a server, or an application in a domain or server.

Incident detection log filter: The incident detection log filter implements the java.util.logging filter. It inspects each log message to see if an incident should be created, basing its decision on the diagnostic rules for components and applications.

Incident packaging service (IPS) and incident packages: The IPS enables you to automatically and easily gather the diagnostic data—log files, dumps, reports, and more—pertaining to a critical error that has a corresponding incident, and package the data into a zip file for transmission to Oracle Support. All diagnostic data relating to a critical error that has been detected by the Diagnostics Framework is captured and stored as an incident in ADR. The incident packaging service identifies the required files automatically and adds them to the zip file.

Before creating the zip file, the IPS first collects diagnostic data into an intermediate logical structure called an incident package. Packages are stored in the Automatic Diagnostic Repository. If you choose to, you can access this intermediate logical structure, view and modify its contents, add or remove additional diagnostic data at any time, and when you are ready, create the zip file from the package and upload it to Oracle Support.

Integration with WebLogic Diagnostics Framework (WLDF): The Oracle Fusion Middleware Diagnostics Framework integrates with some features of WebLogic Diagnostics Framework (WLDF), including the capturing of WebLogic Server images on detection of critical errors. WLDF is a monitoring and diagnostic framework that defines and implements a set of services that run within WebLogic Server processes and participate in the standard server life cycle. Using WLDF, you can create, collect, analyze, archive, and access diagnostic data generated by a running server and the applications deployed within its containers. This data provides insight into the run-time performance of servers and applications and enables you to isolate and diagnose faults when they occur.

Oracle Fusion Middleware Diagnostics Framework integrates with the following components of WLDF:

WLDF Watch and Notification, which watches specific logs and metrics for specified conditions and sends a notification when a condition is met. There are several types of notifications, including JMX notification and a notification to create a Diagnostic Image. Oracle Fusion Middleware Diagnostics Framework integrates with the WLDF Watch and Notification component to create incidents.

Diagnostic Image Capture, which gathers the most common sources of the key server state used in diagnosing problems. It packages that state into a single artifact, the Diagnostic Image. With Oracle Fusion Middleware Diagnostics Framework, it writes the artifact to ADR.

12.1.1 About Incidents and Problems

To facilitate diagnosis and resolution of critical errors, the Diagnostic Framework introduces two concepts for Oracle Fusion Middleware: problems and incidents.

A problem is a critical error. Critical errors manifest as internal errors or other severe errors. Problems are tracked in the ADR. Each problem has a problem key, which is a text string that describes the problem. It includes an error code (in the format XXX-nnnnn) and in some cases, other error-specific values.

An incident is a single occurrence of a problem. When a problem (critical error) occurs multiple times, an incident is created for each occurrence. Incidents are timestamped and tracked in the ADR. Each incident is identified by a numeric incident ID, which is unique within the ADR home. When an incident occurs, the Diagnostic Framework:

Gathers first-failure diagnostic data about the incident in the form of dump files (incident dumps).

Stores the incident dumps in an ADR subdirectory created for that incident.

Registers the incidents dumps with the incident in ADR.

12.1.1.1 Incident Flood Control

It is conceivable that a problem could generate dozens or perhaps hundreds of incidents in a short period of time. This would generate too much diagnostic data, which would consume too much space in the ADR and could possibly slow down your efforts to diagnose and resolve the problem. For these reasons, the Diagnostic Framework applies flood control to incident generation after certain thresholds are reached. A flood-controlled incident is an incident that is not recorded in the ADR. Instead, the Diagnostic Framework writes a message at the WARNING level to the log file and returns an oracle.dfw.incident.Incident object. Flood-controlled incidents provide a way of informing you that a critical error is ongoing, without overloading the system with diagnostic data.

By default, if more than 5 incidents with the same problem key occur within 60 minutes, subsequent incidents with the same problem key are flood controlled. You can change this value using MBeans, as described in Section 12.3.

12.1.2 Diagnostic Framework Components

The following topics describe the key components of the Diagnostic Framework:

To use the Diagnostic Framework, in particular the Automatic Diagnostic Repository, the Managed Servers must have Oracle JRF applied. The following directory will exist for each Managed Server if Oracle JRF has been applied:

If Oracle JRF has been applied, restart the servers, making sure that the Node Manager property startScriptEnabled is set to true, as described in Section 2.8.1.

12.1.2.1 Automatic Diagnostic Repository

The Automatic Diagnostic Repository (ADR) is a file-based hierarchical repository for Oracle Fusion Middleware diagnostic data, such as traces and dumps. The Oracle Fusion Middleware components store all incident data in the ADR. Each Oracle WebLogic Server stores diagnostic data in subdirectories of its own home directory within the ADR. For example, each Managed Server and Administration Server has an ADR home directory.

The ADR root directory is known as ADR base. By default, the ADR base is located in the following directory:

DOMAIN_HOME/servers/server_name/adr

Within ADR base, there can be multiple ADR homes, where each ADR home is the root directory for all incident data for a particular instance of Oracle WebLogic Server. The following path shows the location of the ADR home:

ADR_BASE/diag/ofm/domain_name/server_name

Figure 12-1 illustrates the directory hierarchy of the ADR home for an Oracle WebLogic Server instance.

incident: A directory that can contain multiple subdirectories, where each subdirectory is named for a particular incident. The subdirectories are named incdir_n, with n representing the number of the incident. Each subdirectory contains information and diagnostic dumps pertaining only to that incident.

(others): Other subdirectories of ADR home, which store incident packages and other information.

Note:

ADR uses the domain name as the Product ID and the server name as the Instance ID when it packages an incident. However, if either name is more than 30 characters, ADR truncates the name. In addition, dollar sign ($) and space characters are replaced with underscores.

12.1.2.2 Diagnostic Dumps

A diagnostic dump captures and dumps specific diagnostic information when an incident is created (automatic) or on the request of an administrator (manual). When executed as part of incident creation, the dump is included with the set of incident diagnostics data. Examples of diagnostic dumps include a JVM thread dump, JVM class histogram dump, and DMS metric dump. For a list of diagnostic dumps, see Table 12-7.

12.1.2.3 Management MBeans

The Diagnostic Framework provides MBeans that you can use to configure the Diagnostic Framework. For example, you can enable or disable flood control and you can configure how many incidents with the same problem key can occur within a specified time period. For information about using the management MBeans to configure the Diagnostic Framework, see Section 12.3.

You can also use the MBeans to query and create incidents, discover the list of available diagnostic dump types, and execute individual diagnostic dumps.

12.1.2.4 WLST Commands for Diagnostic Framework

The Diagnostic Framework provides WLST commands that you can use to view information about problems and incidents, create incidents, execute specific dumps and query the set of diagnostic dump types. For more information, see:

To use the custom WLST Diagnostic Framework commands, you must invoke the WLST script from the Oracle Common home. See Section 2.4.2 for more information.

12.1.2.5 ADRCI Command-Line Utility

The ADR Command Interpreter (ADRCI) is a utility that enables you to investigate problems, and package and upload first-failure diagnostic data to Oracle Support, all within a command-line environment. ADRCI also enables you to view the names of the dump files in the ADR, and to view the alert log with XML tags stripped, with and without content filtering.

ADRCI is installed in the following directory:

(UNIX) ORACLE_HOME/bin
(Windows) ORACLE_HOME\bin

See the following sections for information about using the ADRCI command-line utility:

Figure 12-2 shows the interaction when the incident is detected by the incident log detector. It shows the interaction among the incident log detector, the WLDF Diagnostic Image MBean, ADR, and component or application dumps when an incident is detected by the incident log detector.

The incident detection log filter is initialized with component and application diagnostic rules.

An application or component logs a message using the java.util.logging API.

The ODL log handler passes the message to the incident detection log filter.

The incident log detection filter inspects the log message to see if an incident should be created, basing its decision on the diagnostic rules for the component. If the diagnostic rule indicates that an incident should be created, it creates an incident in the ADR.

The ODL log handler writes the log message to the log file, and returns control to the application.

The ODL log handler writes the log message to the log file, and returns control to Oracle WebCenter Portal.

When an incident is created, a message, similar to the following, is written to the log file:

The Diagnostic Framework executes the diagnostic dumps that are indicated by the diagnostic rules for the component.

The Diagnostic Framework writes the dumps to ADR, in the directory created for the incident.

The Diagnostic Framework invokes the WLDF Diagnostic Image MBean requesting that a Diagnostic Image be created in ADR.

WLDF writes the Diagnostic Image to ADR.

Figure 12-3 shows the interaction when an incident is detected by the WLDF Watch and Notification system. It shows the interaction among the incident notification listener, the WLDF Watch and Notification system, and the WLDF Diagnostic Image MBean.

The incident notification listener is initialized with component and application diagnostic rules.

Oracle Fusion Middleware Diagnostic Framework registers a JMX notification listener with WLDF. The listener listens for events from the WLDF Watch and Notification system. It only processes notifications of type oracle.dfw.wldfnotification.

Something in the system causes the configured WLDF watch to be triggered, causing a notification to be sent to the incident notification listener. The notification includes event information describing the data that caused the watch to trigger.

The Diagnostic Framework creates an incident in ADR.

The Diagnostic Framework executes the diagnostic dumps that are indicated by the diagnostic rules.

The Diagnostic Framework writes the dumps to ADR, in the directory created for the incident.

The Diagnostic Framework invokes the WLDF Diagnostic Image MBean requesting that a Diagnostic Image be created in ADR.

WLDF writes the Diagnostic Image to ADR.

12.3 Configuring the Diagnostic Framework

You can configure some settings for the Diagnostic Framework. In addition, you can configure an WLDF Watch and Notification to create an incident. The following topics describe how to configure the Diagnostic Framework:

Table 12-1 shows the attributes for the DiagnosticConfig MBean and a description of each parameter.

Table 12-1 DiagnosticConfig MBean Attributes for Diagnostic Framework

Attributes

Description

DumpSamplingIdleWhenHealthy

Determines whether dump sampling is active when the system is healthy. By default, this is set to true, which means that dump sampling is not active until an incident occurs.

DumpSamplingMinimumHealthyPeriod

The amount of time in seconds that the dump sampling is active after an incident occurs. The default is 259200 seconds (72 hours).

floodControlEnabled

Enables or disables flood control. Specify true for enabled or false for disabled. The default is true.

Note that flood control does not apply to manually created incidents.

floodControlIncidentCount

Sets the number of incidents with the same problem key that can be created within the time period, specified by floodControlIncidentTimeoutPeriod, before they are controlled by flood control. The default is 5.

When flood control is enabled, if the number of incidents with the same problem key exceeds this count, no incidents are created, but the Diagnostic Framework writes a message at the WARNING level to the log file.

floodControlIncidentTimeoutPeriod

Sets the time period in which the number of incidents, as specified by floodControlIncidentCount, with the same problem key can be created before they are controlled by flood control. The default is 60 minutes.

incidentCreationEnabled

Enables or disables incident creation. Specify true for enabled or false for disabled. The default is true.

logDetectionEnabled

Enables or disables the detection of incidents through the log files. Specify true for enabled or false for disabled. The default is true.

maxTotalIncidentSize

Sets the maximum total size that is allocated for all incidents. When the limit is reached, the oldest incidents are purged until the space used by all incidents is less than the amount specified by this parameter.

The default is 500 MB. The limit may be exceeded during the creation of an incident, but when the incident creation completes, the oldest incidents are purged.

reservedMemoryKB

The amount of reserved memory that is released when OutOfMemoryError is detected.

When the Diagnostic Framework starts, it allocates 512 KB of memory for its own private use. When the Diagnostic Framework detects that an OutOfMemoryError has occurred in the server, it frees that block of memory and proceeds to create the incident.

The default is 512 KB.

uncaughtExceptionDetectionEnabled

Enables the Java-based uncaught exception handler. When enabled and an uncaught exception is detected, an incident is created. Specify true for enabled or false for disabled.

The default is true.

useExternalCommands

Indicates whether external JVM commands should be used to perform thread dumps. Specify true for enabled or false for disabled. The default is true.

The following example shows how to configure these settings using the Fusion Middleware Control System MBean Browser:

From the WebLogic Domain menu, choose System MBean Browser.

The System MBean Browser page is displayed.

Expand Application Defined Beans, then oracle.dfw, then domain.domain_name, then dfw.jmx.DiagnosticsConfigMBean.

Select one of the DiagnosticConfig entries. There is one DiagnosticConfig entry for each server.

In the Application Defined MBean pane, expand Show MBean Information to see the server name.

To change the values for the attributes listed in Table 12-1, enter or select the value in the Value field.

Click Apply.

12.3.2 Configuring Custom Diagnostic Rules

You can configure custom diagnostic rules that apply to a domain, a server, or an application in a domain or server.

You create the custom diagnostic rules by creating an .xml file with a particular format, which is shown in the example later in this section. You must save the file to one of the following locations:

For rules that apply to the entire domain:

DOMAIN_HOME/config/fmwconfig/dfw

For rules that apply to a particular server:

DOMAIN_HOME/config/fmwconfig/servers/server_name/dfw

The file name must use the following format:

name.xml
appname#name.xml

In the format, appname is the name of the application to which the rule applies. The appname must be the exact name of the deployed application. name is the name of the rule you specify. If you do not specify appname, the rules will apply to the entire server. For example, the following rule applies to the application myApp:

myApp#custom_rule.xml

The custom diagnostic rules file can contain the following types of elements to define the rule:

Log detection conditions, which is optional

You can define a set of conditions, in the logDetectionConditions element, to check for in the diagnostic logs applicable to the server or to the specified application against which that the rules are registered. When a log message matching the condition is detected, an incident is created, capturing diagnostics that will help identify the problem. By default, all INCIDENT_ERROR messages are detected and an incident created for them. In addition, specific components may have configured rules to detect specific messages.

The following example shows a fragment of a custom diagnostic rules file that defines four log detection conditions. If one or more of the conditions are true, an incident is created.

You can define processing rules that are evaluated when either the server or application rules are involved in incident creation. For example, if the application MyApp is involved in incident creation, any rules associated with the MyApp application are evaluated. In all cases, server-wide rules are evaluated regardless of the application.

Processing rules consist of two parts:

Default actions, which are optional. If they are present, they are always executed during incident creation. The actions are a list of diagnostic dumps to execute, along with optional arguments.

See Table 12-3 for a description of the optional arguments that you can use.

Condition-based actions, which are executed only if the condition evaluates to true. Each <rule> element consists of a name attribute, along with a child <ruleCondition> element and a child <ruleActions> element. The <ruleActions> element contains one or more dumpAction elements. See Table 12-4 for a list of the <ruleCondition> element attributes.

If multiple <condition> elements are specified in a single <rule> element, the dumpAction is executed only if all conditions evaluate to true.

The following shows an example of a condition-based action rule. If the MESSAGE_ID is DFW-99997, the condition evaluates to true and the jvm.classhistogram dump is executed.

Load the rules, using the WLST command reloadCustomRules. The following example loads the rule customrules.xml, which applies to the application myApp:

reloadCustomRules(name='myApp#customrules.xml')

You can reload all the rules in the domain or all the rules that pertain to a particular server. The following example reloads all the rules for the server wls_server1:

reloadCustomRules(server='wls_server1')

For more information about the reloadCustomRules command, see "reloadCustomRules" in the WLST Command Reference for Infrastructure Components.

12.3.3 Configuring Problem Suppression

In certain situations, you may want to suppress the creation of incidents based on a particular problem key. For example, in a development environment, when you are developing a servlet, you may generate high number of uncaught exceptions as you refine the code. This results in the creation of unnecessary incidents.

The Diagnostic Framework allows you to configure problem suppression filters so that problems that match the filter criteria do not result in the creation of an incident.

When you configure a problem suppression filter, you use a regular expression that represents a pattern that you want to match. The regular expression is matched using the java.util.regex class. For example:

The following regular expression matches any incident with a problem key that starts with MDS-5000.

MDS-5000.*

The following regular expression matches any problem with the text OutOfMemory. Because the regular expression is case-sensitive, it will not match problems with the text outofmemory.

.*OutOfMemory.*

You can add and remove filters and get a list of filters or the detail of one filter using the DiagnosticConfig MBean.

Table 12-5 shows the operations and attribute for the configuring problem suppression filters and a description of each.

For Value, enter a regular expression that represents a pattern that you want to match pattern. For example, in a development environment, you might want to add a filter so that incidents are not created when java.lang.IllegalStateException Java Exceptions are reported. In that case, enter the following:

".*[java.lang.IllegalStateException].*"

Click Invoke.

Click Return to return to the Application Defined MBeans page.

You can delete the filters using the removeProblemKeyFilter operation.

You can retrieve a specific filter, passing the ID of the filter to the getProblemKeyFilter operation.

Alternatively, you can retrieve a list of the filters using the getProblemKeyFilters attribute:

From the WebLogic Domain menu, choose System MBean Browser.

The System MBean Browser page is displayed.

Expand Application Defined Beans, then oracle.dfw, then domain.domain_name, then dfw.jmx.DiagnosticsConfigMBean.

Select one of the DiagnosticConfig entries. There is one DiagnosticConfig entry for each server.

In the Application Defined MBeans pane, select the Attributes tab.

Click ProblemKeyFilters.

The list of problem suppression filters is displayed.

12.3.4 Configuring WLDF Watch and Notification for the Diagnostic Framework

Oracle Fusion Middleware configures a WLDF Diagnostics Module that contains a set of Watch and Notification rules for detecting a specific set of critical errors and creating an incident for each occurrence of those errors. The module is called Module-FMWDFW and contains the following set of Watch conditions:

Name

Description

Deadlock

Two or more Java threads have circular lock chains among their Java Monitor object usage.

StuckThread

An Oracle WebLogic Server ExecuteThread, which is blocked or busy for more than the time specified by the Oracle WebLogic Server StuckThreadMaxTime parameter.

UncheckedException

This category includes all Unchecked Exception, RuntimeException, and Errors caught by the Oracle WebLogic Server ExecuteThread, such as NullPointerException, StackOverflowError, or OutOfMemoryError.

The Diagnostic Module also includes a configured WLDF JMX Notification FMWDFW-notification of type oracle.dfw.wldfnotification. You can reuse this WLDF JMX Notification for your own WLDF Watch conditions to create an incident:

12.4 Investigating, Reporting, and Solving a Problem

This section describes how to use WLST and ADRCI commands and Remote Diagnostic Agent (RDA) to investigate and report a problem (critical error), and in some cases, resolve the problem. The section begins with a roadmap that summarizes the typical set of tasks that you must perform. It describes the following topics:

You notice that the system, component, or application is not functioning as expected. For example, you notice that there is a performance problem or users have reported that the application that they are trying to access is reporting errors.

Check to see if a problem and an incident have been created that may be related to the symptoms you are observing:

View the set of problems by using the WLST listProblems command, as described in Section 12.4.2.1.

If a problem has been created, list the incidents related to the specific problem using the listIncidents command, as described in Section 12.4.2.2.

If an incident has not been created, go to Step 4. If an incident has been created, go to Step 5.

If you do not see any incidents listed that are related to your problem, you can create an incident manually using the createIncident command to capture diagnostics for the problem.

Consider creating an incident when you encounter an issue, such as software failure or performance problem, and you want to gather more diagnostic data. You can view the log files and the messages in the files. If there is a specific message that you believe is related to the issue you are seeing, you can use the message ID in the createIncident command.

View the details of the specific incident using the showIncident command, as described in Section 12.4.2.2. This command lists information about the incident, including the related message ID, the time of the incident, the ECID, and the files generated by the incident.

Use the getIncidentFile command to view the contents of files for the incident, as described in Section 12.4.2.2. The contents may provide information to guide you to the source of the problem and help in resolving it.

If the contents of the files for the incident do not help you to resolve the problem, you can execute additional dumps to view detailed diagnostics. For example, if you are experiencing performance problems, execute the dms.metrics dump. See Section 12.4.4 for information about the dumps available and how to execute them.

If you still cannot resolve the problem, package the incident, along with the RDA report, and send them to Oracle Support. See Section 12.4.6.3 and Section 12.4.7 for information about packaging incidents and generating RDA reports.

12.4.2 Viewing Problems and Incidents

You can view the set of problems, the list of incidents, and the details of a particular incident using the WLST command-line utility, as described in the following topics:

12.4.2.3 Querying Incidents

While the listIncidents command shows you the incidents related to a particular problem ID, or for a particular server, it does not allow you to restrict the list further. The WLST queryIncidents command lets you query for the value of particular attributes across one or more servers, or all servers in a domain. For example, you can query by the time of incident creation or the ECID.

An expression contains an incident attribute, an operator, and a string, in the following format:

attribute operator "string"

You can combine query expressions with the Boolean operators AND or OR, and group them by parentheses ().

The following incident attributes are supported:

TIMESTAMP: Incident creation time. You can use the from and to operators to specify a time range. The date format is YYYY-MM-DD HH:MM.

ECID: Execution Context ID

PROBLEM_KEY: Problem Key

MSG_FACILITY: The error message facility, such as ORA or OHS.

MSG_NUMBER: The error message ID, such as 600.

Custom incident attributes are also supported. For example, TRACEID, APP, URI, AND DSID are supported. In addition, the context values, as shown in the incident readme.txt file, are supported. For example, DFW_APP_NAME and DFW_USER_NAME are supported.

The following operators are supported:

equals

notEqual

startsWith

endsWith

contains

isNull

notNull

For example, you can query all incidents in all servers in the domain for the ECID f19wAgN000001:

queryIncidents(query="ECID equals f19wAgN000001")

The following example queries all incidents that occurred between April 1, 2013 and April 15, 2013, for the server wls_server_1:

For more information about this command, see queryIncidents in the WLST Command Reference for Infrastructure Components.

12.4.3 Analyzing Specific Problem Keys

The Diagnostic Framework provides a set of well-defined problem keys for unhandled exceptions. These exceptions are either detected through the existing WLDF Watch "UncheckedException" or through the Diagnostic Framework java.lang.Thread.UncaughtExceptionHandler uncaught exception handler. Previously, the Diagnostic Framework generated problem keys with different formats for the same type of issues. Table 12-6 describes these problem keys and how to use them to investigate a problem.

Table 12-6 Uncaught Exception Problem Keys

Exception

Problem Key

Description

java.lang.OutOfMemoryError

DFW-99997 [java.lang.OutOfMemoryError]

Used by all java.lang.OUtOfMemoryError incidents. With each incident of this type, a jvm.classhistogram dump is executed. The dump captures statistics about the instances of classes that have been loaded and the counts of associated Objects.

Review the contents of this dump for a good starting point for understanding what has been loaded into the JVM's memory. In addition, the dms.metrics dump records statistics about the overall JVM memory.

Used for all exceptions of type java.sql.SQLException, including its subclasses. The Diagnostic Framework attempts to extract the Oracle error code from the exception error message, and if it is successful, uses that in the problem key. If not, it uses the exception name.

Review the text associated with the exception to get more details, such as the operation that could not be performed on the database. In addition, you can review the SQL error code details for additional information.

All others

DFW-99998 [exception-name][package.class.name][app-name]

Used by all other types of exceptions, such as java.lang.NullPointerException, java.io.IOException, java.lang.StringIndexOutOfBoundsException, that are not handled in a unique way.

Review the text associated with the exception to get more details, such as the reason for the failure. The source line in the problem key is a best-attempt indicator of the location of the failure.

12.4.4 Working with Diagnostic Dumps

If you suspect a problem, you can make use of the built-in diagnostic dumps to report detailed diagnostics that can help diagnose the problem. Diagnostic dumps provide a means to output and record diagnostics data which serve as valuable information when diagnosing issues with Oracle Fusion Middleware components, applications, and infrastructure. The output from these dumps is intended to be used by customers and Oracle Support to diagnose issues with Oracle Fusion Middleware.

Diagnostic dumps are executed in the following ways:

Manually, using WLST commands, as described in the following sections

For example, if your Java EE application is hanging and you suspect a deadlock, you could use the jvm.threads dump to obtain the set of threads.

Automatically, when the Diagnostic Framework detects a critical error and creates an incident or when the administrator creates an incident

12.4.4.1 Listing Diagnostic Dumps

You can find a list of diagnostic dumps that are available for a Managed Server by executing the WLST listDumps command, using the following format:

listDumps([appName] [,server])

For example, to list the available dumps for wls_server1:

listDumps(server='wls_server1')
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
dfw.samplingArchive
dms.configuration
dms.ecidctx
dms.metrics
http.requests
jvm.classhistogram
jvm.threads
mds.MDSInstancesDump
odl.activeLogConfig
odl.logs
odl.quicktrace
opss.diagTest
opss.identityStoreUserRoleApiConfig
opss.securityContext
wls.image
Use the command describeDump(name=<dumpName>) for help on a specific dump.

Table 12-7 lists the diagnostic dump actions that are defined by Oracle Fusion Middleware and their descriptions.

Table 12-7 Diagnostic Dump Actions

Dump Action

Description

dms.ecidctx

The data associated with a specific Execution Context ID (ECID), if specified. Otherwise, the data associated with all available ECIDs.

A JVM class histogram, the output of which varies depending on the JVM vendor.

jvm.flightRecording

The active JRockit Flight Recorder recording.

jvm.threads

Summary statistics about the threads running in a JVM as well as performing a full thread dump.

mds.MDSInstancesDump

Information about each MDS instance in the current JVM.

odl.activeLogConfig

The active Java logging configuration.

odl.logs

Contents of diagnostic logs, correlated by ECID or time range.

odl.quicktrace

Quick trace messages.

wls.image

The WLDF server image dump.

12.4.4.2 Viewing a Description of a Diagnostic Dump

You can view a description of a particular dump, including the syntax for executing the dump by using the WLST describeDump command. You specify the name of the dump in which you are interested. For example, to view a description of the dms.metrics dump, use the following command:

12.4.4.3 Executing Dumps

If you detect a problem and want to gather additional diagnostic data, you can invoke the executeDump command for a specified dump. Each dump may have mandatory or optional arguments, or both. To view the arguments for a particular dump and how to specify them, use the describeDump command, as described in Section 12.4.4.2.

The following example executes the dump with the name dms.metrics and the incident ID 1 and writes it to the file dumpout.txt:

The command writes the dump output to the information about incident 1. If you execute the showIncident command for incident 1, the output includes dms_metrics1_i1.dmp.

12.4.5 Configuring and Using Diagnostic Dump Sampling

Diagnostic dump sampling captures the output of diagnostic dumps at specified intervals. By sampling at regular intervals, diagnostic dump sampling can help to reveal issues such as slow running web requests, and where work is being performed in those requests.

12.4.5.1 Understanding Diagnostic Dump Sampling

All diagnostic dump samplings are performed in the background, at specified intervals. By default, jvm.threads and jvm.classhistogram dumps are configured for sampling. However, they are not active until an incident is generated. Then, they remain active for 72 hours, by default.

You can modify the settings for the default dump samplings and you can create new sampling definitions for the dump actions listed in Table 12-7 and for any application-specific dumps. You can configure multiple sampling definitions for the same diagnostic dump, specifying different settings, such as sampling interval or server.

For each diagnostic dump sampling, the Diagnostic Framework stores the specified number of samples. When that limit is reached, the oldest sample is purged. All samples are purged when the server shuts down.

Table 12-8 shows the settings of the dump samplings that are configured by default.

Table 12-8 Default Diagnostic Dump Samplings Configuration

Dump Name

Sampling Interval

Maximum Samples Stored

jvm.threads

60 seconds

10

jvm.classhistogram

30 minutes

5

The Diagnostic Framework triggers the retrieval of the dump samples whenever an incident is created (through error detection or manual incident creation.) In addition, you can retrieve the contents of the dump samples, as described in Section 12.4.5.4.

You can retrieve the dump sample archives in either text or zip files:

Text: By default, the diagnostic dump samples are concatenated into a single archive file, in text format. An ASCII header an footer are wrapped around each sample in the archive file. The header contains a timestamp and the name of the diagnostic dump that produced the sample. Both the header and footer contain the number of the samples in the archive and the number of the particular sample. For example:

Zip: You can configure diagnostic dump samplings to return a zip file instead of a concatenated file. The zip file contains all available dump sample files. This format supports any diagnostic dumps whose outputs are in binary format not suitable for concatenation, as well as for dumps that generate output in text format. This format also reduces the size of the archive containing the samples.

In addition to a text or zip file, when you retrieve a dump sample, the Diagnostic Framework generates a readme file. The readme file either lists the line numbers for each dump sample in the archive (for text format) or the individual sample file names (for zip format). It also lists the timestamp for each sample and the index for the archive.

The dump sample files are named using the following format:

dfw_dumpArchivennn.Sampling_Name.{txt]|zip}

In the format nnn is a unique number assigned by the Diagnostic Framework.

For example, the following is an example of the name of a dump sample file for JVMThreadDump:

dfw_dumpArchive17394218037.JVMThreadDump.txt

The readme files are named using the following format:

dfw_dumpArchivennn.readme.txt

In the format nnn is a unique number assigned by the Diagnostic Framework.

All samplings are scheduled to begin at the next nearest interval, corresponding to the frequency. For example, if a sampling is configured at 12:05:13 PM and the frequency is 5 seconds, the sample will be collected at 12:05:15 PM. This ensures that the collection of a series of samplings with the same frequency will occur at the same time. It also aligns all samples across machines, assuming their system clocks are synchronized.

Note:

You must be connected to the Administration Server to execute the WLST dump sampling commands.

12.4.5.2 Configuring Dump Sampling

You can create additional dump samplings, update existing dump samplings, remove dump samplings and enable or disable dump sampling, as described in the following topics:

12.4.5.2.1 Activating the Default Samples

By default the jvm.threads and jvm.classhistogram dumps are not activated until an incident occurs. Then, they are active for 72 hours, by default.

You can change the behavior so that the dumps are active even if an incident has not occurred by setting the value of the MBean DumpSamplingIdleWhenHealthy to false.

To change the amount of time used for determining the system's health, change the value of the DumpSamplingMinimumHealthyPeriod MBean.

For information about changing the value of the Diagnostic Framework MBeans, see Section 12.3.1

12.4.5.2.2 Creating Dump Samplings

You can create dump samplings for any dump listed in Table 12-7 and for any application-specific dumps. To create dump samplings, use the WLST command addDumpSample. The addDumpSample command uses the following syntax:

12.4.5.3 Listing Dump Samplings

You can list dump samplings using the WLST command listDumpSamples. You can list all dump samplings, a specified dump sampling, or all dump samplings associated with a specified server. The listDumpSamples command uses the following syntax:

listDumpSample([sampleName="sample_name",] [server="server_name"])

For example, to list all dump samplings associated with the server wls_server1:

12.4.5.4.1 Retrieving Dump Samples Using the executeDump Command

You can retrieve dump samples using the WLST executeDump command, specifying the dfw.samplingArchive dump. This command collects all default sample archives and any dump samples that are specified with the parameter dumpImplicitly=true from a temporary location and concatenates them into a single file. The command also returns a readme file, with details of the dump samples.

When you use the executeDump command, you use the following syntax:

executeDump(name="dfw.samplingArchive",outputFile="filename"

For the outputFile parameter, you can specify a text file or a zip file. If you specify a zip file, you must use the argument zipOutput=true.

For any dump sampling that is configured with the parameter dumpImplicitly=false, you must specify the optional dfw.samplingArchive argument sampleName to collect the contents of those dump samples. For example:

You can retrieve dump samples using the WLST getSamplingArchives command. This command collects all dump samples in a zip file containing the individual dump sample files and a readme file. This method is particularly useful in dealing with binary format dumps.

For complete syntax, see "getSamplingArchives" in the WLST Command Reference for Infrastructure Components.

12.4.6 Managing Incidents

The Diagnostic Framework stores incidents, whether they are created automatically or manually, and Oracle Fusion Middleware provides tools to help you process incident reports and to package those incidents to send to Oracle Support. The following sections describe:

12.4.6.1 Creating an Incident Manually

System-generated problems—critical errors generated internally—are automatically added to the Automatic Diagnostic Repository (ADR). You can gather additional diagnostic data on these problems, upload diagnostic data to Oracle Support, and in some cases, resolve the problems, all with the workflow that is explained in Section 12.4.

Consider creating an incident manually when you encounter an issue, such as software failure or performance problem and you want to gather more diagnostic data, but the Diagnostic Framework has not automatically created an incident.

You use the WLST command createIncident to create an incident manually. You can specify an incident based on time, a message ID, an impact area, or an ECID. Then, you can inspect the content of the incident or send it to Oracle Support for further analysis.

For example, to manually create an incident based on a message ID:

Search the log files, as described in Section 11.3.2. If you find a message that you suspect is related to the issue you are seeing, you can use the message ID when you create the incident.

Use the following commands to invoke WLST, connect to the Managed Server and navigate to the Managed Server instance:

For example, to create an incident based on the error with the message ID MDS-50500, use the following command, specifying the message ID, and provide a description of the incident to help you and Oracle support track the incident:

If you do not specify the adrHome option, the incident is created in the server to which you are connected. For example, if you are connected to the Administration Server, the incident is created in the adrHome for the Administration Server.

The Diagnostic Framework evaluates the command and invokes the appropriate diagnostic dumps. The incident and the diagnostic dumps are written to the ADR. Each diagnostic dump writes its output to the incident.

You can view the information about the incident, as described in Section 12.4.2.2.

You can view the information in the dumps, as described in Section 12.4.4.

12.4.6.2 Creating an Aggregated Incident

If you have several incidents and want to combine them into a single incident, you can use the WLST createAggregatedIncident command. For example, if you used selective tracing, the resulting incidents containing the trace data may be generated on multiple servers. With the createAggregatedIncident command, you can generate an aggregated incident that meets criteria you specify. The original incidents are untouched. That is, the aggregated incident contains a copy of the incident files from the queried incidents.

The aggregated incidents are created on the Administration Server host, but they can contain incidents from one or more servers or all servers in the domain.

You construct a query using an expression that contains an incident attribute, an operator, and a string, in the following format:

attribute operator "string"

You can combine query expressions with the Boolean operators AND or OR, and group them by parentheses ().

For information about the supported attributes and operators, see "createAggregatedIncident" in the WLST Command Reference for Infrastructure Components.

Each aggregated incident will contain a zip file for each incident returned from the query, as well as descriptive text detailing the query used and the details of each incident.

For example, to create an aggregated incident for all incidents that contain the ODL_TRACE_ID of 123456 on the server wls_server1:

12.4.6.3 Packaging an Incident

You can package the incident to facilitate sending the information to Oracle Support by using the ADR Command Interpreter (ADRCI). The ADRCI utility enables you to investigate and report problems in a command-line environment. With ADRCI, you can package incident and problem information into a zip file for transmission to Oracle Support.

The package is denoted as logical because it exists only as metadata in the ADR. It has no content until you generate a physical package from the logical package. The logical package is assigned a package number, and you refer to it by that number in subsequent commands.

You can create the logical package as an empty package, or as a package based on an incident number, a problem number, a problem key, or a time interval. If you create the package as an empty package, you can add diagnostic information to it in step 2.

Creating a package based on an incident means including diagnostic data, such as dumps, for that incident. Creating a package based on a problem number or problem key means including in the package diagnostic data for incidents that reference that problem number or problem key. Creating a package based on a time interval means including diagnostic data on incidents that occurred in the time interval.

Add diagnostic information to the package.

If you created a logical package based on an incident number, a problem number, a problem key, or a time interval, this step is optional. You can add additional incidents to the package or you can add any file within the ADR to the package. If you created an empty package, you must use ADRCI commands to add incidents or files to the package.

Generate the physical package.

When you submit the command to generate the physical package, ADRCI gathers all required diagnostic files and adds them to a zip file in a designated directory. You can generate a complete zip file or an incremental zip file. An incremental file contains all the diagnostic files that were added or changed since the last zip file was created for the same logical package. You can create incremental files only after you create a complete file, and you can create as many incremental files as you want. Each zip file is assigned a sequence number so that the files can be analyzed in the correct order.

Zip files are named according to the following format:

packageName_mode_sequence.zip

In the format:

packageName consists of a portion of the problem key followed by a timestamp.

mode is either COM or INC, for complete or incremental.

sequence is an integer.

For example, to package an incident, take the following steps:

Set the ORACLE_HOME and LD_LIBRARY_PATH environment variables as shown in the following example:

Optionally, you can add diagnostic information to the logical package. You can add the following types of information:

All diagnostic information for a particular incident. For example, you can add another incident that you think might be related to the incident you are packaging, using the following command:

IPS ADD INCIDENT incident_number PACKAGE package_number

A named file within the ADR. For example, if an incident is related to an application, you can add the .ear file for the application. You can also add a readme file with notes you provide to Oracle Support. For example, to add a file to the package, use the following command:

IPS ADD FILE filespec PACKAGE package_number

Generate the physical package using the following command:

IPS GENERATE PACKAGE package_number IN path

For example, to generate a package with the number 1, use the following command:

12.4.6.4 Purging Incidents

By default, incidents are purged when the total size of all incidents exceed 500 MB. You can use the maxTotalIncidentSize MBean parameter to change this value, as described in Section 12.3.1.

You can manually purge incidents using the ADRCI command. You can purge based on an ID or range of IDs, the age of the incident, or the type of incident. For example, to purge incidents that are older than 60 minutes, use the following command:

12.4.7 Generating an RDA Report

You can use the Remote Diagnostic Agent (RDA), a command-line diagnostic tool, to provide a comprehensive picture of your environment. Additionally, RDA can provide recommendations on various topics, for example configuration and security. This aids you and Oracle Support in resolving issues.

RDA is a set of command line diagnostic scripts that are executed by an engine written in the Perl programming language. RDA is used to gather detailed information about an Oracle environment; the data gathered is in turn used to aid in problem diagnosis. The output is also useful for seeing the overall system configuration.

RDA is designed to be as unobtrusive as possible; it does not modify systems in any way. A security filter is provided if required.

RDA collects information that is useful for troubleshooting issues in the following areas:

./rda.sh
-------------------------------------------------------------------------------
S000INI: Initializes the Data Collection
-------------------------------------------------------------------------------
RDA uses the output file prefix to identify all files belonging to the same
data collection. The prefix must start with a letter and must contain only
alphanumeric characters.
Enter the prefix to be used for all the generated files
Hit 'Return' to accept the default (RDA)
>
Enter the directory used for all the files to be generated
Hit 'Return' to accept the default
(/scratch/oracle1/Oracle/Middleware/Oracle_Home/oracle_common/rda/output)
>
Do you want to keep report packages from previous runs (Y/N)?
Hit 'Return' to accept the default (N)
>
Enter the Oracle home to be used for data analysis
Hit 'Return' to accept the default
(/scratch/oracle1/Oracle/Middleware/Oracle_Home)

For more information about RDA, see the readme file, which is located at:

12.5 Managing and Running the Health Test Framework

Oracle Fusion Middleware provides a Health Test Framework that includes diagnostic tests that are designed to exercise particular aspects of Oracle Fusion Middleware and its applications, to determine whether they are operating correctly and to help identify and resolve any problems.

12.5.1 Understanding the Health Test Framework

The Health Test Framework lets you execute diagnostic tests and collects the results into detailed diagnostic reports. The diagnostics tests are installed when you install or patch Oracle Fusion Middleware.

You can use the Health Test Framework to check normal system health and to troubleshoot system problems. You can configure your Oracle Fusion Middleware environment to run the diagnostic tests using the Health Test Framework command line interface.

A diagnostic test may or may not be associated with a particular error message. If an Oracle Fusion Middleware application handles a particular error in a way that triggers the creation of an incident, then any diagnostic tests that are associated with the error message for the incident run automatically. The test results are associated with the incident and the identity of the user who received the error message is recorded. The diagnostic tests and results are stored in file-based repository, as described in Section 12.5.2.

12.5.2 Understanding the Health Test Framework File Repository

The Health Test Framework stores tests and test results in a file-based repository. The repository has two primary stores:

12.5.3 Using the Health Test Framework Command Line

The Health Test Framework provides two command line interfaces, dfwhealthtestadminctl.sh for administration commands and dfwhealthtestctl.sh for execution commands, as described in the following sections:

12.5.3.1.2 register

The following table describes the parameters for the register command:

Parameter

Description

testfile

One or more XML test files to register. Provide the path to the files, using a comma-separated list for more than one file.

dir

One or more directories to register. Provide the path to the directories, using a comma-separated list for more than one directory. Use this option to register multiple tests from the same directory.

validateonly

Optional. A Boolean value to specify whether to only validate the test or to upload the test or tests to the repository. Value values are Y (to only validate the test) or N (to upload the tests).

testjar

The location of the test jar files.

12.5.3.1.3 index

Rebuilds the index for the testdef or testrun repository, using the data files in the repository.

The syntax is:

index [refresh={testdef|testrun}

The following table describes the parameters for the index command:

Parameter

Description

refresh=testdef

Refreshes the index for the testdef repository.

refresh=testrun

Refreshes the index for the testrun repository.

12.5.3.2 dfwhealthtestctl.sh Command Line

The Health Test Framework provides the dfwhealthtestctl.sh command line for running the health tests. With it, you can run tests, list runs and tests, get a description of a test, get the status of tests, and retrieve a report of a test or test run.

The name of the run. To get the name, use the listrun command. You must specify this parameter, runid, or execid.

runid

The ID of the run. To get the ID, use the listrun command. You must specify this parameter. runname, or execid.

execid

The execution ID of the run. To get the ID, use the listrun command You must specify this parameter, runname, or runid.

destdir

Optional. The destination directory to which the report files are written. If not specified, the report files are extracted under the java.io.tmpdir/user.name/diagfwk directory, where java.io.tmpdir and user.name are Java system properties.

format

The format of the generated report. Valid values are HTML and XML.

translate

A Boolean value specifying whether to translate the report. Value values are Y or N.

If you specify a single test name, you can also specify one or more input parameter names and values using the input parameter.

You must specify this parameter or the productcode parameter.

productcode

The code for one or more products that include the tests you want to run. Specify more than one product code in a comma-separated list.

runname

Optional. A name for the current run. If not specified, the command generates a default run name.

moninterval

The interval, in seconds, in which the status of the run is uploaded to the test repository. The default value is 30 seconds.

nthreads

The number of parallel threads that should be spawned to execute tests in this run. The default value is 5. Specifying a value of 1 for this parameter will execute the tests serially.

runoption

Optional. Options for running the tests. The valid value is asynch, which runs the test asynchronously in the background.

input

Optional. If you use this parameter, use one or more parameter name/ value pairs. For example:

domainhome=/scratch/oracle/domains/basedomain

You can only use this parameter when you run only one test.

inputfile

The path to a file containing input parameters. The file should have each input name/value pair on a separate line. The format of each line is:

input_param_name:input_param_value

contextfile

The path to a file that contains user system properties to be used at run time.

reportshowparam

Sets the input and output parameter display. By default all parameters are hidden during execution. To specify that the parameters are shown, use input or output, or a comma-separated string with both. For example:

reportshowparam=input,output

12.5.3.2.7 status

Get the status of a test run by specifying the run name, run ID, or execution ID.

To register more than one test using the dir parameter, you can specify one or more directories in a comma-separated list.

The following example registers all tests in the specified directory:

dfwhealthtestadminctl.sh register dir=/scratch/dtf_tests

12.5.4.2 Rebuilding the Health Test Framework Indexes

Indexes improve the speed of searching and querying the Health Test Framework repository. Indexes related to test definition are stored in the testdef file store. Indexes related to test runs and execution are stored in the testrun file store.

In some circumstances, you may want to refresh the indexes. You use the dfwhealthtestadminctl.sh index command, specifying the testdef or testrun file store. The following example refreshes the testdef file store:

dfwhealthtestadminctl.sh index refresh=testdef

12.5.5 Running Health Test Framework Diagnostic Tests

You run the Health Test Framework diagnostic tests using the dfwhealthtestctl.sh command line interface, which is located in:

ORACLE_COMMON_HOME/common/bin

To run a test, use the run command, using the format described in Section 12.5.3.2.6. For example, to run the test SampleTest, use the following command:

./dfwhealthtestctl.sh command
[testfile=SampleTest.xml]

You can run one or more tests at the same time:

To run one or more tests by specifying the test names in a comma-separated list:

./dfwhealthtestctl.sh run test=oracle.dfw.healthtest.test.sample.SampleTest2
Processing "run" command ...
Executing run ID "1340125981427" with name "TestRun_1340125981427" ...
sampleTest2 sleep for a while....
sampleTest2 done
Run ID "1340125981427" with name "TestRun_1340125981427" started at 06/21/2013
10:13:01 AM and completed at 06/21/2013 10:13:04 AM. No diagnostic issues were detected.

To run one or more tests by using wildcards for the test name:

./dfwhealthtestctl.sh run test=oracle.dfw.healthtest.test.sample.SampleTest*

To run all tests associated with a particular product:

./dfwhealthtestctl.sh run productcode=idm

If you are running only one test, you can specify input options either on the command line or in an input file:

To specify the input options on the command line, use the input: parameter:

12.5.6 Searching for Health Test Framework Diagnostic Tests

You can search for tests or runs using the dfwhealthtestctl.sh listtest command. Optionally, you can specify the name of the test or product code:

To search for all tests:

./dfwhealthtestctl.sh listtest

To search for one test named SampleTest:

./dfwhealthtestctl.sh listtest testname=SampleTest

To search for more than one test using wildcards:

./dfwhealthtestctl.sh listtest testname="S*"

To search for all tests related to a particular product:

dfwhealthtestctl.sh listtest productcode=idm

12.5.7 Retrieving a Description of a Health Test Framework Test

You can retrieve the description of a specified test using the dfwhealthtestctl.sh listtest command. For example, to get the description of the test SampleTest, along with its parameters, use the following command:

./dfwhealthtestctl.sh desctest testname="SampleTest" showparam=Y

12.5.8 Listing Health Test Framework Test Runs

You can query the results of test runs, by test name, run name, status, or time, using the dfwhealthtestctl.sh listrun command:

To query the results for a test run by specifying the test name:

./dfwhealthtestctl.sh listrun testname="SampleTest"

To query the results for a test run by specifying the run name:

./dfwhealthtestctl.sh listrun runname="run_1"

To query the results for a test run by specifying the status. For example, to get the results of all tests with a status of running:

./dfwhealthtestctl.sh listrun status=r

To query the results for test runs that were started in the last 2 hours:

./dfwhealthtestctl.sh listrun lasthours=2

12.5.9 Generating Health Test Framework Reports

You can generate reports of the test runs for the Health Test Framework using the dfwhealthtestctl.sh report command. You can generate HTML or XML reports.

You can specify the run name, run ID or execution ID>

For example, to generate a report in HTML format for the run with the run ID of 1330128064268:

dfwhealthtestctl.sh report runid=1330128064268 format=HTML

Scripting on this page enhances content navigation, but does not change the content in any way.