Here’s the list of events where I’ll speak this year:
Michigan OakTable Symposium 2010
Ann Arbor, MI
16-17 September 2010
Considering the concentration of OakTable members there, this will be an awesome event!
I will be delivering my “Back to Basics: Choosing The Entry Point to Performance Troubleshooting Wisely” and “Understanding LGWR, log file sync waits and commit performance” sessions there.
Promo video:
http://www.oaktable.net/media/michigan-oaktable-symposium-2010-promo
Agenda & Registration:
http://michigan.oaktable.net/
Oracle Open #ff0000;">Closed World
San Francisco, CA
19-22. September
Note that I won’t be speaking at the official Oracle Open World conference, but I will be speaking at a secret underground event there, about some really fun stuff, like deep internals, hacking, kernel tracing and of course advanced troubleshooting ;-) And rest of the time I’ll be in some bar.
NYOUG Fall 2010 Training Session
Manhattan, NYC, NY
16 November 2010
I haven’t written any blog entries for a while, so here’s a very sweet treat for low-level Oracle troubleshooters and internals geeks out there :)
Over a year ago I wrote that Oracle 11g has a completely new low-level kernel diagnostics & tracing infrastructure built in to it. I wanted to write a longer article about it with comprehensive examples and use cases, but by now I realize I won’t ever have time for this, so I’ll just point you to the right direction :)
Basically, since 11g, you can use SQL_Trace, kernel undocumented traces, various dumps and other actions at much better granularity than before.
For example, you can enable SQL_Trace for a specific SQL_ID only:
SQL> alter session set events 'sql_trace[SQL: 32cqz71gd8wy3] {pgadep: exactdepth 0} {callstack: fname opiexe} plan_stat=all_executions,wait=true,bind=true'; Session altered.
Actually I have done more in above example, I have also said that trace only when the PGA depth (the dep= in tracefile) is zero. This means that trace only top-level calls, issued directly by the client application and not recursively by some PL/SQL or by dictionary cache layer. Additionally I have added a check whether we are currently servicing opiexe function (whether the current call stack contains opiexe as a (grand)parent function) – this allows to trace & dump only in specific cases of interest!
A troubleshooting session at one of my clients started with the following description of the problem:
In some specific database environments sometimes (but not always) a particular batch process takes significantly longer than expected - which in that case meant hours instead of a few minutes.
It could also be observed that particular SQL statements showed up as most prominent in that case when monitoring the process.
So the first thing was to be able to reproduce the issue at will which was not the case so far.
It was quite quickly possible to narrow the problem down to a single call to a complex PL/SQL stored procedure (that was part of a package and called a lot of other stored procedures / packages) that dealt with handling of LOBs representing XML data.
It turned out that by simply calling this stored procedure multiple times in a loop the issue could be reproduced at will and also in different database environments as initially reported.
The rather unique aspect of that stored procedure was that it got executed in an "exclusive" mode which means that it was run on a quite large IBM pSeries server (AIX 5.3, 11.1.0.7, 240 GB RAM, numerous P6 multi-cores, expensive storage) with no other business processes active at the same time. It was mostly a serial execution and when it was monitored, it spent most of its time in two SQL statements that were very simple and straightforward. It actually were static SQLs embedded in PL/SQL that queried a single, very small table using a unique index access plus a table access by ROWID. So we had two SQL statements that under normal circumstances at most could generate two logical I/Os per execution, since the index/table queried was so small and therefore was completely held in the buffer cache.
At Hotsos Symposium Training Day I used rlwrap with sqlplus – which gives nice command line editing and history capabilities for tools like sqlplus. Additionally I pre-generated commonly used Oracle keywords, data dictionary view and package names into rlwrap wordfile, so I got nice tab-completion too. Sqlplus sucks much less with rlwrap ;-)
It’s relatively easy to install rlwrap on Unix (there are rlwrap RPMs out there, Solaris freeware packages and I installed it on Mac via macports.org). Just google around…
You can have rlwrap on Windows too – As rlwrap has been coded for Unix flavors, then on Windows you need to run it on a Unix library environment emulator – like Cygwin.
Dave Herring and Michael Paddock have both written an article about how to get rlwrap & sqlplus running on Windows, check out the articles here. It’s worth reading both as they have different additions…
So, if you want command line history, search and tab completion for sqlplus on Unix flavors or Windows, check these articles out!
http://daveherringsdbablog.blogspot.com/2010/03/sqlplus-command-history-with-cygwin.html
http://blog.enkitec.com/2010/04/29/using-sqlplus-with-rlwrap-on-ms-windows/
If you regularly read my blog then very likely you also follow other, more popular OakTable Network members that blog like Jonathan Lewis or Richard Foote for example and therefore probably already know that the OakTable Network website has been re-launched with a modern interface and a lot of interesting functions, in particular a blog aggregator for all blogs of the OakTable Network members.
You might want to give it a try at www.oaktable.net.
Thanks to Kurt Van Meerbeeck, James Morle, Marco Gralike and anyone else who has helped to make this happen.
Here’s a little trick question. Check out the execution plan below.
What the hell, shouldn’t the INDEX/TABLE access be the other way around?!
Also, how come it’s TABLE ACCESS FULL (and not by INDEX ROWID) in there?
This question is with a little gotcha, but can you come up with a query which produced such plan? ;-)
---------------------------------------------- | Id | Operation | Name | E-Rows | ---------------------------------------------- | 0 | SELECT STATEMENT | | | |* 1 | INDEX RANGE SCAN | PK_EMP | 1 | |* 2 | TABLE ACCESS FULL| EMP | 1 | ----------------------------------------------
Did you know that it’s possible to use EXPLAIN PLAN FOR CREATE INDEX ON table(col1,col2,col3) syntax for explaining what exactly would be done when an index is created?
That’s useful for example for seeing the Oracle’s estimated index size without having to actually create the index.
You can also use EXPLAIN PLAN FOR ALTER INDEX i REBUILD to see whether this operation would use a FULL TABLE SCAN or a FAST FULL INDEX SCAN (offline index rebuilds of valid indexes can use this method).
Anyway, you can experiment with this yourself, but here’s a little quiz (with a little gotcha :)
What kind of index creation statement would create such an execution plan?
Some time ago I wrote that since Oracle 10.2, some of the buffer cache can physically reside within shared pool granules.
I just noticed this in an 11.2 instance:
Some time ago I wrote an article about the 10g+ SQL_ID being just a hash value of the SQL statement text. It’s just like the “old” SQL_HASH_VALUE, only twice longer (8 last bytes instead of 4 last bytes of the MD5 hash value of SQL text).
Slavik Markovich has written a nice python script for calculating SQL_IDs and SQL hash values from SQL text using that approach.
Slavik’s article is available here:
http://www.slaviks-blog.com/2010/03/30/oracle-sql_id-and-hash-value/
I wrote a latch contention troubleshooting article for IOUG Select journal last year (it was published earlier this year). I have uploaded this to tech.E2SN too, I recommend you to read it if you want to become systematic about latch contention troubleshooting:
http://tech.e2sn.com/oracle/troubleshooting
I’m working on getting the commenting & feedback work at tech.E2SN site too, but for now you can comment here at this blog entry…
Recent comments
1 week 12 hours ago
1 week 18 hours ago
4 weeks 37 min ago
11 weeks 6 days ago
14 weeks 6 days ago
19 weeks 3 days ago
19 weeks 3 days ago
19 weeks 5 days ago