Extract(Read) > Transform(Test&Apply) > Load(Learn) Blog

August 20, 2007

Memory Access Mode of Oracle Enterprise Manager

Filed under: Oracle How To — H.Tonguç Yılmaz @ 9:26 am

Many people after some years with Oracle software may come up with Direct SGA Access project and presentation of Kyle Hailey discussing how to do direct SGA access in C. This following material of Miladin Modrakovic also helps understanding.

Why might we need this one, may be the first question coming into mind; let’s think of a bad work day now, you as a dba of a production system found out that you can not access to your database from any oracle utility even it is opened and startup doesn’t change anything. Let’s say Oracle support also advices you to use your backups, nothing to do for this hang situation after some dump analysis. But your recently backup media is broken or lost somehow, so what now..

After 10g Oracle Enterprise Manager gets the data about system hangs using the same method. When you enable the SGA direct attach, Oracle uses a single SQL collector per instance and this collector starts automatically along with Enterprise Manager.

Also this technique may be useful in tuning areas to access oracle statistics without impacting the Oracle kernel. It could also be a technique for accessing data from a running database for other security related purposes or just to do some reverse engineering to understand internals.

Refences Used :
Memory Access Mode of EM
Undocumented Oracle
Oracle Insights: Tales of the Oak Table – Chapter 6: Direct Memory Access, by Kyle Hailey
Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning (Osborne ORACLE Press Series) (Paperback) – Appendix D – Direct SGA Access
Another similar example, on security
Direct SGA Access for Hung/Slow Systems by Arup Nanda
Hung But Not Paralyzed: Memory-Attached SGA Query by Arup Nanda

About these ads

6 Comments »

  1. Are you really recommending that people will write their own programs to access the SGA through direct memory? Its a cool project if you are into C and memory management, but if you are not you can usually (as in 99.999% of the time) live without it.
    AFAIK, even Mr Haily no longer maintains his, because you need to repeat all the tedious research every time the version changes, and for each operating system, so you need a really good reason to do this.

    Also, I believe that Quest has a performance monitoring and diagnosis tool that uses direct access to SGA. It is not cheap though, and unless your performance issues are so severe that queries simply can’t run, I still think that direct SGA access is not really needed.

    That said, it is still a very cool project and I wish I had the patience to try this.

    Comment by prodlife — August 20, 2007 @ 8:34 pm | Reply

  2. prodlife this post was not a recommendation, thank you for the opportunity to clear this.

    But for some people it will mean more than a need, for example check Julian Dyke’s presentations; how an outsider can know that much internals of Oracle for sure if he didn’t see the source code? This may be an entrance to a new deeper world and it is interestingly fun to play with:)

    Comment by H.Tonguç Yılmaz — August 20, 2007 @ 9:16 pm | Reply

  3. Ah, Julian Dyke’s presentations are great, and I wish I could have been there to hear them. Indeed, if you want to check the deep internals of Oracle, you’ll want to dig into the memory. Of course, if you are the kind of person who checks deep internals, writing the direct memory program will not be a problem for you.
    Just keep in mind that knowing the internals that deeply is not necessary for most DBAs (just those who are nerdy enough to like internals for their own sake), you can be a great DBA if you know just the external information of how things work without getting into exact memory locations. Problems start with DBAs that don’t bother knowing the external information either.

    Being a nerd myself, I love peeking into Oracle’s memory structures. Preferably when someone else did the hard research work :-)

    Comment by prodlife — August 21, 2007 @ 2:48 am | Reply

  4. I wrote a small direct-access C program once and it was a *lot* of work. Also, it’s completely different between ipc shared memory (the default and most common) and /dev/shm (used for 32-bit systems with large memory and MEMORY_TARGET on 11g)… I’ve never tried but does OEM direct SGA access work for both of these modes?

    Comment by Jeremy Schneider — August 22, 2007 @ 11:32 pm | Reply

  5. Jeremy I also didn’t try the feature my own, this was a hot topic last week with one of my dba friend, I sent an email and mentioned your question and this post. I hope he will comment but he is a real lazy type of dba indeed and he is proud of this always :)

    Comment by H.Tonguç Yılmaz — August 24, 2007 @ 2:18 pm | Reply

  6. SQl*Plus Preliminary Connection Example – http://oraclue.wordpress.com/2008/09/25/sqlplus-preliminary-connection/

    Comment by H.Tonguç Yılmaz — October 13, 2008 @ 11:36 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 79 other followers

%d bloggers like this: