[Translated from mos] after removing the trace file from the OS, how can I find the trace file content ?, Mostrace

Source: Internet
Author: User

[Translated from mos] after removing the trace file from the OS, how can I find the trace file content ?, Mostrace

After removing the trace file from the OS, how can I find the content of the trace file?


Reference Original:

How to Find the Content of Trace File Generated for an Oracle Process after Removing the Trace File by Mistake at operating Level (Doc ID 805083.1)


Applicable:
Oracle Database-Enterprise Edition-Version 8.1.7.4 to 11.2.0.1.0 [Release 8.1.7 to 11.2]
Generic UNIX
Generic Linux


Objectives:

When the error trace file is removed from the OS level (this removal refers to rm), the trace file of the oracle process will not be re-created.

How can we see the contents of these trace files?

Solution:


The explanations and solutions for such behavior are as follows:
Bug 8367394: A NEW TRACE FILE IS NOT BEING CREATED IF THE INITIAL ONE WAS REMOVED

Given. ---> Note: I checked the workground of the bug, Which is restart instance.

In the following example, note that starting from 11 GB, the trace file is not stored in bdump, but in {ADR_HOME}/trace.

When the process is alive, the process will not execute the close () function on the trace file.
The process still holds the file descriptor pointing to the trace file.

The trace file name includes the pid of the process,
Therefore, unless the process is restarted, we cannot disable file descriptor or create a new file with a new or old file name.


This does not mean that in an emergency, you cannot access this trace file.
After the trace file is deleted, as long as the file descriptor is still open, you can get the content of the file and the content is still written normally.

Use the following method to access file through file descriptor:

Ps-ef | grep v10204 | grep dbw0
Oracle 11283 1 0? 00:00:00 ora_dbw0_v10204

Lsof-p 11283 | grep dbw0
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
Oracle 11283 oracle 2 REG 767 20728692/bdump/v10204_dbw0_11283.trc

From the above results, we can see that fd is 2, and the following can also verify that fd is 2

Ls-lA/proc/11283/fd | grep dbw0
L-wx ------ 1 oracle dba-64 Mar 25 2->/bdump/v10204_dbw0_11283.trc


Remove the trace file from the OS level. The fd still exists, but the file is deleted.

Ls-lA/proc/11283/fd | grep dbw0
L-wx ------ 1 oracle dba-64 Mar 25 2->/bdump/v10204_dbw0_11283.trc (deleted)

This fd (file descriptor) exists before it is closed or the process is restarted.
You can access its content:
Cat/proc/11283/fd/2>/tmp/v10204_dbw0_11283.trc




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.