Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

351

积分

0

好友

8

主题
1#
发表于 2012-4-20 23:30:00 | 查看: 6535| 回复: 4
DLM也叫分布式锁管理器,作用是协调实例间对资源的竞争访问,那么dlm对应的是哪个后台进程呢?LMS or LMD or Others?
2#
发表于 2012-4-21 08:35:56
Distributed Lock Manager (DLM)
The DLM is an integral part of OPS and the RAC stack. As mentioned, earlier Oracle versions relied on OS vendors to provide this component, which coordinated resources globally and kept the system in sync. Data consistency and integrity are maintained by this layer in all versions of Oracle OPS from 7 to 10g. Any reference to DLM from Oracle 8/8i onward pertains to the Integrated DLM (IDLM), which was introduced with Oracle 8 and integrated into the Oracle OPS kernel. The terms DLM and IDLM are used to describe a single entity and are one and the same.
In versions prior to version 8, the DLM API module had to rely on external OS routines to check the status of a lock (since DLM functions were provided by the OS vendor). This communication was done using UNIX sockets and pipes. With IDLM, the required data is in the SGA of each instance and requires only a serialized lookup using latches and/or enqueues (see the next section) and may require global coordination, the algorithm for which was built into Oracle kernel code.
With OPS 8i, the IDLM has undergone significant development and stabilization. IDLM holds an inventory of all the locks and global enqueues that are held by all the instances in the OPS database. Its job is to track every lock granted to a resource. The coordination of requests from various instances for lock acquisition and release is done by the DLM. The memory structures required by DLM to operate are allocated out of the shared pool. The lock resources, messages buffers, and so on are all in the shared pool of each instance. DLM is designed such that it can survive node failures in all but one node of the cluster.
The DLM is always aware of the current holders or requestors of locks and the grantee. In case locks are not available, the DLM queues the lock requests and informs the requestor when a lock resource becomes available. Some of the resources that the DLM manages are data blocks and rollback segments. Oracle resources are associated with the DLM locks by instance, using a complex hashing algorithm. The lock and enqueue functionality in OPS is the same as in a single instance RDBMS server, except that OPS takes a global view.
DLM relies on the core RDBMS kernel for locking and enqueues services. These established and already proven techniques and




oracle 8/8i之前 DLM 依赖于 OS vendor, 版本8之后才被加入到 oracle kennel中


This is the Lock Manager Daemon. Prior to Oracle8 when DLM was external to Oracle this process was part of the DLM and did not start as Oracle background process.

This process performs most of the lock management functions and is the master of the DLM.

在 8之前  LMD  Lock Manager Daemon是 DLM的一部分。

In Oracle 8i, the DLM is implemented by two background processes, Lock Manager Daemon (LMD) and Lock Monitor (LMON) (see Figure 2-5). Each instance has its own set of these two processes. The DLM database stores information on resources, locks, and processes. In Oracle 9i, the DLM has been renamed Global Cache Services (GCS) and Global Enqueue Services (GES). While some of the code has changed, the basic functionality of GES and GCS remain the same as the prior versions of DLM.

8i 开始 DLM  通过2个后台进程实现  即 LMD和 LMON

从9i开始 DLM 被更名为   Global Cache Services (GCS) 和Global Enqueue Services (GES).

oracle_ops_dlm_lmd.png

回复 只看该作者 道具 举报

3#
发表于 2012-4-21 10:23:59
1. Lock Monitor Processes ( LMON)
It Maintains GCS memory structures.
Handles the abnormal termination of processes and instances.
Reconfiguration of locks & resources when an instance joins or leaves the cluster are handled by LMON ( During reconfiguration LMON generate the trace files)
It responsible for executing dynamic lock remastering every 10 mins ( Only in 10g R2 & later versions).
LMON Processes manages the global locks & resources.
It monitors all instances in cluster, primary for dictionary cache locks,library cache locks & deadlocks on deadlock sensitive on enqueue & resources.
LMON also provides cluster group services.
Also called Global enqueue service monitor.

2. Lock Monitor Services (LMS)
LMS is most very active background processes.
Consuming significant amount of CPU time. ( 10g R2 - ensure that LMS process does not encounter the CPU starvation).
Its primary job is to transport blocks across the nodes for cache-fusion requests.
If there is a consistent-read request, the LMS process rolls back the block, makes a Consistent-Read image of the block and then ship this block across the HSI (High Speed Interconnect) to the process requesting from a remote node.
LMS must also check constantly with the LMD background process (or our GES process) to get the lock requests placed by the LMD process.
Each node have 2 or more LMS processes.

GCS_SERVER_PROCESSES --> no of LMS processes specified in init. ora parameter.
Above parameter value set based on number of cpu's ( MIN(CPU_COUNT/2,2))
10gR2, single CPU instance,only one LMS processes started.
Increasing the parameter value,if global cache activity is very high.
Also called the GCS (Global Cache Services) processes.

Internal View: X$KJMSDP

3. Lock Monitor Daemon Process ( LMDn)
LMD process performs global lock deadlock detection.
Also monitors for lock conversion timeouts.
Also sometimes referred to as the GES (Global Enqueue Service) daemon since its job is to manage the global enqueue and global resource access.
LMD process also handles deadlock detection and remote enqueue requests.
Remote resource requests are the requests originating from another instance.
Internal View: X$KJMDDP

4. LCKn ( Lock Process)
Manages instance resource requests & cross instance calls for shared resources.
During instance recovery,it builds a list of invalid lock elements and validates lock elements.

我看了LMS,LMD,LMON和LCK的描述,感觉这四个都是负责管理锁的,它们有什么关系啊?这四个进程管理的锁有什么不同吗?

回复 只看该作者 道具 举报

4#
发表于 2012-4-21 21:43:08
LMS

The Global Cache Service Processes (LMSn) are the processes that handle remote Global Cache Service (GCS) messages.

RAC 后台进程是 lms  是9i 之后才出现的

9i 之前 RAC 称为 ops ,其分布式锁管理器称为 DLM ,最早 DLM  是通过vendor software实现的, 后来被加入到oracle kernel内核中, 主要由 LMD、LMON2个进程实现。

9i 以后 ops 被更名为 rac, 因为oracle 认为rac真真意义上实现了cache fusion , 同时DLM 被  升级为 GES 和 GCS 2部分。

所以如果我们谈及 DLM 那么 主要是由 LMD和LMON 2个进程实现的。  不要把 DLM 和 现在的 GES、GCS混淆。

回复 只看该作者 道具 举报

5#
发表于 2012-4-21 21:48:17
8i ops 的相关进程:

Four Parallel Server-specific processes facilitate resource sharing. The first three processes work with the Distributed Lock Manager component to manage global locks and resources:

LMON - The "Lock Monitor Process" monitors the entire cluster to manage global locks and resources. LMON manages instance and process deaths and the associated recovery for the Distributed Lock Manager. In particular, LMON handles the part of recovery associated with global locks.
LMD - The "Lock Manager Daemon" is the lock agent process that manages lock manager service requests for Parallel Cache Management locks to control access to global locks and resources. The LMDN process also handles deadlock detection and remote lock requests. Remote lock requests are requests originating from another instance.
LCK - The "Lock Process" manages non-Parallel Cache Management locking to coordinate shared resources and remote requests for those resources.
BSP - The "Block Server Process" rolls back uncommitted transactions for blocks requested by cross-instance read/write requests and sends the consistent read block to the requestor.



http://docs.oracle.com/cd/A87860 ... 8/pscompon.htm#1798

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-25 01:18 , Processed in 0.051284 second(s), 24 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569