orace owi??????

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了orace owi??????相关的知识,希望对你有一定的参考价值。

???????????????   ?????????   main   ?????????   children   active   get   ??????   ????????????   

???1??? OWI??????
??????????????????????????????????????????????????????????????????????????????????????????OWI????????????Oracle Wait Interface.???????????????P1???P2???P3???????????????v$session_wait???v$session????????????????????? ??????sql trace???????????????????????????P1???P2???P3????????????????????????????????????v$event_name????????????????????????Oracle???????????????????????????????????????????????????????????????????????????????????????????????????OWI??????????????????????????????????????????P1???P2???P3????????????????????????????????????????????????P1???P2???P3??????????????????v$event_name?????????Oracle?????? Reference???
Oracle???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????(Response Time)=???????????????Service Time???+???????????????Wait Time??????
??????OWI???????????????????????????????????????????????????????????????OWI?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Oracle 10g???????????????AWR?????????????????????????????????OWI?????????????????????????????????????????????????????????????????????
?????????Oracle 8i???buffer cache hit ratio(BCHR),??? ???????????????????????????????????????????????????????????????Oracle 9i???????????????????????????BCHR???????????????BCHR?????????????????????I/O????????????????????????cpu???????????????????????????????????????????????????????????????????????????????????????????????????I/O????????????????????????CPU??????????????? ?????????BCHR???????????????????????????????????????Oracle???????????????????????????????????????????????????????????????????????????Buffer Pinning????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????BCHR?????????????????????????????????
OWI?????????????????????????????????????????????????????????????????????????????????????????????????????????OWI?????????????????????????????????????????????????????????????????????????????????????????????????????? ?????????OWI?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????OWI??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????OWI???Oracle??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????DBA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Oracle?????????????????????????????????????????????????????????????????????OWI??????????????????????????????????????????????????????
???Oracle 10g?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Oracle 10g???????????????AWR???OWI??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????????????Oracle???????????????????????????????????????????????????????????????Buffer Cache /Library Cache/Row Catch/IO/Transaction/Segment/Sql statement/Network"???????????????
pdf????????????????????????????????????????????????
1.3 OWI??????
1.3.1.OWI???????????????v$event_name,v$system_event,v$session_event,v$session_wait???state=waiting,event<>idle???,v$session_wait_history(??????????????????10?????????????????????,v$system_wait_class,v$session_wait_class,v$event_histogram.
1.3.2.???????????????????????????
v$session :????????????
v$active_session_history ???????????????????????????,AWR??????????????????????????????share pool???ASH buffers?????????Oracle ??????DMA?????????????????????ASH
v$process ???????????????
v$transaction ???????????????
v$latch,v$latch_parent,v$latch_children,v$latch_holder ??????????????????
v$lock,v$locked_object,v$enqueue_lock ????????????
v$sql ???sql??????
v$librarycache,x$kgllk,v$kglpn ???????????????????????????
v$rowcache,v$rowcache_parent : ????????????????????????
v$sgastat ???SGA??????
v$segment_statistics ???Segment Level????????????
v$sess_time_model,v$sys_time_model ???Time Model??????
v$bh,x$bh ????????????????????????

SYS AS SYSDBA>select pool,name,bytes from v$sgastat where name=???ASH buffers???;
POOL NAME BYTES
------------ -------------------------------------------------- ----------
shared pool ASH buffers 2097152
SYS AS SYSDBA>select distinct statistic_name from v$segment_statistics;

STATISTIC_NAME
----------------------------------------------------------------
gc buffer busy
db block changes
space used
segment scans
gc cr blocks received
gc current blocks received
row lock waits
buffer busy waits
physical reads
physical reads direct
physical writes
space allocated
logical reads
physical writes direct
ITL waits

15 rows selected.

x$bh,v$bh???????????????????????????????????????????????????????????????

1.3.3 Extended Sql Trace
?????????10046??????????????????????????????(1,4,8,12)
?????????
?????????SQL???????????????sql trace?????????????????????????????????????????????level 12??????????????????sql trace?????????????????????????????????tkprof?????????????????????????????????????????????????????????????????????????????????
for example:
1????????????????????????????????????
alter session set events ???10046 trace name context forever,level 12???;
alter session set events ???10046 trace name context off???;
2)??????dbms_system????????????????????????Trace??????
exec sys.dbms_system.set_bool_param_in_session(sid=>,serial=>,parname=???TIMED_STATISTICS???,bval=>true);
exec sys.dbms_system.set_int_param_in_session(sid=>,serial=>,parname=>???MAX_DUMP_FILE_SIZE???,intval=>214783647);
exec sys.dbms_system.set_ev(sid,serial#,10046,12,??????);
3)??????dbms_monitor?????????????????????????????????Service???Module???Action???????????????????????????????????? ???????????????trace??????????????????trcsess?????????????????????????????????????????????????????????
4)??????oradebug??????????????????????????????
oradebug setospid 12345
oradebug unlimit
oradebug event 10046 trace name context forever,level 12
...
oradebug event 10046 trace name context off
oradebug tracefile_name ?????????????????????
1.3.4 oradebug???dump
oradebug????????????????????????????????????,????????????????????????USER_DUMP_DEST????????????????????????
??????????????????????????????10046,10053??????????????????
???????????? ????????????SGA???PGA???library cache???row cache???buffers???enqueue???latch???heap???hanganalyze??????????????????????????????????????????????????????Oracle???????????????
sql>oradebug setmypid --????????????????????????
sql>oradebug dump library_cache 10
sql>oradebug dump row_cache 10
sql>oradebug dump buffers 10
sql>oradebug dump latches 10
sql>oradebug dump headdump 2
sql>oradebug dump systemstate 10
sql>oradebug dump processstate 10
sql>oradebug tracefile_name
sql>oradebug unlimit
???????????? ???????????????????????????????????????????????????
sql>oradebug setospid 
sql>oradebug suspend
sql>oradebug resume
1.3.5 Automatic Workload Repository
AWR????????????????????????
Active Session History
????????????sql??????
???????????????????????????Time Model?????????
??????Segment??????????????????????????????????????????
v$sesstat???v$sysstat???v$system_event???v$session_event??????

