Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle mutex

An introduction to Mutexes in 10gR2
By Connie Green, Kumar Rajamani
from meetings with: Kumar Rajamani, Russell Green, Saureen Shah, Cecilia Gervasio and Connie Green
Introduction
This paper is intended as an introduction to mutexes.  It describes new concepts associated with mutexes, when mutexes are used, and related wait events and views.
Overview
A mutex, similarly to a latch, is a low-level serialization mechanism used to control access to a shared data structure in the SGA.  Serialization is required to avoid an object being:
? deallocated while someone is accessing it
? read while someone is modifying it
? modified while someone is modifying it
? modified while someone is reading it
Mutexes can be defined and used in many different ways.  For example:
? Each structure being protected by a mutex can have its own mutex (e.g. a parent cursor has its own mutex, and each child cursor has its own mutex)
? Each structure can be protected by more than one mutex, with each mutex protecting a different part of the structure
? A mutex can protect more than one structure
The mutex can either be stored within the structure it protects, or elsewhere.  Mutexes are usually dynamically created at the same time as the structure they protect.  If a mutex is embedded within the structure it protects, then it will be implicitly destroyed when the owning structure is freed.
Benefits of mutexes
Although mutexes and latches are both serialization mechanisms, mutexes have certain features latches do not.
Smaller and faster
Mutexes were introduced as an alternative to latches, as they are much faster to get, and smaller.  A mutex get is in the region of 30-35 instructions, compared to 150-200 instructions for a latch.  A mutex is around 16 bytes in size, compared to 112 bytes for a latch in 10.2 (in prior releases it was 200 bytes).  Some of the reduction in latch size was achieved by obsolet


Ïà¹ØÎĵµ£º

oracle systemÃÜÂëÍü¼Ç½â¾ö

1.ÓÃOracleÓû§µÇ½Linux·þÎñÆ÷;
2.ÔÚÖÕ¶Ë´°¿ÚÊäÈë sqlplus /nolog
   [oracle@hylinux ~]$ sqlplus /nolog
    SQL*Plus: Release 10.2.0.1.0 - Production on ÐÇÆÚ¶þ 7ÔÂ 29  14:26:16 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
& ......

¹ØÓÚoracleµÄ±í¿Õ¼ä£¬·ÖÇø±í£¬ÒÔ¼°Ë÷ÒýµÄ×ܽá


±í¿Õ¼ä£º
OracleµÄUNDOTBS01.DBFÎļþÌ«´óµÄ½â¾ö°ì·¨
1¡¢.½ûÖ¹undo tablespace×Ô¶¯Ôö³¤
alter   database   datafile   'full_path\undotbs01.dbf'   autoextend   off;
2.-- ´´½¨Ò»¸öеÄС¿Õ¼äµÄundo tablespace
create undo tablespace undotBS2 datafile ......

ÔÚORACLEµÃµ½Ä³¸ö±íµÄÖ÷¼ü×Ö¶ÎÃû

select column_name from all_cons_columns cc
where owner='SSH'  --SSHΪÓû§Ãû³Æ£¬Òª×¢Òâ´óСд
and table_name='SYS_DEPT' --SYS_DEPTΪ±íÃû£¬×¢Òâ´óСд
and exists (select 'x' from all_constraints c
where c.owner = cc.owner
and c.constraint_name = cc.constraint_name
and c.constraint_type ='P' ......

Oracle±í¿Õ¼ä

Oracle´´½¨É¾³ýÓû§¡¢½ÇÉ«¡¢±í¿Õ¼ä¡¢µ¼Èëµ¼³ö¡¢...ÃüÁî×ܽá 
//´´½¨ÁÙʱ±í¿Õ¼ä
create temporary tablespace zfmi_temp
tempfile 'D:\oracle\oradata\zfmi\zfmi_temp.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//tempfile²ÎÊý±ØÐëÓÐ
//´´½¨Êý¾Ý±í¿Õ¼ä
create table ......

Ö´ÐÐcommitʱoracle×öÄÄЩ¹¤×÷

COMMITÊÇÒ»¸ö·Ç³£¿ìµÄ²Ù×÷£¬µ±ÎÒÃÇ·¢²¼commitÃüÁîʱ£¬ÕæÕýÀ§Äѵ͝×÷ÒѾ­Íê³É£¬
ÔÚÊý¾Ý¿âÖÐÒѾ­Ö´ÐÐÁËÊý¾Ý¸ü¸Ä£¬ËùÒÔÒѾ­Íê³ÉÁË99%µÄÈÎÎñ£¬ÀýÈ磺ÏÂÁвÙ×÷ÒѾ­²úÉú£º
 
      1.ÔÚSGA(Buffer Cache)ÖÐÒѾ­Éú³ÉÁËundo¿é£»
      2.ÔÚSGA(Buffer Cache)ÖÐÒѾ­Éú³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