cancel
Showing results for 
Search instead for 
Did you mean: 

oradebug setospid ?

Former Member
0 Kudos

Hello

Does anyone has experience with oradebug.

Namely I can not stop DB and I guess the reason is an Oracle process running at 100 % CPU.

I think I should issue something like "oradebug setospid 11287" where 11287 is PID at OS level.

I guess (based on  note 613872) then I would get detailed trace log in working directory.

However I do not find "oradebug" anywhere on machine.

Has anyone some idea where to find "oradebug" and is the command I would issue correct

Thx in advance

Jan

Accepted Solutions (1)

Accepted Solutions (1)

stefan_koehler
Active Contributor
0 Kudos

Hi Jan,

> Does anyone has experience with oradebug

For sure

> However I do not find "oradebug" anywhere on machine.

Oradebug is a utility within SQL*Plus, so you can not find it anywhere on your server. You have to login via SQL*Plus and then you can use oradebug. This can be tricky sometimes (especially in hanging situations), but there is a prelim option for such situations as well.

> I think I should issue something like "oradebug setospid 11287" where 11287 is PID at OS level.

Depends on what you want to trace / debug. For example system state dumps can be created with any attached process, but stack traces are OS process dependent.

I have written several blog posts about several scenarios:

> Namely I can not stop DB and I guess the reason is an Oracle process running at 100 % CPU.

How do you try to shutdown the database? Is it the SMON process, that is running on CPU by chance?

Regards

Stefan

Former Member
0 Kudos

Hello Stefan

Thank you a lot. Unfortunatelly i am not so into deep in Oracle as you are.

My problem essentially is :

When trying restart an R3  system yesterday, the database
did not get down.

What I wander is that an oracle process i.e.

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU

COMMAND

20 ? 20229 orapr3 236 20 22836M 8724K run 16234:16 100.04 99.86

oraclePR3

is blocking restart. This process was hanging when trying to shutdown

I closed putty session and started system in a new session as productive time was closer and closer.

Could you let me know if I can in that situation kill that process

without threaten consistancy. Also I am afraid this proces could

influence system responsiveness in next productive days

That is why I tried with oradebug (but I do not get the log file parteinig to oradebug) when performing:

oradebug setospid 20229

from sqlplus. What should be done in such an situation

thank you a lot in advance

Jan

Former Member
0 Kudos

Hi Jan,

Including Stefan's words, I suggest you dump the hang analyze, at the first step. You can follow the steps below to create the dump and share with us;

SQL> oradebug setmypid

SQL> oradebug hanganalyze 12

In the trace dump file, you will be able to figure out what may cause to the hang situation. Then, you should check the detailed analyze on specific process.

SQL> ORADEBUG SETOSPID <OSPID>;

SQL> ORADEBUG EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12;
SQL> ORADEBUG TRACEFILE_NAME;
SQL> ORADEBUG EVENT 10046 TRACE NAME CONTEXT OFF;

Then, check output on tracefile. Furthermore, you can use tkprof utility to make it easy to analyze the session output. Additionally, execute the statement to see resources on the system with "-prelim" if it is possible.

SQL> select * from GV$RESOURCE_LIMIT;

Best regards,

Orkun Gedik

stefan_koehler
Active Contributor
0 Kudos

Hi Jan,

> When trying restart an R3 system yesterday, the database did not get down.

Yes, i understand this, but there could be several reasons for that. At first we need to know how you exactly tried to shutdown the database (shutdown, shutdown immediate, shutdown abort).

> This process was hanging when trying to shutdown

The process seems to run fully on CPU. Was this PID related to SMON by chance? This is a well known root cause and possibly works as it designed. You also could verify this in the alert log file, if you have a large time gap with "SMON: disabling tx recovery" for example.

> Could you let me know if I can in that situation kill that process without threaten consistancy

No, as i don't know which process it is (and what it is doing).

> What should be done in such an situation

You are far away from using oradebug with your described scenario. At first you need to know which kind of process is running fully on CPU, then you need to determine what it is doing / waiting for and only after that you may need to use oradebug for further troubleshooting.

Regards

Stefan

Answers (0)