Intermedia performance as respect to the library cache
I have been trying to tune intermedia indexing on its creation (oracle 8.1.7). My developers try to index some data. There are only 30K rows for 2 tables. Table 1) 2 columns
1 varchar2(50) and 1 char(1)
table 2) 2 columns
1 varchar2(50) and 1 blob
Average Row size for table 1 (918 bytes)
and table 2 (614 bytes)
When loading the 30k rows it takes approx 7.5 hours on a box that has 4 risc cpus, 8 gb ram, and the db files are raw. My breakdown for SGA (1gb shared pool, 256 megs buffer cache, 120 megs large pool, 960 megs java pool,128 megs sort area size and my db_block_buffers is set to 32 meg).
During intermedia indexing I noticed that the system is performing well except for library cache misses (94%). I have tried increasing both the shared_pool and session_cached_cursors to 100. Niether option helped. My dictionary hit ratio is around 97% very good. No IO contention. The index creation is local so the network is not an issue. The box is also dedicated to oracle database only no other applications. My user base is consists of 1 developer for now. Any ideas would greatly be appreciated.
There is a Performance FAQ at: http://technet.oracle.com/products/text/x/FAQs/imt_Perf_Faq.html
A new version will be updated next week.
null
Similar Messages
-
Concurrent sessions accessing parsed sql from the library cache
Hi there,
I am having five concurrent session firing exactly same SQL statement inside a stored procedure.
Stored Procedure
PROC1(a int)
begin
select <C1>,<C2> into <V1>,<V2> from <T1>, <T2> where <JOIN between both table> and T1.<C3>=a;
end;
All those five sessions are calling the procedure PROC1 which subsequently executes the sql statement.
Execution time of sql statement is 2 seconds.
I ma wondering whether all other sessions will wait for the currently executing session to release the latch on parsed sql(getting stored in the library cache)? (In this case last session will wait for 8 seconds) Or would they execute in parallel with their own copy of parsed sql?
Please help!!!
TIA,
NishantWould it be like that the first session will hard parse the SQL statement and all other concurrent sessions will have a "softer" soft parse and take a copy of query plan and execute the statement without waiting for each otherYes, I think this is the way it works according to official Oracle documentation
(and why there is a shared pool).:
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/sqlplsql.htm#i2196
But I don't know if you can find detailed documentation about all latching steps for hard parse and soft part steps. -
For how long the library Cache latch is hold.
Hi ,
For how long the library Cache latch is hold.
Is it hold , till the new sql is placed in the library cache
or
Till it got parsed
or
Till it got executed?
Thanks
Naveen.Hi ,
For how long the library Cache latch is hold.
Is it hold , till the new sql is placed in the library cache
or
Till it got parsed
or
Till it got executed?
Thanks
Naveen. -
What is the difference between the library cache pin and the library ...?
What is the difference between the library cache pin and the library cache lock ?
What is the relation between them?Jonathan Lewis has a nice summary of these two items:
{message:id=2079008} -
May I safely delete these zip files in the ~/Library/Caches/ folder?
I have a bunch of zip files large in size that are in the following folder "~/Library/Caches/com.adobe.Acrobat.Pro.ARM/"
This has now been moved to
Home/library/Containers... -
Shared PL/SQL Area of the Library Cache
When Oracle allocates a Shared PL/SQL Area, do the SQL statements in the block get broken out into a separate Shared SQL area?
They should be in v$db_object_cache.
See: http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_1083.htm#sthref3589
Message was edited by:
Pierre Forstmann -
Use of bind variables with the oracle db - to improve library cache perform
Dear Friends,
We are using oracle 9.0.1.1.1 db server - the performance of the db was pathetic and upon investigation it was revealed that the library cache was over loaded with sql hard parses generated by not using bind variables. We are using vb as a front end with oracle and our connection object in vb is created using ole db for oracle provided by oracle (installed from oracle client custom - programmer option).
I would appreciate if any body can tell how can we use bind variables in vb to connect to oracle such that the hard parses can be changed into soft parses.
Your effort to bring some peace in my life is worth comendable and I would be very obliged for your time and help.
Thanks a lot.
Bye
Take care.
qjGenerally, you would use bind variables by changing statements that are written like this
select * from emp where empno=6678 and ename='Jones'
so that they're written like
select * from emp where empno=? and ename=?
How you then bind these question marks to the particular values you want depends on the API you're using (ADO? OLE DB directly?, etc). If you have a support contract, there are plenty of examples for any API on metalink.oracle.com
Justin -
Continual library cache misses in trace file for spatial queries
Hi all,
Could somebody explain to me how the SQL parse engine works for spatial queries.
My understanding is that Oracle creates a hash value for SQL that is parsed with no errors. This hash value is then stored in the library cache ready to be matched against other incoming SQL statements. This provides one of the main reasons for using parametising SQL in languages such as PL/SQL, .Net etc and improves performance on query intensive applications.
However i have noticed that for spatial, any queries except for refreshes of identical ones already sent, the SQL engines re parses the query. This can take upto 0.2 seconds which is causing a performance bottle neck.
When looking at the full trace file of a single spatial query using SDO_FILTER with a query window the amount of additional internal queries that are performed is quiet a lot. Are these additional queries included in the total parse time?
I am wondering why for spatial queries the only way to get a hit in the library cache was to refresh an exact same SQL that had been previously sent?
Thanks
DanielThose additional internal queries are not included in the parse time,
if they are used in the execution time.
Edited by: yhu on Mar 4, 2011 10:52 AM -
(Almost) No actions in the Library?
I've had my iMac just about a year now, and as far as I can remember, the Automator library has always been mostly empty. When I installed Office 2008, the Office actions showed up under the Most Relevant folder, but the Library folder itself remains empty.
If, following info I found on another forum, I delete the ~/Library/Caches/com.apple.Automator.ActionCache.plist and ~/Library/Preferences/com.apple.Automator.plist files, the next time I load Automator whopping three actions will show up, properly categorized, in the library view. Once I close and re-open Automator, however, even those three actions are no longer listed.
I have 229 items in the ~/Library/Automator folder, which I assume are the default actions and workflows. Trying to re-import these actions within Automator has no apparent effect, although if I make a copy of that folder and try to import the copies, I do receive a message stating that the action was previously imported.
I'm kind of at a loss and would appreciate any recommendations. Automator's just not that useful with no actions available.
Thanks!I wish it was as simple as my stupidity Unless I go through the steps of deleting the aforementioned plist files, there is nothing listed in the Library to expand, only the Office 2008 actions in the Most Relevant smart folder.
After seeing your response last night, I went through the additional steps of deleting everything except the Automator application file itself, including the /System/Library/Automator folder. No change in the results. After re-importing all those actions files, I still only see a few actions listed.
I've examined the files on my wife's MacBook, which does display the Library contents correctly, and just don't see anything that she has that I am missing. Clearly I'm overlooking something, but I don't know what. -
I recently noticed that my hard drives free space was shrinking without my having created new files. I lost 4-10 Gb/day. There was no virus detected by Norton 2012. I checked the amount used at the root folder and found no significant increase. That lead me to believe there was something going on in the library. There is a huge folder in the library/Cache called com.apple.iLifeMediaBrowser. There are 200K+ of files holding 49Gb of data in that folder. I know enough not to mess with anything in the library folders but what are they there for and why so many?
I had to rebuild my HD in Feb 2012 from clean installs and backups of data files so these iLifeMediaBrowser files are from less than 2 months ago.Some very good tips here- includes tools to view what is using hdd space. (just be sure to ignore the ads)
http://www.howtogeek.com/125923/7-ways-to-free-up-hard-disk-space-on-windows/
******Clicking the Thumbs-Up button is a way to say -Thanks!.******
**Click Accept as Solution on a Reply that solves your issue to help others** -
Library cache lock in statspack report
Hi,
We have some production issues on my database from long back. So i had taken snapshot and applied in one of analyzer tool.
In the TOP 5 Events they mentioned that library cache lock is 94.46 % , i am afraiding by seeing this number. And in there analyzing report they didn't populate the recommendations.
Please suggest me why the library cache lock showing 94.46%.
And i am also adding the other statistics as well.
Please go though and suggest me into right way.
Top 5 Events
Event Percentage of Total Timed Events
library cache lock 94.46%
PX Deq: Table Q Normal 1.51%
db file sequential read 1.23%
direct path read 1.06%
PX Deq Credit: send blkd .55%
Wait Events
Event Waits Wait Time (s) Avg Wait (ms) Waits/txn
library cache lock 45,777 137,044.09 2994 10.6
PX Deq: Table Q Normal 1,263,860 2,196.88 2 292.2
db file sequential read 80,826 1,780.39 22 18.7
direct path read 244,968 1,543.45 6 56.6
PX Deq Credit: send blkd 3,200,312 794.01 0 739.8
PX Deq: Execute Reply 529 570.82 1079 0.1
db file scattered read 42,356 524.47 12 9.8
library cache pin 93 286.44 3080 0.0
PX qref latch 96 90.05 938 0.0
log file sync 4,685 71.9 15 1.1
Instance Activity Stats
Statistic Total per Second per Trans
SQL*Net roundtrips to/from client 277,935 975.2 64.3
consistent gets 8,112,050 28,463.3 1,875.2
db block changes 446,986 1,568.4 103.3
execute count 31,369 110.1 7.3
parse count (hard) 65 0.2 0.0
parse count (total) 30,083 105.6 7.0
physical reads 3,041,562 10,672.2 703.1
physical reads direct 2,624,892 9,210.2 606.8
physical writes 151,245 530.7 35.0
physical writes direct 77,161 270.7 17.8
redo writes 4,933 17.3 1.1
session cursor cache hits 17,868 62.7 4.1
sorts (disk) 2 0.0 0.0
sorts (memory) 2,006 7.0 0.5
table fetch continued row 72,024 252.7 16.7
table scans (long tables) 323 1.1 0.1
table scans (short tables) 3,371 11.8 0.8
8 Recommendations:You need to figure out what session is holding the blocking library cache lock.
Here's a script that will help you do that:
select decode(lob.kglobtyp, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
11, 'PACKAGE BODY', 12, 'TRIGGER',
13, 'TYPE', 14, 'TYPE BODY',
19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
32, 'INDEXTYPE', 33, 'OPERATOR',
34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
42, 'MATERIALIZED VIEW',
43, 'DIMENSION',
44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
48, 'CONSUMER GROUP',
51, 'SUBSCRIPTION', 52, 'LOCATION',
55, 'XML SCHEMA', 56, 'JAVA DATA',
57, 'SECURITY PROFILE', 59, 'RULE',
62, 'EVALUATION CONTEXT',
'UNDEFINED') object_type,
lob.KGLNAOBJ object_name,
lk.KGLLKMOD lock_mode_held, lk.KGLLKREQ lock_mode_requested,
ses.sid,
ses.serial#,
ses.username
FROM
x$kgllk lk,
v$session ses,
x$kglob lob,
v$session_wait vsw
WHERE
lk.KGLLKUSE = ses.saddr and
lk.KGLLKHDL = lob.KGLHDADR
and lob.kglhdadr = vsw.p1raw
and vsw.event = 'library cache lock'
order by lock_mode_held desc
-Mark -
Sessions hangs with library cache lock
Der all,
11.1.0.7 rac on solaris 10
Our workflow session yesterday hanged on a particular step the session was waiting on a library cache lock (by using query select event,p1,p2 from v$session where sid=<my_sid>;)
when I checked the blocking session , using the note 122793.1 and http://oracle-study-notes.blogspot.com/2009/05/resolving-library-cache-lock-issue.html and http://oracle-study-notes.blogspot.com/2009/05/find-session-holding-library-cache-lock.html .
I found that
SQL> SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION
2 WHERE SADDR in
3 (SELECT KGLLKSES FROM X$KGLLK LOCK_A
4 WHERE KGLLKREQ > 0
5 AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B
WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
6 7 AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL
8 AND KGLLKREQ = 0)
9 );
Enter value for saddr_of_blking_sess: 0000000770E494E0
old 6: WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
new 6: WHERE KGLLKSES = '0000000770E494E0'
SID USERNAME TERMINAL PROGRAM
817 SYS UNKNOWN oracle@tabsdb07
(J002)
828 SYS UNKNOWN oracle@tabsdb07
(J001)after killing the session, the library cache locks still remained.when I ran trace on the session
select /*+ all_rows ordered */ A.rowid, :1, :2, :3
from
"DBMRPT"."DBM_BIAUTO_SUSP" A , "DBMRPT"."DBM_CDR_FILE_HEAD" B where(
"A"."CDR_TYPE" is not null and "A"."FILE_ID" is not null) and(
"B"."CDR_TYPE" (+)= "A"."CDR_TYPE" and "B"."FILE_ID" (+)= "A"."FILE_ID")
and( "B"."CDR_TYPE" is null or "B"."FILE_ID" is null)
call count cpu elapsed disk query current rows
Parse 1 0.01 0.01 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.01 0.01 0 0 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: SYS (recursive depth: 3)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
row cache lock 5 0.00 0.00
db file sequential read 295932636 0.07 5066.63
gc cr grant 2-way 727813 0.02 233.95
latch: gc element 80 0.00 0.00
latch: gcs resource hash 870 0.00 0.00
latch free 2 0.00 0.00
gc remaster 9 2.00 12.91
gcs drm freeze in enter server mode 9 0.54 2.08
latch: object queue header operation 66 0.00 0.05
latch: cache buffers chains 15 0.03 0.20
resmgr:internal state change 63 0.10 5.30
latch: cache buffers lru chain 1260 0.00 0.01
********************************************************************************Please guide
Kai
all this time sql_id for the session remanined in the sql :
ALTER TABLE DBMRPT.DBM_BIAUTO_SUSP ENABLE CONSTRAINT DBS1_DCFH_FK ..hi..
Go through [http://orainternals.wordpress.com/2009/06/02/library-cache-lock-and-library-cache-pin-waits/]
Anand -
To know if parsed SQL is in library cache and parse count
hello,
i want to know if a sql that was fired has its parsed code still in library cache. How do i know? One more question. I would also like to know how many times a sql is parsed and loaded onto library cache (assuming that I have its hash value)
thank you in advance.V$DB_OBJECT_CACHE: To view displays database objects that are cached in the library cache.
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_1083.htm
V$SQLAREA lists statistics on shared SQL area and contains one row per SQL string. It provides statistics on SQL statements that are in memory, parsed, and ready for execution.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2129.htm
select sql_text from v$sqlarea where users_executing > 0; -
GATHER_STATS_JOB is causing library cache lock events (blocking)
Hi,
I am running an Oracle 10g (2.0.3) RAC configuration on a Solaris 5.10 SPARC-64 box, and a couple of days ago I started to receive blocking alert due a library cache lock even caused by the scheduled GATHER_STATS_JOB. Is there any way to identify which is the table/object that is not being able to be process by the GATHER_STATS_JOB?
Regards,
AlbertoI found this on metalink:
How to find the blocker
a. find the p1raw value of the 'library cache pin', e.g.
select sid, event, p1raw from v$session_wait where event = 'library cache pin';
SID EVENT P1RAW
150 library cache pin 288822D4
select * from dba_kgllock where kgllkreq > 0;
KGLLKUSE KGLLKHDL KGLLKMOD KGLLKREQ KGLL
2CB1F978 288822D4 0 3 Pin
b. find the locked object via x$kglob, e.g.
select kglnaown, kglnaobj from x$kglob where kglhdadr = '288822D4';
KGLNAOWN KGLNAOBJ
SYS DUMMY -
Concurrent sessions accessing parsed sql from teh library cache
Hi there,
I am having five concurrent session firing exactly same SQL statement inside a stored procedure.
Stored Procedure
PROC1(a int)
begin
select <C1>,<C2> into <V1>,<V2> from <T1>, <T2> where <JOIN between both table> and T1.<C3>=a;
end;
All those five sessions are calling the procedure PROC1 which subsequently executes the sql statement.
Execution time of sql statement is 2 seconds.
I ma wondering whether all other sessions will wait for the currently executing session to release the latch on parsed sql(getting stored in the library cache)? (In this case last session will wait for 8 seconds) Or would they execute in parallel with their own copy of parsed sql?
Please help!!!
TIA,
NishantCan you please elaborate a little further.
AFAIK the query plans are stored in the library cache and there will be latches on data structures. Won't it mandate serial execution? Please correct me if I am wrong.
Thanks...
Nishant
Maybe you are looking for
-
How to get slider window in javafx
How to get Slider window in javafx when we click on button slider window should open with sliding effect and when we clock on close button of slider window it should be close with sliding effect....plss send the link regarding this or if possible the
-
No goods receipt possible in PO
Hi, When I try to do MIGO for a PO, I get the following error message - "No goods receipt possible in PO" Can you please tell me why it is hapenning and how to correct it Rgds, Sandeep
-
Got my cracked iphone screen replaced and now my phone has a mind of it's own.
It will select anything at everything at random, I'll text somebody and it will type random letters and send. Or The swipe up/down menus will come up/down and stay. I've liked, unliked, unfriended, unfollowed and sent gibberish to several people and
-
Hi , i am not getting out put. i am sending you the format we have to give po# as input in range then output should be in following form po# vendor Date.........(1) po item material qty price........(2) 1 and two are different.for (1) there should b
-
Sony RX100 and Lightroom 4.3
Hi, I recently bought a sony rx100 and have downloaded lightroom 4.3 trial version so that I can work with the raw images. When I try to read the files off the sd card, lightroom doesn't see them. I've had to use the sony raw converter so that ligh