1.5 ??????
?????????????????????
show_space
print_table
my_sess_event.sql:??????????????????v$session_event???????????????
sql>select event,total_waits ,time_waited from v$session_event
where sid=(select sid from v$mystat where rownum=1)
order by 3 desc;

show_param.sql: ??????????????????????????????????????????
sql> select ksppinm,ksppstvl
from x$ksppi x,x$ksppcv y
where(x.indx=y.indx)
and (translate(ksppinm,???_???,???#???) like ???%&1%???)

system_event.sql:v$system_event????????????????????????????????????????????????
sql> select * 
from (
select event,total_waits,time_waited
from v$system_event
where wait_class<>???Idle???
order by 3 desc
)where rownum<=100;

sesstat.sql??????????????????v$sesstat????????????
sql> select n.name,sum(s.value) 
from v$sesstat s,v$statname n 
where n.name like ???%&stat_name%??? and s.statistic#=n.statistic# and s.sid=(select sid from v$mystat where rownum=1)
group by n.name

undosize.sql :?????????????????????Undo????????????
sql> select used_ublk,used_urec
from v$transaction t,v$session s
where s.sid=(select sid from v$mystat where rownum=1)
and s.taddr=t.addr


???2??? Latch ??? Lock
Oracle??????????????????????????????Oracle??????????????????latch????????????lock??????????????????????????????????????????
?????????Oracle???????????????Mega-User???Mega-Resource?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
OWI??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
2.2 Latch
???Oracle concept??????latch?????????lightweight lock???????????????latch???lock?????????????????????????????????????????????????????????????????????????????????share pool????????????????????????latch??????????????????????????????????????????latch???get???release???????????????????????????????????????
latch????????????????????????SGA?????????SGA??????????????????????????????????????????latch???????????????????????????latch??????????????????????????????????????????????????????latch???????????????Oracle 9i?????????????????????latch free?????????latch free????????? p1=address???p2=latch#??????????????????????????????10g??????????????????latch?????????????????????????????????????????????latch?????????latch free???????????????
latch????????????????????????
???(parent)latch :???????????????????????????????????????
??????(solitary)latch ???????????????????????????????????????
???(child)lanth ?????????????????????????????????
Oracle????????????latch?????????????????????????????????????????????????????????????????????v$latch_parent?????????v$latch_children????????????????????????????????????latch?????????????????????????????????
latch??????????????????Oracle???latch???????????????????????????????????????????????????????????????latch??????????????????latch?????????latch?????????????????????????????????????????????latch?????????????????????????????????latch???????????????????????????????????????????????????????????????????????????latch??????????????????????????????????????????????????????latch??????????????????????????????latch????????????No-wait??????????????????????????????????????????????????????latch???????????????Exclusive?????????
Lath????????????Willing-to-wait ?????? No-wait??????
1???Willing-to-wait????????????Latch??????
?????????latch????????????????????????Willing-to-wait?????????????????????????????????latch??????????????????????????????????????????
************************************latch???????????????****************************************

?????????latch??????????????????????????????????????????spin???????????????????????????cpu??????????????????????????????????????????????????????????????????OS??????????????????context switching,??????????????????????????????????????????cpu??????spin??????????????????latch???????????????????????????cpu??????????????????????????????????????????????????????????????????latch???spin????????????????????????????????????????????????????????????cpu?????????????????????????????????
????????????spin?????????????????? latch???????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????Exponential backoff sleep??????????????????latch?????????????????????????????????(1/100)???????????????1???1???2???2???4???4???8???8???16???16????????????????????????????????????2????????????????????????spin?????????cou???????????????
????????????latch???????????????latch wait list)?????????????????????????????????????????????????????????????????????latch wait posting???????????????????????????latch???????????????
share pool latch???library cache latch?????????latch?????????????????????????????????????????????2????????????
2???No-wait?????????latch?????????
???????????????v$latch???v$latch_parent???latch_children.
?????????????????????Misses/Gets>1%(willing-to-wait) or Immediate_misses/(immediate_gets+immediate_misses)>1% (No-wait)
??????wait_time???
??????latch????????????????????????
latch:cache buffers chains???latch:cache buffers lru chain???latch:share pool???latch:library cache???latch:redo copy.

2.3 ???
Oracle??????????????????????????????????????????????????????????????????????????????????????????????????????Oracle???????????????Steve Adams??????????????????????????????????????????
Enqueue???????????????Enqueue??????????????????.(44???????????????Enqueue??????)???Enqueue lock??????????????????
User type lock:TX,TM,UL
system type lock:CF,US,CI,TC,JS,...
v$lock:type???ID1???ID2
v$session_wait:P1???P2???P3 (P1=name|mode???P2=ID1???P3=ID2)
select chr(bitand(p1,-16777216)/16777215)||chr(bitand(p1,16711680)/65535) "name",bitand(p1,65535) "Mode" from dual;
??????????????????????????????Enqueue??????????????????????????????????????????????????????????????????????????????????????????????????????????????????v$session_wait????????????????????????????????????
row cache lock
library cache lock,library cache pin
buffer lock
???????????????????????????row cache lock,buffer busy waits,read by other session,library cache lock,library cache pin,DFS lock handle

?????????latch??????SGA?????????lock??????????????????database???Enqueue????????????????????????????????????????????????????????????lock???????????????????????????????????????????????????????????????ID1???ID2????????????????????????????????????????????????????????????????????????
?????????????????????
???????????????
0 None 
1 Null???N??? 
2 Sub-Shared(SS)???Row-Shared(RS) 
3 Sub-exclusive(SX) ??? Row-Exclusive(RX) 
4 Shared(S) 
5 Shared-Sub-Exclusive(SSX) ???Shared-Row-Exclusive(SRX) 
6 Exclusive(X) 
?????????????????????
N SS SX S SSX X 
N O O 0 O O O 
SS O O 0 O O X 
SX O O 0 X X X 
S O O X O X X 
SSX O O X X X X 
X O X X X X X 
Enqueue?????????????????????????????????????????????Enqueue?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????deadlock??????????????????????????????
????????????????????????v$lock,v$locked_object,dba_waiters 
metalink doc id:122793.1 download........


N SS SX S SSX X 
N O O 0 O O O 
SS O O 0 O O X 
SX O O 0 X X X 
S O O X O X X 
SSX O O X X X X 
X O X X X X X


???????????????????????????dump??????????????????????????????
???3??? Oracle???????????????OWI
3.1 buffer cache(???????????????) ???OWI
3.1.1 buffer cache??????
sql>show aga
Oracle ??????????????????buffer cache,??????Hash Chain?????????Hash Chain???????????????????????????Oracle?????????????????????????????????Bucket->chain->Header?????????

------------------54????????????-----------------------------------

 


--------------------------------------------------------------
????????????hash??????buffer header???hash bucket????????????(chain)??????????????????buffer header????????????????????????Meta????????????????????????????????????????????????????????????????????????hash chain??????share pool???????????????????????????????????????buffer cache.
Hash Chain????????????cache buffers chains latch???????????????????????????????????????????????????????????????cache buffers chain latch?????????cache buffers chains latch???????????????Hash Chain???Oracle 9i????????????cache buffers chains latch???shared ????????????????????????????????????????????????????????????????????????????????????????????????cache buffers chains latch.?????????????????????????????????buffer lock???????????????cache buffers chains latch???Exclusive??????????????????????????????????????????????????????????????????cache buffers chains latch ?????????
sql>select count(*) from v$latch_children where name=???cache buffers chains???; --cache buffers chains latch?????????
3.1.2 Working Set
Oracle??????????????????buffer cache,????????????LRU???least recently used)???????????????List Scan???????????????LRU???LRUW????????????main list(??????) ??? auxiliary list (??????).
LRU???
--?????? :??????????????????????????????hot???cold?????????????????????(keep????????????Recycle?????????????????????????????????????????????????????????????????????????????????Hot??????)
--?????? :??????????????????????????????????????????????????????????????????????????????DBWR????????????????????????
LRUW???
--?????? ???????????????????????????
--?????? ???????????????DBWR????????????????????????
LRU???LRUW??????????????????pair??????????????????????????????????????????(working set)??????working set=LRU+LRUW???ORACLE?????????????????????????????????cache buffers lru chain latch ????????????????????????
sql>select count(*) from v$latch_children where name=???cache buffers lru chain???;
Oracle??????????????????(buffer pool)???????????????????????????????????????cache buffers lru chain latch???
sql> 
--x$kcbwds=working Set, x$kcbwbpd=Buffer pool, v$latch_children=latch
select d.blk_size,c.child#,p,bp_name,c.gets,c.sleeps
from v$kcbwds d, v$latch_children c, x$kcbwbpd p
where d.set_latch=c.addr
and d.set_id between p.bp_lo_sid and p.bp_hi_sid
order by c.child#;
Server process??????????????????buffer cache?????????LRU????????????????????????LRU??????????????????Oracle 8i???????????????????????????????????????LRU???????????????touch count?????????LRU??????????????????????????????LRU???????????????????????????????????????

