otmfaqForumsBlogsRegister
FAQMembers ListCalendarToday's PostsSearch


 Subscribe Blogs:RSS
 Subscribe Forums:RSS
OTMFAQ Home
OTMFAQ Blogs
OTMFAQ Forums
OTMFAQ Tutorials

OTM SIG
MavenWire


Database Administration Database installation, creation, administration and related topics.

Tags: , , ,

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old September 17th, 2007, 03:07
chrisplough's Avatar
Site Moderator
 
Join Date: Jun 2006
Location: West Chester, PA
Posts: 816
Blog Entries: 7
Thanks: 53
Thanked 199 Times in 121 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 10
chrisplough has a spectacular aura aboutchrisplough has a spectacular aura aboutchrisplough has a spectacular aura about
Send a message via AIM to chrisplough
[INSTRUCTIONS] Testing VPD Query Performance

The performance of various queries in OTM can vary dramatically, depending on whether a VPD profile is used or not.

While working with a client on a migration this weekend, we realized that certain scheduled queries were obliterating the database (taking > 5 minutes to process, and scheduled to run at 5 minute intervals). Upon further investigation, we realized that this query would run in a few seconds without a VPD profile, but took forever with one.

First, login to your OTM database as GLOGDBA (the user the OTM app logs in as):
Code:
$ sqlplus glogdba/glogdba@OTMDB

SQL*Plus: Release 10.2.0.3.0 - Production on Mon Sep 17 11:46:08 2007

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL>
Next, set timing on, to get query processing times:
Code:
SQL> set timing on
Now, run your query to get the runtime with no VPD profile applied.
Note: Query truncated to protect private data.
Code:
SQL> select sh.shipment_gid from SHIPMENT sh ... and (rownum <= 140);

no rows selected

Elapsed: 00:00:01.77
SQL>
Next, set your user to DBA.ADMIN to test again, with a VPD profile applied, but one without any restrictions. Run the query again:
Code:
SQL> exec vpd.set_user('DBA.ADMIN');          

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00
SQL> select sh.shipment_gid from SHIPMENT sh ... and (rownum <= 140);

no rows selected

Elapsed: 00:00:01.85
SQL>
Finally, test one more time, changing the VPD profile to match your OTM user:
Code:
SQL> exec vpd.set_user('GUEST.ADMIN');

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.00

SQL> select sh.shipment_gid from SHIPMENT sh ... and (rownum <= 140);
 
no rows selected

Elapsed: 00:07:34.83

SQL>
Of course, resolution is another matter, but at least you can identify if VPD is a root cause.

Finally, here's a link to a good blog post on tracing your sql queries within sqlplus:

So What Co-operative: Trace it!

Hope this helps!!

--Chris
__________________
Chris Plough
MavenWire

www.MavenWire.com

Last edited by chrisplough : September 18th, 2007 at 06:46.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old September 18th, 2007, 06:43
chrisplough's Avatar
Site Moderator
 
Join Date: Jun 2006
Location: West Chester, PA
Posts: 816
Blog Entries: 7
Thanks: 53
Thanked 199 Times in 121 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 10
chrisplough has a spectacular aura aboutchrisplough has a spectacular aura aboutchrisplough has a spectacular aura about
Send a message via AIM to chrisplough
Re: [INSTRUCTIONS] Testing VPD Query Performance

Just linking in a related post that discusses some great performance improvements that Ian Lo achieved through tuning:
http://www.otmfaq.com/forums/f27/otm...rovements-515/ (OTM 5.5: VPD Query Performance - Improvements)
Another about some performance issues when a VPD profile is used:
http://www.otmfaq.com/forums/f28/vpd...erformance-25/ (VPD profile has negative effect on query performance)
and some negative affects of changing the VPD granularity:
http://www.otmfaq.com/forums/f21/sol...ularity-d-219/ ([SOLVED] VPD Context with VPD_GRANULARITY=D)
--Chris
__________________
Chris Plough
MavenWire

www.MavenWire.com

Last edited by chrisplough : September 18th, 2007 at 08:51.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old October 11th, 2007, 11:44
Junior Member
 
Join Date: May 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
Kristof Stevens is on a distinguished road
Re: [INSTRUCTIONS] Testing VPD Query Performance

set _kks_use_mutex_pin=false on Db tier.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old October 12th, 2007, 14:47
chrisplough's Avatar
Site Moderator
 
Join Date: Jun 2006
Location: West Chester, PA
Posts: 816
Blog Entries: 7
Thanks: 53
Thanked 199 Times in 121 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 10
chrisplough has a spectacular aura aboutchrisplough has a spectacular aura aboutchrisplough has a spectacular aura about
Send a message via AIM to chrisplough
Re: [INSTRUCTIONS] Testing VPD Query Performance

Kristof,

Thanks for the setting. Doing some research, this appears to be related to an issue specific to the HP-UX platform, but it would be interesting to see if hit helps other platforms also. I know that Ian is running on AIX and the bulk of our clients are running on Linux.

Here's some details on the issue: Oracle Doc ID# 433631.1
Mutex Latch Spin Causes High Cpu on Non-CAS Platforms (HP-UX PA-RISC )
Quote:
CPU usage greatly increased on 10.2.0.2 compared to 9.2.0.6 while performing testing..
Problem only occurs on HP-UX PA-RISC.
Disabling mutexes reduced CPU usage by 10%-15%

To avoid using Mutex latches, you can set _kks_use_mutex_pin=false

10.2.0.2 defaults the use of mutexes for certain shared cursor operations,
instead of library cache latches and library cache pin latches and library
cache pins. Mutexes use the CAS (compare and swap) operation.
This is going to be resolved shortly in 10.2.0.4 - as part of bug # 5399325.

Thanks,
Chris
__________________
Chris Plough
MavenWire

www.MavenWire.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reports development - testing error sridhartylam Reports / FTI and Other Analytics 3 February 8th, 2008 19:22
OTM 5.5: VPD Query Performance - Improvements ianlo Performance, Scalability and HA 10 December 4th, 2007 00:24
VPD profile has negative effect on query performance blasley Reports / FTI and Other Analytics 8 September 18th, 2007 08:53
[SOLVED] Testing PCMiler via telnet chrisplough SysAdmin and Management 0 June 28th, 2007 15:17
[SCRIPT] Testing Integration - mw-OtmPostWMServlet.pl chrisplough Integration and Data Mapping 0 April 27th, 2007 17:17



All times are GMT. The time now is 22:51.
Copyright © 2008, Open Book Solutions LLC. All rights reserved.

Sponsored by MavenWire - MavenWire.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37