Oracle7 Server Distributed Systems Volume I: Distributed Data
Troubleshooting
This section discusses how to find information in case of problems or system failure. It also discusses trace files and recovery of
pending transactions.
Trace Files
The Oracle XA library logs any error and tracing information to its trace file. This information is useful in supplementing the XA error codes. For example, it can indicate whether an xa_open failure is caused by an incorrect open string, failure to find the Oracle Server instance, or a login authorization failure.
The name of the trace file is:
xa_db_namedate.trc
where db_name is the database name you specified in the open string field DB=db_name, and date is the date when the information is logged to the trace file.
If you do not specify DB=db_name in the open string, it automatically defaults to the name "NULL".
The trace file can be placed in one of the following locations:
- The trace file can be created in the LogDir directory as specified in the open string.
- If you do not specify LogDir in the open string, then the Oracle XA application attempts to create the trace file in the $ORACLE_HOME/rdbms/log directory, if it can determine where $ORACLE_HOME is located.
- If the Oracle XA application cannot determine where $ORACLE_HOME is located, then the trace file is created in the current working directory.
Trace File Examples
Examples of two types of trace files are discussed below:
The example, xa_NULL040292.trc, shows a trace file that was created on April 2, 1992. Its DB field was not specified in the open string when the resource manager was opened.
The example, xa_Finance121591.trc, shows a trace file was created on December 15, 1991. Its DB field was specified as "Finance" in the open string when the resource manager was opened.
Note that multiple Oracle XA library resource managers with the same DB field and LogDir field in their open strings log all trace information that occurs on the same day to the same trace file.
Each entry in the trace file contains information that looks like this:
1032.12345.2: xa_switch rtn ORA-22
where "1032" is the time when the information is logged, "12345" is the process ID (PID), "2" is the resource manager ID, xa_switch is the module name, and ORA-22 is the Oracle Server information that was returned.
In-doubt or Pending Transactions
In-doubt or pending transactions are transactions that have been prepared, but not yet committed to the database.
Generally, the transaction manager provided by the TPM system should resolve any failure and recovery of in-doubt or pending transactions. However, the DBA may have to override an in-doubt transaction in certain circumstances, such as when the in-doubt transaction is:
- locking data that is required by other transactions
- not resolved in a reasonable amount of time
For more information about overriding in-doubt transactions in the circumstances described above, or about how to decide whether the in-doubt transaction should be committed or rolled back, see your
TPM documentation.
Additional Information: For more information on pending transactions, see Chapter 5.
Oracle Server SYS Account tables
There are two tables under the Oracle Server SYS account that contain transactions generated by regular Oracle Server applications and Oracle XA applications. They are DBA_2PC_PENDING and DBA_2PC_NEIGHBORS
For transactions generated by Oracle XA applications, the following column information applies specifically to the DBA_2PC_NEIGHBORS table.
- the DBID column is always xa_orcl
- the DBUSER_OWNER column is always db_namexa.oracle.com
Remember that the db_name is always specified as DB=db_name in the open string. If you do not specify this field in the open string, then the value of this column is NULLxa.oracle.com for transactions generated by Oracle XA applications.
For example, you could use the SQL statement below to obtain more information about in-doubt transactions generated by Oracle
XA applications.
SELECT * FROM DBA_2PC_PENDING p, DBA_2PC_NEIGHBORS n
WHERE p.LOCAL_TRAN_ID = n.LOCAL_TRAN_ID
AND
n.DBID = 'xa_orcl';