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的UNDOTBS01.DBF文件太大的解决办法
1、.禁止undo tablespace自动增长
alter database datafile 'full_path\undotbs01.dbf' autoextend off;
2.-- 创建一个新的小空间的undo tablespace
create undo tablespace undotBS2 datafile ......
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 ......
Oracle日期函数学习时,在教程有几个实例如下:
Months_between(’01-sep-95’, ’11-jan-94’)
结果是:19.6774194
Add_months 在指定的月份上面增加相应得月份
例如:
Add_months(’11-jan-94’, 6)
结果是:11-jul-94
Next_day 计算规定日期的后一个特定日期
例如:
Next_ ......
PRAGMA RESTRICT_REFERENCES(),这个PRAGMA比较复杂, 总的来说,它是一个程序辅助检验码,检查子程序的纯度(PURITY),帮助检验子程序是否有违反规则的地方。一般用在函数上,但当函数调用过程时,也要作相应的设置检查。这是为了避免当在DML语句上调用函数时正常执行不至于产生错误。
语法,PRAGMA ......