Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use oradebug short_stack and strace-p to analyze whether the oracle process is dead or malfunctioning

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces how to use oradebug short_stack and strace-p to analyze whether the oracle process is dead or malfunctioning. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

1. You can use oradebug or strace-p to track whether the background or foreground process resides in dead or hang.

2. If the process fails, the latest information will be written in the corresponding TRC file, based on which very important information can be obtained for further analysis and diagnosis.

The log file is in background_dump_dest

3. Use ll-lhrt * lgwr* | tail-10f to get the TRC file of the latest process

4, and when a fault occurs, most of the relevant information will be recorded in the ALERT log, which is an important and primary method and train of thought for troubleshooting.

5,oradebug setospid ospid

Oradebug short_stack

The stack information of the process will be displayed. Note: it can be run several times at intervals. If the stack information displayed many times is the same, you can be sure that the process must be dead or malfunctioning.

6. Strace-p ospid can be used for tracking and analysis.

-similar information in case of hang or failure is as follows

Semtimedop (9273344, 0x7fffe66199d0, 1, {1,0}) =-1 EAGAIN (Resource temporarily unavailable)

-similar information in normal times is as follows

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440015944

Semtimedop (9273344, 0x7fffe661b1f0, 1, {1, 800000000}) =-1 EAGAIN (Resource temporarily unavailable)

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016124

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016124

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016124

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016124

Semtimedop (9273344, 0x7fffe661b1f0, 1, {3,0}) =-1 EAGAIN (Resource temporarily unavailable)

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016424

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016424

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016424

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016424

Semtimedop (9273344, 0x7fffe661b1f0, 1, {3,0}) =-1 EAGAIN (Resource temporarily unavailable)

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016725

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016725

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016725

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440016725

Semtimedop (9273344, 0x7fffe661b1f0, 1, {3,0}) =-1 EAGAIN (Resource temporarily unavailable)

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Getrusage (RUSAGE_SELF, {ru_utime= {0, 123981}, ru_stime= {0, 132979},...}) = 0

Times ({tms_utime=12, tms_stime=13, tms_cutime=0, tms_cstime=0}) = 440017025

Open ("/ proc/4385/stat", O_RDONLY) = 35

Read (35, "4385 (oracle) S 1 4385 4385 0-1"...

To put it bluntly, it is to see whether the information has changed, and if there is a change, it means that the process is normal, otherwise it means it is abnormal.

test

SQL > select * from v$version where rownum=1

BANNER

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

View background processes

SQL > select pid,spid,pname,username from v$process order by 1

PID SPID PNAME USERNAME

one

2 4385 PMON oracle

3 4387 VKTM oracle

4 4391 GEN0 oracle

5 4393 DIAG oracle

6 4395 DBRM oracle

7 4397 PSP0 oracle

8 4399 DIA0 oracle

9 4401 MMAN oracle

10 4403 DBW0 oracle

11 4405 LGWR oracle

PID SPID PNAME USERNAME

12 4407 CKPT oracle

13 4409 SMON oracle

14 4411 RECO oracle

15 4413 MMON oracle

16 4415 MMNL oracle

17 4417 D000 oracle

18 4419 S000 oracle

19 4652 SMCO oracle

20 5266 W000 oracle

21 4936 oracle

27 4468 ARC0 oracle

PID SPID PNAME USERNAME

28 4481 ARC1 oracle

29 4486 ARC2 oracle

30 4489 ARC3 oracle

31 4496 QMNC oracle

32 4549 Q000 oracle

33 4551 Q001 oracle

34 4568 oracle

29 rows selected.

SQL >

-View the TRC file directory

[oracle@seconary trace] $ll-lhrt * lgwr* | tail-10f

-rw-r- 1 oracle oinstall 213 Dec 14 19:05 guowang_lgwr_5297.trm

-rw-r- 1 oracle oinstall 2.4K Dec 14 19:05 guowang_lgwr_5297.trc

-rw-r- 1 oracle oinstall 2.3K Dec 15 01:05 guowang_lgwr_22295.trm

-rw-r- 1 oracle oinstall 27K Dec 15 01:05 guowang_lgwr_22295.trc

-rw-r- 1 oracle oinstall 63 Dec 15 02:18 guowang_lgwr_31280.trm

-rw-r- 1 oracle oinstall 903 Dec 15 02:18 guowang_lgwr_31280.trc

-rw-r- 1 oracle oinstall 63 Dec 15 02:44 guowang_lgwr_32077.trm

-rw-r- 1 oracle oinstall 906 Dec 15 02:44 guowang_lgwr_32077.trc

-rw-r- 1 oracle oinstall 62 Dec 15 03:27 guowang_lgwr_1032.trm

-rw-r- 1 oracle oinstall 887 Dec 15 03:27 guowang_lgwr_1032.trc

-HANG LGWR

SQL > oradebug setospid 4405

Oracle pid: 11, Unix process pid: 4405, image: oracle@seconary (LGWR)

SQL > oradebug suspend

Statement processed.

-- ALERT records the above information synchronously

Tue Dec 15 04:46:15 2015

Unix process pid: 4405, image: oracle@seconary (LGWR) flash frozen [command # 1]

-TRC directory synchronously records the above information

[oracle@seconary trace] $ll-lhrt * lgwr* | tail-10f

-rw-r- 1 oracle oinstall 2.3K Dec 15 01:05 guowang_lgwr_22295.trm

-rw-r- 1 oracle oinstall 27K Dec 15 01:05 guowang_lgwr_22295.trc

-rw-r- 1 oracle oinstall 63 Dec 15 02:18 guowang_lgwr_31280.trm

-rw-r- 1 oracle oinstall 903 Dec 15 02:18 guowang_lgwr_31280.trc

-rw-r- 1 oracle oinstall 63 Dec 15 02:44 guowang_lgwr_32077.trm

-rw-r- 1 oracle oinstall 906 Dec 15 02:44 guowang_lgwr_32077.trc

-rw-r- 1 oracle oinstall 62 Dec 15 03:27 guowang_lgwr_1032.trm

-rw-r- 1 oracle oinstall 887 Dec 15 03:27 guowang_lgwr_1032.trc

-rw-r- 1 oracle oinstall 63 Dec 15 04:46 guowang_lgwr_4405.trm

-rw-r- 1 oracle oinstall 896 Dec 15 04:46 guowang_lgwr_4405.trc

[oracle@seconary trace] $

On how to use oradebug short_stack and strace-p to analyze whether the oracle process is dead or failure is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report