------------59 ???---------------------------------------------------

 

----------------------------------------------------------------
????????????LRU?????????????????????Hot?????????Cold?????????????????????????????????????????????LRU????????????????????????????????????????????????Single Block I/O?????????????????????Mid-point.Multi-Block I/O?????????????????????cold?????????????????????full table scan or Index Full Scan???
3.1.3 Buffer Lock
????????????cache buffers chains latch???catch buffers lru chain latch????????????Hash Chain??????????????????(LRU+LRUW)??????????????????buffer lock??????????????????????????????????????????
3.1.4?????????????????????????????????
start: ????????????????????????DBA????????????hash????????????hash????????????Hash????????????Hash bucket 
--> ????????????Hash Bucket???cache buffers chains latch?????????Hash Bucket??????chain?????????????????????buffer Header????????????,??????????????????buffer lock(buffer busy waits or write complete waits).?????????????????????????????????logic reads??? 
--> ???buffer cache?????????????????????????????????????????????cache buffers lru chain latch?????????????????????????????????????????????????????????exclusive????????????buffer lock(read by other session)???????????????????????????????????????????????????,?????????????????????????????????????????????????????????physical reads??????LRU??????????????????????????????????????????????????????DBWR??????????????????????????????????????????????????????????????????(free buffer waits)???
3.1.5 buffer cache dump ???
sql>alter session set event ???immediate trace name buffers level 1???; ??????
sql>oradebug dump buffers 1
??????X$BH????????????????????????Buffer Header????????????????????????v$latch_children ??? v$tablespace ...

