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):
Next, set timing on, to get query processing times:
Now, run your query to get the runtime with no VPD profile applied.
Note: Query truncated to protect private data.
Next, set your user to DBA.ADMIN to test again, with a VPD profile applied, but one without any restrictions. Run the query again:
Finally, test one more time, changing the VPD profile to match your OTM user:
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
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/[email protected] 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>
Code:
SQL> set timing on
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>
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>
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>
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
Comment