Library Cache miss pct of INDEX is too high
Our production database is 10g Rel 1, having runing three months since last restart. Following is statspack report for one working day. What I don't understand is why INDEX miss pct is so high up to 85.3% and 81.7%. Any body has idea?
Get Pct Pin Pct Invali-
Namespace Requests Miss Requests Miss Reloads dations
BODY 10,872 0.7 3,331,999 0.0 27 0
CLUSTER 350 2.9 800 1.6 3 0
INDEX 136 85.3 142 81.7 0 0
SQL AREA 2,340,810 0.5 51,960,897 0.1 8,448 48
TABLE/PROCEDURE 660,384 12.1 6,782,998 0.4 7,775 0
TRIGGER 8,148 0.5 94,538 0.1 41 0
-------------------------------------------------------------
Check the sql statements
select username, sql_text
from v$sqlarea , dba_users
where
parsing_user_id = user_id
and username not like 'SYS%'
and sql_text not like '%:%';
Similar Messages
-
User Library "Caches" missing/invisible?
This is a problem that seems to have happened since I installed SL.
I am scanning my CD booklets into my Macbook Pro, basically so I can read them more easily using the zoom facility. Using an app called CdPedia, they were stored as follows:
file:///Users/meng/Library/Caches/Metadata/CDpedia/eli-b-f.jpg
However, the Caches folder containing all my jpg's has vanished (although the Main Library Caches folder is still there). No problem, I thought, I'll just restore from Time Capsule.
But no - I go into TC (backups back to March 2009) and there's no User Caches in there either, no matter which backup I look at. (As a separate issue, spotlight doesn't seem to work in TC either so I am unable to search for any jpg's.)
So can anyone speculate as to whether I've lost all my pics, or are they still there somewhere but hidden from me? And why doesn't Spotlight work in TC?
I'd appreciate any thoughts or speculation. Thanks.Peter Wilson1 wrote:
This is a problem that seems to have happened since I installed SL.
I am scanning my CD booklets into my Macbook Pro, basically so I can read them more easily using the zoom facility. Using an app called CdPedia, they were stored as follows:
file:///Users/meng/Library/Caches/Metadata/CDpedia/eli-b-f.jpg
However, the Caches folder containing all my jpg's has vanished (although the Main Library Caches folder is still there). No problem, I thought, I'll just restore from Time Capsule.
But no - I go into TC (backups back to March 2009) and there's no User Caches in there either, no matter which backup I look at. (As a separate issue, spotlight doesn't seem to work in TC either so I am unable to search for any jpg's.)
So can anyone speculate as to whether I've lost all my pics, or are they still there somewhere but hidden from me? And why doesn't Spotlight work in TC?
I'd appreciate any thoughts or speculation. Thanks.
Time Machine excludes most caches. It backs-up the <user>/Library/Caches folder to preserve the structure, but excludes the contents. -
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 -
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 -
High library cache load lock waits in AWR
Hi All,
Today i faced a significant performance problem related to shared pool. I made some observations, thought it would be a nice idea to share them with Oracle experts. Please feel free to add your observations/recommendations and correct me where i am wrong.
Here are the excerpts from AWR report created for the problem timing. Database server is on 10.2.0.3 and running with 2*16 configuration. DB cache size is 4,000M and shared pool size is of 3008M.
Snap Id Snap Time Sessions Cursors/Session
Begin Snap: 9994 29-Jun-09 10:00:07 672 66.3
End Snap: 10001 29-Jun-09 17:00:49 651 64.4
Elapsed: 420.70 (mins)
DB Time: 4,045.34 (mins) -- Very poor response time visible from difference between DB time and elapsed time.
Load Profile
Per Second Per Transaction
Redo size: 248,954.70 23,511.82
Logical reads: 116,107.04 10,965.40
Block changes: 1,357.13 128.17
Physical reads: 125.49 11.85
Physical writes: 51.49 4.86
User calls: 224.69 21.22
Parses: 235.22 22.21
Hard parses: 4.83 0.46
Sorts: 102.94 9.72
Logons: 1.12 0.11
Executes: 821.11 77.55
Transactions: 10.59 -- User calls and Parse count are almost same, means most of the calls are for parse. Most of the parses are soft. Per transaction 22 parses are very high figure.
-- Not much disk I/O activity. Most of the reads are being satisfy from memory.
Instance Efficiency
Buffer Nowait %: 100.00 Redo NoWait %: 100.00
Buffer Hit %: 99.92 In-memory Sort %: 100.00
Library Hit %: 98.92 Soft Parse %: 97.95
Execute to Parse %: 71.35 Latch Hit %: 99.98
Parse CPU to Parse Elapsd %: 16.82 % Non-Parse CPU: 91.41 -- Low execute to parse ratio denotes CPU is significantly busy in parsing. Soft Parse% showing, most of the parse are soft parses. It means we should concentrate on soft parsing activity.
-- Parse CPU to Parse Elapsed % is quite low, means some bottleneck is there related to parsing. It could be a side-effect of huge parsing pressure. Like CPU cycles are not available.
Shared Pool Statistics
Begin End
Memory Usage %: 81.01 81.92
% SQL with executions>1: 88.51 86.93
% Memory for SQL w/exec>1: 86.16 86.76 -- Shared Pool memory seems ok (in 80% range)
-- 88% of the SQLs are repeating ones. It's a good sign.
Top 5 Timed Events
Event Waits Time(s) Avg Wait(ms) % Total Call Time Wait Class
library cache load lock 24,243 64,286 2,652 26.5 Concurrency
db file sequential read 1,580,769 42,267 27 17.4 User I/O
CPU time 33,039 13.6
latch: library cache 53,013 29,194 551 12.0 Concurrency
db file scattered read 151,669 13,550 89 5.6 User I/O Problem-1: Contention on Library cache: May be due to under-sized shared pool, incorrect parameters, poor application design, But since we already observed that most of the parses are soft parses and shared pool usgae in 80%, seems problem related to holding cursors. open_cursors/session_cached_cursors are red flags.
Problem-2: User I/O, may be due to poor SQLs, I/O sub-system, or poor physical design (wrong indexes are being used as DB file seq reads)
Wait Class
Wait Class Waits %Time -outs Total Wait Time (s) Avg wait (ms) Waits /txn
Concurrency 170,577 44.58 109,020 639 0.64
User I/O 2,001,978 0.00 59,662 30 7.49
System I/O 564,771 0.00 8,069 14 2.11
Application 145,106 1.25 6,352 44 0.54
Commit 176,671 0.37 4,528 26 0.66
Other 27,557 6.31 2,532 92 0.10
Network 6,862,704 0.00 696 0 25.68
Configuration 3,858 3.71 141 37 0.01
Wait Events
Event Waits %Time -outs Total Wait Time (s) Avg wait (ms) Waits /txn
library cache load lock 24,243 83.95 64,286 2652 0.09
db file sequential read 1,580,769 0.00 42,267 27 5.91
latch: library cache 53,013 0.00 29,194 551 0.20
db file scattered read 151,669 0.00 13,550 89 0.57
latch: shared pool 25,403 0.00 12,969 511 0.10
log file sync 176,671 0.37 4,528 26 0.66
enq: TM - contention 1,455 90.93 3,975 2732 0.01 Instance Activity Stats
opened cursors cumulative 5,290,760 209.60 19.80
parse count (failures) 6,181 0.24 0.02
parse count (hard) 121,841 4.83 0.46
parse count (total) 5,937,336 235.22 22.21
parse time cpu 283,787 11.24 1.06
parse time elapsed 1,687,096 66.84 6.31 Latch Activity
library cache 85,042,375 0.15 0.43 29194 304,831 7.16
library cache load lock 257,089 0.00 1.20 0 69,065 0.00
library cache lock 41,467,300 0.02 0.07 6 2,714 0.07
library cache lock allocation 730,422 0.00 0.44 0 0
library cache pin 28,453,986 0.01 0.16 8 167 0.00
library cache pin allocation 509,000 0.00 0.38 0 0 Init.ora parameters
cursor_sharing= EXACT
open_cursors= 3000
session_cached_cursors= 0
-- open_cursors value is too high. I have checked that maximum usage by a single session is 12%.
-- session_cached_cursors are 0 causing soft parsing. 500/600 is good number to start with.
cursor_sharing exact may cause hard parses. But here, hard parsing is comparatively small, we can ignore this.
From v$librarycache
NAMESPACE GETS GETHITS GETHITRATIO PINS PINHITRATIO RELOADS INVALIDATIONS
SQL AREA 162827 25127 .154317159 748901435 .999153087 107941 81886-- high invalidation count due to DDL like activities.
-- high reloads due to small library cache.
-- hit ratio too small.
-- Need to pin frequently executed objects into library cache.
P.S. Same question asked on Oracle_L, but due to formatting reasons, pasing duplicate contents here.
Regards,
Neeraj Bhatia
Edited by: Neeraj.Bhatia2 on Jul 13, 2009 6:51 AMThanks Charles. I really appreciate your efforts to diagnose the issue.
I agree with you performance issue is caused by soft parsing, which can be solved by holding cursors (session_cached_cursors). It may be due to oversized shared pool, which is causing delay in searching child cursors.
My second thought is, there is large number of reloads, which can be due to under-sized shared pool, if invalidation activities are not going (CBO statistics collection, DDL etc), cursors are being flushed frequently.
CPU utilization is continuously high (above 90%). Pasting additional information from same AWR report.
Namespace Get Requests Pct Miss Pin Requests Pct Miss Reloads Invalidations
BODY 225,345 0.76 4,965,541 0.15 5,533 0
CLUSTER 1,278 1.41 2,542 1.73 26 0
INDEX 5,982 9.31 13,922 7.35 258 0
SQL AREA 141,465 54.10 27,831,235 1.21 69,863 19,085 Latch Miss Sources
Latch Name Where NoWait Misses Sleeps Waiter Sleeps
library cache lock kgllkdl: child: no lock handle 0 8,250 5,792 Time Model Statistics
Statistic Name Time (s) % of DB Time
sql execute elapsed time 206,979.31 85.27
PL/SQL execution elapsed time 94,651.78 39.00
DB CPU 33,039.29 13.61
parse time elapsed 22,635.47 9.33
inbound PL/SQL rpc elapsed time 14,763.48 6.08
hard parse elapsed time 14,136.77 5.82
connection management call elapsed time 1,625.07 0.67
PL/SQL compilation elapsed time 760.76 0.31
repeated bind elapsed time 664.81 0.27
hard parse (sharing criteria) elapsed time 500.11 0.21
Java execution elapsed time 252.95 0.10
failed parse elapsed time 167.23 0.07
hard parse (bind mismatch) elapsed time 124.11 0.05
sequence load elapsed time 23.34 0.01
DB time 242,720.12
background elapsed time 11,645.52
background cpu time 247.25 According to this DB CPU is 65% utilization (DB CPU + Background CPU / Total Available CPU seconds). While at the same time DB host was 95% utilized (confirmed from DBA_HIST_SYSMETRIC_SUMMARY).
Operating System Statistics
Statistic Total
BUSY_TIME 3,586,030
IDLE_TIME 1,545,064
IOWAIT_TIME 22,237
NICE_TIME 0
SYS_TIME 197,661
USER_TIME 3,319,452
LOAD 11
RSRC_MGR_CPU_WAIT_TIME 0
PHYSICAL_MEMORY_BYTES 867,180
NUM_CPUS 2 -
Library Cache Pin Wait Event (within the context of APEX)
Hello,
Firstly -
Oracle Version: 10.2.0.4.0
Apex Version: 3.0.1.00.08
Okay, my colleague (no really! This isn't one of those "Ahem ... A friend of mine has contracted something nasty +downstairs+..."-type questions) is having problems compiling a package (using TOAD incidentally, but it's the same in SQL Developer).
I've searched the forum and the web for a bit of help on what's maybe happening here and it appears to be related to a concurrency conflict with the package definition - from what I can understand it's a case of the package is in use by another session, therefore another session cannot alter it at the same time (which makes sense)
"What does this have to do with APEX?"... well, he is working on this package using the following methodology:
1. Compile the package body/spec (as necessary - body more often obviously)
2. run an apex page which uses the code in a process, which may or may not result in the error page being displayed
3. Making changes to the package body/spec
repeat steps 1-3 ad nauseum...
He is the only user directly accessing the schema (and the only user accessing the page via APEX too, although I appreciate this isn't quite the same thing).
I was wondering if, due to the architecture of APEX (the use of session pools etc), the state of a package might be being retained in some manner, thus resulting in this library cache pin wait event? If so, is there anything I can do to mitigate against this occurring?
p.s. the only difference I can see between this particular package and any other package in the schema is that this one interacts with blobs (including making references to the wwv_flow_files view) - with blobs being passed as parameters between procedures (thus potentially creating temporary blobs which may or may not being closed).
Any ideas?
p.p.s. there are also no DBMS_SCHEDULER jobs or anything that might potentially be running the code incidentally...
Edited by: Joel_C on 11-Nov-2011 11:58
We got our DBAs to run a bit of code to identify the blocking session:
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,
pn.KGLPNMOD lock_mode_held,
pn.KGLPNREQ lock_mode_requested,
ses.sid,
ses.serial#,
ses.username
FROM
x$kglpn pn,
v$session ses,
x$kglob lob,
v$session_wait vsw
WHERE
pn.KGLPNUSE = ses.saddr and
pn.KGLPNHDL = lob.KGLHDADR
and lob.kglhdadr = vsw.p1raw
and vsw.event = 'library cache pin'
order by lock_mode_held descresults as follows (I've changed some object names to protect the ignorant):
OBJECT_TYP OBJECT_NAME LOCK_MODE_HELD LOCK_MODE_REQUESTED SID SERIAL# USERNAME
PACKAGE PKG_FOOBAR 2 0 356 21694 HTMLDB_PUBLIC_U
SER
PACKAGE PKG_FOOBAR 0 3 463 22309 FOOHTMLDB_PUBLIC_USER is the apex user incidentally. The session is marked in the v$session table as "inactive", the last statement being
Begin
Dbms_session.reset_package;
End;Edited by: Joel_C on 11-Nov-2011 14:39bump
No-one?
The problem seems to have 'resolved itself' over the weekend incidentally (although I don't believe anything truly resolves itself in this manner - something must have changed). -
Hi,
I am experience hanging in my database. I am using 10.2.0.3 on Solaris 5.10.
I am having automatic processes that drop the schema and recreate the schema and upload the new data. Since the last few days i am facing in hanging while dropping the schema. I checked and found "Library cache lock" event that caused other processes also in the hanged state. I am trying to find out the reason but not able to crack.
Can some one advice me?
ThanksHi,
There exists an concurrency problem with respect to the object - resource utilization.
- One client can prevent other clients from accessing the same object
- The client can maintain a dependency for a long time (for example, no other client can change the object)
check the from v$session_wait (query taken from the http://www.dba-oracle.com/m_library_cache_pin.htm - for your reference)
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,
pn.KGLPNMOD lock_mode_held,
pn.KGLPNREQ lock_mode_requested,
ses.sid,
ses.serial#,
ses.username
FROM
x$kglpn pn,
v$session ses,
x$kglob lob,
v$session_wait vsw
WHERE
pn.KGLPNUSE = ses.saddr and
pn.KGLPNHDL = lob.KGLHDADR
and lob.kglhdadr = vsw.p1raw
and vsw.event = 'library cache pin'
order by lock_mode_held desc
Resolution might - you need to check the time it takes (the script to drop the schema) and it loads - either doing from parallel sessions or in serial order. I doubt it, till the schema get dropped completely it should not be accessible to any other applications - either objects too, that makes the rise to concurrency Issue with respect to library cache waits - the other sessions are trying access the object.
- Pavan Kumar N
- ORACLE 9i/10g - OCP
http://www.oracleinternals.blogspot.com -
How can I increase my Library Cache Hit Ratio?
I was wondering if anyone can help me out regarding the values that I am getting for my Library Cache hits stats
Half of the samples that I have taken on a periodic interval today have ranged from 89% to 96%.
The SQL that I have used is,
SELECT
sysdate,
SUM(PINS-RELOADS)/SUM(PINS)*100
from v\$librarycache
Also, Running the AWR report for 4am to 4pm, see below
Shared Pool Statistics AWR report
Begin End
Memory Usage %: 50.83 42.43
% SQL with executions>1: 55.56 77.13
% Memory for SQL w/exec>1: 74.12
Regarding the current SGA settings,
SQL> show parameter sga_target;
NAME TYPE VALUE
sga_target big integer 1184M
SQL>
SQL> select pool,name,bytes/1048576 "Size in MB" from v$sgastat where name = 'free memory';
POOL NAME Size in MB
shared pool free memory 135.742641
large pool free memory 15.9389648
java pool free memory 16
The main questions are,
a) is the low Library cache hit ration particularly low?
b) if I want to improve this figure, it is advised that the 'SHARED_POOL_SIZE' parameter should be increased.
Obviously Oracle itself is in charge of this at present, so what can I do to improve?
c) Are there any really good links to help me to understand the figures that appear in the AWR report.a) is the low Library cache hit ration particularly low?
I didnt understand this.Can you please rephrase?
b)
Well indeed that shared pool controls the allocation and everything about Library Cache but it doesnt mean that increasing the value will stop all the issues.Its among the hardest parameters to be tuned infact for the reason that what primarly comes into it,sql statements,code and all that,that is not written entirely by a dba/tuner.Its by developers who does some times not so good things that are required to make shared pool work properly.Very commonly occuring mistake can be quoted as the lack of use of bind variabls and constant use of literals.In that case,eventualy we will have a hard parse of all the statements which will eat up the shared pool some time or the other.No matter what size it may be,it will end to the same result.Hit ratio is a guiding factor,not the end goal of tuning.Its been documented so many places,here,other forums,even in OU books also that looking and tuning alone the hit ratio may not end up at the expected or right results.You should look for the Parse statistics in the AWR report how they are working.How many are Parse(hard),Parse(total) statistics coming up?What is the sql execute to parse time,elapsed time and the related statistics.They will be helpful in getting things sorted out more nicely and correctly.
I am sure I have missed so much than I said.Surely you will get more better advice on this.Have patience and wait.
b)Documentation will be a good point.Performance tuning in that is a good resource.
http://www.oracle.com/pls/db102/to_toc?pathname=server.102%
2Fb14211%2Ftoc.htm&remark=portal+%28Getting+Started%29
I am not sure about a specific book about AWR but this one is good for over all knowledge about tuning of Oracle.
http://www.mcgraw-hill.co.uk/html/007222729X.html
Aman.... -
The iCloud Drive folder in Library/Mobile Documents is taking up way too much space on my startup disk
I was hoping my files would stay in the cloud and not take up a ton of space on my machine (only a 128gb SSD). But while performing an overnight time machine backup I came back to find a "Startup Disk Full" error message. I only have about 20gb used locally but over 200gb in iCloud Drive at the moment.
Is there a way to clear the cache so my files stay on iCloud and not hogging space on my SSD? Or a way to redirect this library to my 2nd hard drive?
I'm using a 15" mid-2012 Macbook Pro with a 1TB hard drive and I've replaced the optical drive with a 128gb SSD for my OS (which is where my library is, hence the difficulty).
Thank you!While puttering around after posting this I think I found my personal solution here: http://macs.about.com/od/diyguidesprojects/qt/Move-Your-Home-Folder-To-A-New-Loc ation.htm
I'm just going to move my home folder to my 2nd internal 1TB hard drive to solve my problem.
But my question remains, how can we minimize the amount of local space iCloud Drive ***** up? I wanted to get the rumored new macbook air that might come out next year but this is a big turn off if iCloud drive is going to overwhelm the SSD in the AIr. -
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 -
Database buffer cache and library cache (order)
hi
after I issue:
select * from employees where employee_id=98
which one is performed by oracle first?
Oracle looks database buffer cache for any block it needs.
If block not found in database buffer cache ;server reads block from datafile and places copy in database buffer cache
OR
parse the sql and look in library cache for same execution plan ,.....Hi Ricardinho
How does Oracle know which blocks it might need ? Does it need blocks from any indexes or does it only need blocks from a table ?
Do you think it even remotely likely that Oracle will somehow get all the blocks it needs first and then worry about determining an execution plan at some later point in time ?
Cheers
Richard Foote
http://richardfoote.wordpress.com/ -
Kill a session that is holding library cache lock!!
Hi, all.
What will happen if I kill a session that is holding library cache lock??
Currently, the session is pending with library cache lock.
I cannot see any locks in v$lock.
If I kill the session, will oracle release the library cache lock??
Thanks and Regards.What output do you get from the following script?
liblock.sql:
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
/It should provide a locking graph of all sessions that are blocked on the 'library cache lock' event, and what sessions are the blockers.
Hope that helps,
-Mark
PS It needs to run as SYSDBA, due to the X$KGLLK reference. -
High wait on Library Cache Lock while doing ALTER TABLE EXCHANGE PARTITION
We are observing a very high wait time on "Library cache lock" while performing Exchange partition.
Here we go
ALTER TABLE PSALESREG EXCHANGE PARTITION P123
WITH TABLE PBKPSALESREF WITHOUT VALIDATION
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.11 *6684.73* 2 9 2 0
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.11 6684.73 2 9 2 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
library cache lock 2274 3.12 *6681.32*
Is it a bug? is anyone there who experienced the same issue?
RgdsMaurice Muller wrote:
Hi,
As far as I remember a exchange partition can only be done when no other query is accessing the table.
So you should check if any other queries are executed against the table PSALESREG while you do the exchange partition. Maurice,
queries won't block the exchange operation but continue to read from the "original", exchanged segment; this "cross-DDL" read consistency is a feature that has been introduced a long time ago.
But any kind of (long-running) DML should effectively prevent the exchange operation. Still I would assume that this shouldn't show up as "library cache lock", but you would get an "ORA-00054: resource busy" error.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
the website loads fine, but when loading the message [ fb connect library is missing (all.js) ] appears and i cannot select a room for play. i downloaded chrome and I no longer received the message, which led me to believe that the firefox browser must have something to do with this problem. I have already cleared all browsing history and cache, including java cache, I have uninstalled Firefox and reinstalled it
I prefer firefox over chrome but will have to have chrome just to play my games.Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
"Remove Cookies" from sites causing problems:
*Tools > Options > Privacy > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do not click the Reset button on the Safe mode start window or otherwise make changes.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
Maybe you are looking for
-
Media Encoder CC Encoding Failure
I have never had any problems with Media Encoder on my system, but since ugrading from CS6 to CC suddenly the Media Encoder fails whenever I use the QUEUE rather than EXPORT on the Export Settings screen in Adobe Premiere Pro CC. When I click the Fa
-
Migrated User Account Keyboard Problem AFTER Login
I have a brand-new MacBookPro (with multi-touch trackpad) that came with Leopard preinstalled. When I first started up the new computer, I set up a new administrator user account first. Then I used Migration Assistant to migrate my primary user accou
-
Scopes not displaying in color
Neither the Parade/Overlay nor 3d scope are displaying in red, green and blue - instead, the scopes display monotone readings (sort of a golden/brownish hue) for RGB channels. I can't seem to find any kind of preferences for the scopes - could this p
-
IBooks landscape view fit to screen-width
I believe it would be very nice to have option of fit to screen-width as default landscape view. Whenever I pass to next page, everything is so small that I have to resize it manually, all the time. Thanks
-
Can you create auto numbering - alphanumeric in SAP Eureka
Hi All, Apologies if I am posting the above question in the wrong forum. Is it possible to setup autonumbering (With alphanumeric) employee number in Eureka? If yes, can you guide me please to some documentation for the same. Many Thanks Regards Bash