3.2 shared pool/Library Cache ???OWI
3.2.1 shared pool ??????
sql>show sga
sql>select count(*) from v$sgastat where pool =???shared pool???; --?????????????????????????????????
sql>select * 
from (
select name ,bytes from v$sgastat where pool =???shared pool???
order by bytes desc
) where rownum<=20;
shared pool??????????????????????????????
*Permanent Area:peocess,session,segment array(enqueue,transaction...)????????????????????????????????????Enqueue??????????????????????????????????????????????????????????????????(Permanent Area)??????????????????????????????
*Library Cache:????????????SQL???????????????????????????(SQL??????????????????Procedure???)??????
*Row Cache????????????Dictionary Cache,??????Oracle??????????????????(dictionary)?????????
*Reserved Area:???????????????????????????????????????Oracle??????????????????????????????
???????????????????????????????????????????????????????????????Heap Manager(KGH,kernel Ceneric Heap)??????????????????Oracle?????????????????????????????????????????????????????????shared pool????????????Granule????????????????????????????????????????????????(heap)???????????????
-----------------------??? 69 ------------------------------------

 


---------------------------------------------------------------------
sql>alter session set events ???immediate trace name headdump level 2???;
???????????????
??????Hard Parsing???????????????shared pool?????????sql????????????????????????????????????????????????shared pool latch. shared pool latch ????????????????????????????????????????????????????????????chunk??????????????????????????????
Oracle 9i?????????????????????shared pool???????????????????????????????????????????????????????????????LRU??????shared pool latch???????????????????????????????????????????????????????????????shared pool latch?????????
3.2.2 ??????????????????(library cache)??????
??????????????????????????????????????????????????????????????????sql??????????????????????????????????????????????????????????????????Hash Table???Bucket???Chain???Handle???Objec??????????????? ??????Library Cache Handle????????????Library Cache Object(LCO),handle?????????LCO??????Meta????????????????????????LCO????????????????????????LCO????????????????????????????????????sql??????????????????????????????????????????LCO,???LCO)???

