关于oracle mutex和latch的问题
关于latch和mutex的问题
from:http://www.itpub.net/thread-1004815-1-1.html
A:
latch是闩锁,是一种串行化机制,用来保护SGA中的内存结构。
mutex是什么,也是一种串行化机制,是互斥锁?
个人对mutex没有什么概念。这个是10G新引进的?9I好像没有啊。
哪位明白人,给帮忙详细解释下mutex,最好还能和latch 做下比较。
谢谢。
B:
BTW, things get more fun in 10.2, you can pin cursors without getting library cache pin latch, using KGX mutexes. Mutexes are new in 10.2 and they enable shared access to objects in somewhat similar manner to shared latche; every successful get of a particular mutex will increment its value and a release will decrement. When the count is zero, no one has the mutex and it is safe to get it in exclusive mode. However, they are more fine-grained than kgl latches and provide a better wait mechanism, as far as I understand.
So if your environment supports atomic compare and swap operation (such as CMPXCHG on Intel), you might get away without cursor_space_for_time setting for ultrahigh execution rates. Otherwise the atomic mutex operations would be achieved using the new KGX latches.
At least on my laptop this feature isn't enabled by default (from an OracleWorld paper I remember that it should become default in 10.2.0.2), but so far you can experiment with it if you set _kks_use_mutex_pin = true and bounce the instance (mutex structures will be stored in the shared pool, so you might need to increase shared pool size).
There are also X$MUTEX_SLEEP and X$MUTEX_SLEEP_HISTORY fixed tables that can show some interesting information if you generate some mutex waits into them.
Now, I don't suggest for a moment that you have to understand this response. It is at an extremely deep technical level, and the practical applications of such understanding are probably few and far between. My point, though, is that you must take the time to study and understand Oracle internal operations if you are to have success in Oracle performance optimization. There are no shortc
相关文档:
一、利用Class.forName函数(用java开发B/S模式的程序) 1.代码如下: //注册驱动程序
public boolean connectDb() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
return true;
} catch (ClassNotFoundException e) {
System.out.println(e);
return false;
}
}
......
SqlServer,Oracle 常用函数比较
数学函数:
1.绝对值
Sql Server: SELECT abs(-1) value
Oracle: SELECT abs(-1) value from dual
2.取整(大)
Sql Server: SELECT ceiling(-1.001) value
Oracle: SELECT ceil(-1.001) value from dual
3.取整(小)
Sql Server: SELECT f ......
NLS_LANG参数由以下部分组成:
NLS_LANG= <Language>_ <Territory>. <Clients Characterset>
其中:
LANGUAGE指定:
-Oracle消息使用的语言
-日期中月份和日显示
TERRITORY指定
-货币和数字格式
-地区和计算星期及日期的习惯
CHARACTERSET:
-控制客户端应用程序使用的字符集 ......
Start with...Connect By子句递归查询一般用于一个表维护树形结构的应用。
创建示例表:
CREATE TABLE TBL_TEST
(
ID NUMBER,
NAME VARCHAR2(100 BYTE),
PID NUMBER &nbs ......