Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Using Unix debuggers to attach to Oracle processes

Re: Using Unix debuggers to attach to Oracle processes

From: Tanel Põder <tanel.poder.003_at_mail.ee>
Date: Tue, 9 May 2006 01:04:27 +0800
Message-ID: <06ae01c672c1$79b7efb0$3f121eac@porgand>


> There might be a catch here. Such program will not work without some
> values (like address of fixed table). These values may change after db
> startup and are obtained using ordinary SQL (via sqlplus, for
> example). So if we want to use program that directly read data from
> SGA of hanged database, we need to preliminary read some values
> sometimes before database hangs (for example, immediately after
> startup).

Yep, those demo programs available from internet take the easy way, avoiding the hassle with different memory structure sizes on various platforms and versions. However it is possible to determine the session array location when having access to Oracle binary and SGA, no SQL execution is needed.

SGA fixed variable ksusga is a pointer to a structure which holds pointers to each session slot in sessions array and this can be read from Oracle binary:

$ nm $ORACLE_HOME/bin/oracle | grep ksusga_ 2000407c A ksusga_

It is fairly easy to reach the session slot pointers from address 0x2000407c if you have a static binary. However it's not that easy to write code which works with all versions and platforms of Oracle, so that's why the examples in the internet have taken the easy path.

Tanel.

--
http://www.freelists.org/webpage/oracle-l
Received on Mon May 08 2006 - 12:04:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US