------------------------------??? 72--------------------------------------------------

 

 

 

-------------------------------------------------------------------------------------
sql> alter session set events ???immediate trace name library_cache level 10???;
????????????...
?????????????????????????????????????????????????????????????????????Hash Bucket???library cache latch.
--------------------------------------------------------------------------------------------
??????library cache lock ??????library cache pin????????? by eagle 
Oracle?????????????????????????????????shared pool???????????????:lock ??? pin.
Lock???pin?????????????????????.lock?????????pin??????????????????????????????library cache handle???

Lock???handle?????????,???pin??????????????????,?????????????????????handle?????????.
???????????????????????????: Null,share,Exclusive.
????????????????????????,??????????????????Null(???)????????????share(??????)???????????????.
??????????????????,????????????Exclusive(??????)??????.

????????????Library Cache????????????,?????????????????????????????????pin?????????.
??????pin???????????????,Null,shared???exclusive.
???????????????????????????pin,????????????????????????pin.

????????????????????????????????????Package????????????????????????pin,????????????pin?????????,???????????????????????????????????????.
---------------------------------------------------------------------------------------------
3.2.3 SQL?????????
1?????????????????????sql???Oracle??????Hash bucket???library cache latch???????????????library cache????????????????????????sql???????????????LCO????????????????????????4????????????soft parsing).
2) ??????????????????sql,?????????shared pool latch?????????????????????????????????????????????chunk. ??????????????????????????????chunk???????????????????????????chunk???split????????????????????????????????????????????????????????????chunk????????????LRU????????????LRU??????????????????????????????????????????chunk???????????????????????????????????????????????????????????????????????????????????????ora-04031
3) ??????????????????chunk??????sql?????????handel(library cache handel)???exclusive????????????????????????LCO???????????????LCO????????????library cache lock?????????Null????????????library cache pin???Exclusive????????????????????????executing plan. 2~3???????????????hard parsing.
4) Oracle???Sql Cursor???shared????????????library cache lock???library cache pin????????????sql?????????????????????????????????(???DDL??????)??????????????????????????????????????????LCO???Exclusive????????????library cache lock???library cache pin???
5??? oracle??????????????????Sql Cursor Fetch????????????Fetch????????????sql cursor???library cache lock?????????null??????????????????library cache pin???Oracle concepts?????????null???????????????library cache lock??????breakable parse lock.
????????????Parsing?????????????????????library cache latch??????????????????????????????????????????library cache latch?????????????????????????????????????????????Oracle?????????library cache latch??????????????????????????????
1?????????pl/sql??????????????????sql cursor???????????????????????????parsing,????????????soft parsing??????????????????Oracle???sql cursor?????????LCO pin???SGA??????????????????????????????library cache latch???????????????LCO.
2??????????????????????????????LCO?????????????????? ?????????session cursor caching.Oracle??????????????????????????????3?????????sql cursor???????????????library cache???????????????sql??????????????????PGA???????????????????????????soft parsing,????????????library cache latch??????????????????library cache????????????????????????LCO??????????????????????????????library cache latch?????????????????????????????????

