Posted by Riyaj Shamsudeen on May 21, 2016
I was testing an application performance in 12c, and one job was constantly running slower than 11g. This post is to detail the steps. I hope the steps would be useful if you encounter similar issue.
In an one hour period, over 90% of the DB time spent on waiting for library cache lock waits. Upon investigation, one statement was suffering from excessive waits for ‘library cache lock’ event. We recreated the problem and investigated it further to understand the issue.
Following is the output of wait_details_rac.sql script (that I will upload here) and there are many PX query servers are waiting for ‘library cache lock’ wait event.
SID PID EVENT USERNAME OSUSER STATE WAIT_TIME WIS P1_P2_P3_TEXT
------ ---------- ------------------------------ ---------- ---------- ------------------- --------- ----- ----------------------------------------
276 12445 library cache lock TST_USR test WAITING 0 1 handle address 399021346904-lock address
288 12449 library cache lock TST_USR test WAITING 0 4 handle address 399021346904-lock address
303 12453 library cache lock TST_USR test WAITING 0 4 handle address 399021346904-lock address
315 12457 library cache lock TST_USR test WAITING 0 4 handle address 399021346904-lock address
Lock address to object
For all session waiting, library cache handle address is the same. That means that the sessions are waiting for one library cache object. Querying x$kgllk confirms that and we can also identify object name.
select ses.sid, ses.serial#,lck.kgllkcnt, lck.kgllkmod,lck.kgllkreq, lck.kglnaobj
from x$kgllk lck , v$session ses
where kgllkhdl in
(select kgllkhdl from x$kgllk where kgllkreq >0)
and lck.KGLLKUSE = ses.saddr
SID SERIAL# KGLLKCNT KGLLKMOD KGLLKREQ KGLNAOBJ
------ ---------- ---------- ---------- ---------- ------------------------------------------------------------
276 6518 0 0 2 5ce7869058
84 6429 0 0 2 5ce7869058
329 19358 0 0 2 5ce7869058
342 37088 0 0 2 5ce7869058
407 17734 0 0 2 5ce7869058
74 26333 0 0 2 5ce7869058
Object name 5ce7869058 is not a typical schema object and seems to be an internal object. We need to identify the owner of the object and that might lead to some clues.
Two ways to find the row in x$kglob:
1. Convert the handle address to HEX and pad it.
SQL> select to_char(399021346904,'xxxxxxxxxxxxxx') from dual;
SQL> select kglnawon, kglnaobj from x$kglob where kglhdpar =hextoraw('0000005CE7869058');
2. Join to x$kgllk.
SQL> select kglnaown, kglnaobj from x$kglob where kglhdadr in
( select kgllkhdl from x$kgllk where kgllkreq >0);
Interesting. These objects are owned by the user $BUILD$. But, there is no such database user and this object must be an internal object.
At this time, I took a few pstack samples of the process and tried to learn a bit more about the problem. Nothing too interesting, function call kglLockWait indicates that we are waiting for library cache lock.
# pstack 12485
#0 0x00007f42737d100a in semtimedop () from /lib64/libc.so.6
#1 0x000000000cda832d in sskgpwwait ()
#2 0x000000000cda5c98 in skgpwwait ()
#3 0x000000000c8f2bab in ksliwat ()
#4 0x000000000c8f1fb1 in kslwaitctx ()
#5 0x0000000000c00810 in ksfwaitctx ()
#6 0x0000000003b6765d in kglLockWait ()
#7 0x000000000cdcd441 in kgllkal ()
#8 0x000000000cdc53e4 in kglLock ()
#9 0x000000000cdbeb32 in kglget ()
#10 0x000000000cb7650c in kksfbc ()
#11 0x000000000cb166ec in opiexe ()
#12 0x00000000021ee529 in kpoal8 ()
#13 0x000000000cb1254d in opiodr ()
#14 0x0000000003117d7e in kpoodr ()
#15 0x000000000cd41b4a in upirtrc ()
#16 0x000000000cd2cde6 in kpurcsc ()
#17 0x000000000cd28014 in kpuexec ()
#18 0x000000000cd420e9 in OCIStmtExecute ()
#19 0x0000000002073a10 in kxfxsStmtExecute ()
#20 0x0000000002073387 in kxfxsExecute ()
#21 0x000000000206df42 in kxfxsp ()
#22 0x000000000206c489 in kxfxmai ()
#23 0x00000000020a91b3 in kxfprdp ()
#24 0x00000000031014a6 in opirip ()
#25 0x0000000001bb0a08 in opidrv ()
#26 0x00000000026c0f71 in sou2o ()
#27 0x0000000000bbd85e in opimai_real ()
#28 0x00000000026cb6bc in ssthrdmain ()
#29 0x0000000000bbd72c in main ()
At this time, I have some information. So, I searched for ‘library cache lock $BUILD$’ in support.oracle.com and of course, found a bug matching with my symptoms. Further investigation from BDE confirmed my analysis. I didn’t want to list the bug numbers as similar symptom may have different root cause. So, you need to work with support further.
Posted in 12c, inmemory, Oracle database internals, Performance tuning, RAC | Tagged: $BUILD$, inmemory internals, kglLockWait, library cache lock, oracle performance, pstack, x$kgllk, x$kglob | Leave a Comment »
Posted by Riyaj Shamsudeen on March 24, 2016
Over the last many years, some of you have invited me to attend conferences in India, and talk about Oracle RAC and performance. I have not had an opportunity to make it to conferences in India, until now
I am excited to announce that I will be participating in OTN sponsored Oracle ACE Director’s tour in India (April 23rd to May 2nd 2016), and presenting ( with deep dive demos ) about RAC, performance, and in-memory. This is a golden opportunity for you to learn some of the internal stuff that I talk about in my class too.
Refer http://otnyathra.com for further details.
I am also excited to be in the tour with Connor McDonald, Biju Thomas, Sai, and many others. Don’t forget to send an email to Sai, the conference rooms will fill out quickly.
Did I mention deep dive demos?
Update 1: Updating the presentation slides and scripts. Do ask if I miss any script that you are looking for
Posted in 12c, Performance tuning, Presentations, RAC | Tagged: oracle performance, RAC performance | 5 Comments »
Posted by Riyaj Shamsudeen on November 18, 2015
Thanks for coming to my presentations in RAC day at Dublin, Ohio. Please find the presentation files below. Hopefully, I will get video files and upload that here too.
OOUG presentation files and scripts
md5 checksum of the zip file is:
Posted in Oracle database internals, Performance tuning, Presentations, RAC | Tagged: oracle performance, RAC, RAC performance | 3 Comments »
Posted by Riyaj Shamsudeen on October 22, 2015
I will be talking about RAC and performance in-depth, with lots of demos, in a RAC day training with Ohio Oracle User group on Nov 16,2015 Monday. Venue for the presentation is Dublin, Ohio.
Agenda for the day:
08:00a – 09:00: Registration / Breakfast
09:00a – 09:15: Announcements -Introduction of the speaker
09:15a – 10:30: Underpinning for Oracle RAC and Clusterware
10:30a – 10:45: Break
10:45a – 11:45: RAC cache fusion internals
11:45a – 01:00: Lunch
01:00p – 02:00: RAC Performance tuning Part 1 – Wait events and object tuning
02:00p – 02:15: Break
02:15p – 03:30: RAC performance tuning Part 2 – locks, library cache locks etc.
03:30p – 03:45: Member Announcements, Gift Drawings
Please RSVP to the co-ordinators so that you will have a seat
OOUG RAC day
Posted in Oracle database internals, Performance tuning, Presentations, RAC | Tagged: oracle performance, RAC, RAC performance, RAC performance myths | 1 Comment »
Posted by Riyaj Shamsudeen on March 25, 2015
I will be presenting two topics in IOUG Collaborate 2015 in Vegas. Use the show planner and add my presentations to your schedule
Session #189: April 13 Monday 9:15 to 10:15AM Topic: Oracle Database 12c In-Memory Internals. Room Palm B
Session #145: April 13 Monday 12:45PM-1:45PM Topic: Tools and Techniques for Advanced Debugging in Solaris & Linux (mostly live demo). Room Palm B.
Posted in inmemory, Oracle database internals, Performance tuning, Presentations, RAC | Tagged: collaborate 2015, in-memory internals, ioug, presentations, strace, truss | Leave a Comment »
Posted by Riyaj Shamsudeen on January 19, 2015
I will be talking in Rocky Mountain Oracle User Group Training Days 2015( http://www.rmoug.org), with live demos (hopefully there will be no failures in the demo). My topics are:
Feb 17: Deep dive: 3:15PM to 5:15PM – RAC 12c optimization: I will discuss RAC global cache layer in detail with a few demos. You probably can’t find these deep Global Cache layer details anywhere else
Feb 19: Wednesday: 2:45PM to 3:45PM – Advanced UNIX tools: I will discuss both Solaris and Linux advanced tools to debug deep performance issues.
Feb 19: Wednesday: 12:15PM – 1:15PM – Exadata SIG panel with Alex Fatkulin.
Come to Denver. Come on, it won’t be cold ( I think )
Uploading presentation and scripts of the presentation files: RMOUG_2015_Riyaj_RAC_12c_optim files
Presentation files for Unix tools demos: RMOUG_2015_Riyaj_Unix_tools
Posted in 11g, 12c, Presentations, RAC | Tagged: gc buffer busy, RAC performance, RAC training, rmoug | 1 Comment »
Posted by Riyaj Shamsudeen on March 20, 2014
After collaborating with many performance engineers in a RAC database, I have come to realize that there are common pattern among the (mis)diagnosis. This blog about discussing those issues. I talked about this in Hotsos 2014 conference also.
Here are the golden rules of RAC performance diagnostics. These rules may not apply general RAC configuration issues though.
- Beware of top event tunnel vision
- Eliminate infrastructure as an issue
- Identify problem-inducing instance
- Review send-side metrics also
- Use histograms, not just averages
Looks like, this may be better read as a document. So, please use the pdf files of the presentation and a paper. Presentation slide #10 shows indepth coverage on gc buffer busy* wait events. I will try to blog about that slide later (hopefully).
Golden rules of RAC diagnostics paper
Golden rules of rac diagnostics ppt
Scripts mentioned in the presentation can be downloaded here.
Posted in 11g, Performance tuning, Presentations, RAC | Tagged: gc buffer busy, oracle performance, RAC performance, RAC performance diagnostics, RAC performance myths, RAC performance scripts | 3 Comments »
Posted by Riyaj Shamsudeen on February 28, 2014
I blogged about Dynamic Resource Mastering (DRM) in RAC here . DRM freezes the global resources during the reconfiguration event and no new resources can be allocated during the reconfiguration. This freeze has a dramatic effect of inducing huge amount of waits for gc buffer busy [acquire|release] events and other gcs drm freeze release, gcs remaster events. In database version 12c, DRM has been improved further.
A major improvement I see is that not all resources are frozen at any time. Essentially, resources are broken down in to partitions and only a resource partition is frozen. This improvement should decrease the impact of DRM related waits tremendously.
LMON Trace file
Following shows the snippet from the LMON trace file. As you see, only one resource partition is frozen, at-a-time. Resources in the first partition is frozen, completes the resource remastering tasks, and unfreezes that resource partition. Then freezes next resource partition and continues until all resources are remastered.
Read the rest of this entry »
Posted in 12c, Performance tuning, RAC | Tagged: DRM, DRM freeze, DRM RAC, gc buffer busy | Leave a Comment »
Posted by Riyaj Shamsudeen on February 25, 2014
I will be presenting in HOTSOS symposium 2014 discussing correct methods to diagnose RAC performance issues. Very surprisingly, even very senior performance engineers make mistakes in their analysis while reviewing RAC issues. Come to my presentation and learn the golden rules of RAC performance diagnostics.
Posted in 12c, Performance tuning, Presentations, RAC | Leave a Comment »
Posted by Riyaj Shamsudeen on November 12, 2013
It is easier to create one or two AWR reports quickly using OEM. But, what if you have to create AWR reports for many snapshots? For example, your Oracle support analyst wants you to supply 10 1-hour AWR reports from 10AM to 8PM in a 8 node cluster? That’s about 80 AWR reports to create! Okay, okay, I may(!) be overselling it, but you get the point. It is useful to have a script to create AWR report for all instances for a given range of snapshot IDs. Following scripts are handy:
|1. To create one AWR report per instance, for the last snap duration :
|2. Same as (1) but in html format :
|3. To create one AWR report per instance, for a range of snap IDs :
|4. To create one AWR report, per instance, per snap ID :
Zip file: awrrpt_scripts
These scripts do not modify anything in the database, just retrieves the data using dbms_workload_repository package. Test the scripts to understand further. Of course, you need access to dbms_workload_repository and access to gv$instance.
Posted in Oracle database internals, Performance tuning, RAC | Tagged: AWR reports, awrrpt.sql, awrrpt_all_gen.sql, awrrpt_all_range_gen.sql | 9 Comments »