3.3 ?????????OWI
3.3.1 ???????????????
???????????????????????????????????????????????????Oracle???????????????????????????????????????Oracle???????????????????????????????????????????????????????????????DML??????????????????????????????Oracle??????????????????????????????
1)???????????????????????????(undo segment).(???????????????????????????????????????????????????enq:US-contention)
2) ??????????????????????????????????????????????????????slot(transaction table slot).
3) ???????????????????????????TXID???transaction ID???,?????????TXID????????????????????????TXID??????v$transaction?????????XIDUSN??? XIDSLOT??? XIDSQN?????????
4) ????????????????????????????????????????????????????????????ITL(Interestd Transaction List)?????????????????????(transaction entry)??????enq:Tx-allocate ITL entry)
5) ??????????????????????????????????????????PGA???Change Vector???.????????????????????????????????????????????????(change vector#1)????????????(change vector#2)????????????(change vector#3)?????????change vector.?????????PGA???change vector?????????redo record(???redo entry)???????????????????????????(latch:redo copy???redo allocation???redo writing)
6) ?????????????????????(before image)???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????CR???consistent read)??????????????????????????????????????????????????????????????????enq:Tx-row lock contention)
7) ??????????????????????????????SCN???????????????????????????????????????????????????????????????????????????????????????????????????PGA??????????????????????????????????????????LRUW?????????????????????????????????,?????????????????????????????????????????????????????????????????)
8) ?????????????????????????????????????????????????????????????????????TX?????????????????????????????????
9) ?????????????????????????????????????????????????????????????????????????????????DBWR????????? ??????????????????
???????????????????????????7??????
-----------------------------------81 ???------------------------------------------------------

 

 


------------------------------------------------------------------------------------------------------
????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????82???dump???????????? 1????????? ???????????????????????????(Delayed block cleanout)???????????????????????????????????????????????????????????????????????????????????????
???????????????:?????????????????????Oracle??????????????????????????????????????????ITL????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????slot???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????block cleanout???????????????????????????row level lock?????????????????????cleanout,row level lock??????????????????ITL??????(SCN???Flag???Lock byte???)???????????????
???:Oracle???Row level lock????????????????????????????????????????????????????????????????????????[???????????????+????????????????????????(ITL)+????????????????????????slot+Tx???]?????????????????????????????????????????????row level lock?????????TX?????????????????????Tx???????????????Row level lock???????????????????????????????????????row level lock. ??????????????????????????????????????????Meta?????????Oracle?????????????????????????????????????????????????????????????????????????????????????????????

3.4 ??????OWI
3.4.1 ????????????
HWM:oracle ?????????????????????????????????????????????
??????HWM??????????????????HW?????????????????????(enq:HW-contention).???????????????????????????????????????????????????????????????HWM??????????????????HW????????????Oracle????????????????????????????????????FLM(??????????????????ASSM?????????????????????
3.4.2 ????????????????????? FLM
??????FLM??????Oracle??????????????????????????????????????????????????????linked list?????? ????????????????????????????????????????????????????????????(header)??????(tail)???????????????pctfree,pctused)???
Oracle????????????????????????????????????????????????????????????????????????????????????????????????Freelist????????????????????????freelist?????????=1(default)??????????????????????????????????????????????????????????????????????????????????????????Oracle??????HW????????????HWM??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????(buffer busy wait???????????????????????????????????????????????????????????????????????????????????????????????????buffer lock?????????????????????????????????????????????????????????freelist????????????????????????buffer lock???????????????freelist??????????????????????????????HWM?????????????????????HWM=freelists*BUMP_HIGHWATER_MARK_COUNT)?????????buffer lock???????????????HW????????????????????????????????????????????????????????????freelist???????????????????????????????????????????????????????????????
Oracle????????????????????????????????????????????????(freelist group)????????????RAC??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
3.4.3??????????????????????????????ASSM
??????ASSM????????????????????????freelist???????????????????????????????????????(bitmap)?????????????????????????????????????????????????????????????????????3??????????????????(root node???branch node???leaf node),??????leaf node??????DBA?????????dba??????????????????????????????????????????????????????16???1024????????????)???????????????????????????????????????full???Unformated???0???25%free???25%~50%free???50%~75%free???75%~100%free???6????????????pctused??????????????????????????????pctfree????????????????????????
----------------------------------95 ???-----------------------------------------

 

 

---------------------------------------------------------------------------------------
ASSM??????????????????RAC??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

3.5 I/O???OWI
3.5.1 I/O??????
???????????????I/O?????????oracle??????????????????????????????Oracle??????I/O??????????????????(layer)??????????????????
1.??????????????????select???insert???update???delete???truncate...
??????????????????I/O???????????????I/O???????????????????????????????????????
parallel query???parallel dml???Nologging???Direct load???Direct read???????????????(analytical function)???cluster???IOT???Partitoning???Bitmap Index...
2.Oracle????????????buffer cache | PGA
??????????????????????????????????????????I/O?????????I/O??????????????????????????????????????????Oracle?????????????????????
touch count?????????????????????LRU??????
buffer pinning?????????????????????latch??????
??????????????????????????????????????????????????????????????????Keep bufer??????????????????????????????????????????Recycle buffer?????????????????????????????????oracle 10g????????????????????????FTS??????????????????????????????????????????????????????touch count?????????????????????????????????????????????????????????????????????????????????keep buffer.
???????????????
Direct path I/O?????????buffer cache???parallel query,parallel dml????????????????????????direct path I/O,??????????????????????????????direct path I/O,LOB????????????????????????????????????????????????????????????LOB??????storage??????????????????direct path i/o??????conventional path i/o
3.Oracle?????????Datafile???tempfile???tablespace???segment
Oracle????????????????????????I/O?????????????????????????????????????????????????????????I/O??????????????????????????????????????????I/O???????????????OS??????Direct I/O(??????OS??????????????????,????????????????????????????????????????????????????????????)??????????????????????????????I/O????????????????????????OS???????????????????????????????????????????????????????????????????????????????????????????????????????????????I/O???????????????????????????I/O?????????????????????????????????
4.OS/???????????????Asynch I/O???Direct I/O???Raw device???Raid...
metalink???29676.1 ?????????
metalink: 500216.995 ?????????????????????
30286.1 raid
3.5.6 Direct path I/O
?????????????????????????????????????????????????????????DBWR?????????????????????????????????????????????????????????????????????????????????????????????????????????buffer cache??????????????????????????????????????????????????????????????????????????????????????????????????????????????????direct path i/o?????????????????????????????????????????????I/O????????????
????????????oracle??????????????????OS?????????????????????????????????????????????????????????????????????

3.6 ?????????OWI
3.6.1 ????????????
???DML?????????????????????buffer cache?????????????????????redo buffer??????buffer cache??????dirty buffer?????????datafile????????????????????????????????????redo buffer?????????redo log files???
???????????????????????????????????????????????????
-???????????? (undo segment header)
-????????? (undo block)
-???????????? (data segment header)
-????????? (data block)
??????????????????????????????????????????????????????....???
??????????????????????????????????????????????????????redo
?????????????????????dml????????????+direc load operation???????????????dml????????????????????????????????????????????????
....
...
..
.

3.6.2 ???????????????
?????????buffer cache???????????????Oracle?????????????????????redo buffer??????????????????
1)??????????????????????????????????????????PGA)???Change Vector?????????Change Vector??????????????????????????????????????????????????????????????????????????????latch???redo copy???
2)??????????????????SCN???????????????????????????SCN?????????????????????SCN???
3)??????redo allocation latch?????????redo buffer??????????????????????????????????????????????????????????????????redo writing latch,???LGWR?????????redo buffer???????????????redo log files.??????LGWR??????????????????????????????????????????????????????log c?????????????????????????????????redo allocation latch???
4)???PGA????????????change vector ??????????????????????????????????????????????????????????????????redo copy latch???
5)???Oracle 8i?????????redo allocation latch??????????????????????????????????????????redo allocation latch????????????????????????Oracle 9i??????????????????????????????????????????shared redo strands,??????strand???????????????redo allocation latch.
3.6.3 ????????????
Oracle????????????????????????????????????????????????????????????(group commits)???

以上是关于orace owi??????的主要内容,如果未能解决你的问题,请参考以下文章

orace学习操作

Navicat Oracal

Orac and Medians

Orac and Medians

关于oracal过程及语句,自己整理避免遗忘

Orace 增删改查