Oracle RAC 全局等待事件 gc current block busy 和 gc cr multi block request 说明--转载(http://blog.csdn.net/tianlesoftware/article/details/7777511)

一.RAC 全局等待事件说明

在RAC环境中,和全局调整缓存相关的最常见的等待事件是global cache cr request,global cache busy和equeue。

当一个进程访问需要一个或者多个块时,Oracle会首先检查自己的Cache是否存在该块,如果发现没有,就会先通过global cache赋予这些块共享访问的权限,然后再访问。假如,通过global cache发现这些块已经在另一个实例的Cache里面,那么这些块就会通过Cache Fusion,在节点之间直接传递,同时出现global cache crrequest等待事件。

关于Cache Fusion的更多内容参考:

Oracle RACCache Fusion 机制 详解

http://blog.csdn.net/tianlesoftware/article/details/6534239

在10GB中,global cachecr request已经简称为gc crrequest。

从remote cache运输块到本地cache花费的时间还得看这些块是共享还是独占模式,如果块是共享(scur)的,Remote Cache就克隆信息传送过来,否则就要产生一个PI,然后再传送过去。显然,global cache cr request等待事件和db file sequential/scatteredread 等待事件有着直接的关系。

Oracle RACPast Image(PI) 说明

http://blog.csdn.net/tianlesoftware/article/details/6529870

通常,RAC中的进程会等待1s去尝试从本地或者远程Cache读取数据块信息,当然,这还得依靠块处于什么样的模式。如果超过了1s,那就表明节点之间连接慢,这个时候节点之间就使用private连接,而客户端的连接使用public,有时候,节点之间的连接, Cache Fusion就不会通过公共网络,在这种情况下,就会有大量的global cachecr request等待事件出现,可以使用oradebugipc命令去验证下节点之间的连接是否使用了private network。

在下图中,上面的gc [current/cr] [multiblock] request实际上就是placeholder的event,图的左上角也做了说明。

gc [current/cr][multiblock] request实际上是表示了4个事件中的一个(gccurrent request、gc cr request、gc current multiblock request、gc cr multiblock request)。

这里CR和current 是不同的概念,如果是读的话,那就是cr request,如果是更改的话,那就是current request。

CR (consistent read) blocks create 说明

http://blog.csdn.net/tianlesoftware/article/details/6529401

Oracle 10g在很多地方区分了multi block request还是single block request,这样容易分析业务的数据特点。当在RAC环境下,一个session请求一个block的时候,就会触发这个事件。

当请求一个block时,如果经过两个或者3个network hop就获得了该块的话,那就会产生gc [current/cr][2/3]-way。如果是3-way,那应该master和holder不是同一个instance,如果是2-way,那就应该master和holder是同一个instance。这应该是最好的情况,请求后,就获得了请求的block即没有busy,也没有说在请求的过程中等待。该类事件应该暗示是进行了block的网络传递,会产生流量,而grant 2-way的网络流量应该相对小。

gc [current/cr]block busy是说虽然也返回了,但是没有immediatesend,也就是控制流程返回了,但是实际的block并没有马上传递到requesterinstance,gc[current/cr] block busy是和gc [current/cr] [2/3]-way对应的。

gc [current/cr]grant 2-way当请求一个block时,接收了一个message,该message应该是赋予了requester instance可以访问这个block。如果这个block没有在local cache中,则随后的动作就是去磁盘上读该block。(插一点别的,Oracle的对数据的访问的控制,是在row级别和object级别,但是实际操作的对象却是block,传递的对象也是block,对于一个block来说,会有一个master instance,也就是这个block的管理者,然后还有零到多个参与者,比如有的instance为了读一致性,可能会在自己的local cache中存着该block的过去某个时间的image,有的instace为了修改该block,可能会在自己的local cache中存着该block的past image)。

gc current grantbusy当一个instance请求一个block时,被告诉是busy的。不明白在什么情况下会产生grant busy的事件。

gc [current/cr][block/grant] congested对这几个事件的理解是无论对于current还是cr类型的block或者grant,都获得了事件,但是在过程中有拥堵。也就是在内部的队列中等待超过1 ns(纳秒)。

gc [current/cr][failure/retry]这就是发生错误了,没有请求到block.

gc buffer busy是多个进程在同时访问一个block,造成锁竞争了。用RAC就一定要将各个节点隔离化,不管是通过业务隔离,区域隔离还是什么其他隔离手段,最终的目的,就是要各个节点所承担的业务,访问不同的数据对象,最大可能地减少节点间的资源争用,才能发挥RAC集群系统的最大性能。

当会话从开始提交一致读的请求,到它获取请求信息,这个过程它是SLEEP状态的,对用户而言,看到的就是global cache cr request等待事件,而wait time就是记录这个过程的时间。

通常,大量的global cache cr request主要有以下几个原因。

(1)节点之间内部连接慢或者节点之间传输带宽窄。这个可以通过重新连接获取高速连接。

(2)存在热点数据块的竞争。

(3)CPU负载过高或者LMS后台进程不够。正常情况下,只有两个LMS后台进程从CPU那里获取资源,增加LMS进程的数量或者提高它的优先权能够帮助从CPU那里获取更多的资源。隐藏参数_lm_lms是设置LMS进程数量的。

(4)大量未提交的事务或者系统磁盘设备传输慢。

有关global cache的信息:

SQL> select name,value from v$sysstat where name like ‘%global cache%‘;

NAME VALUE

------------------------------------------------------

global cache gets 1791587

global cache get time 85911

global cache converts 179612

global cache convert time 1262

global cache cr blocks received 17189

global cache cr block receive time 31547

global cache current blocks received 4627

global cache current block receive time 763

global cache cr blocks served 16805

global cache cr block build time 72

global cache cr block flush time 25043

global cache cr block send time 54

global cache current blocks served 3529

global cache current block pin time 21

global cache current block flush time 0

global cache current block send time 15

global cache freelist waits 285

global cache defers 2

global cache convert timeouts 0

global cache blocks lost 0

global cache claim blocks lost 0

global cache blocks corrupt 0

global cache prepare failures 8

global cache skip prepare failures 3408

24 rows selected.

注:

该部分内容引自http://book.51cto.com/art/201202/320497.htm

二.gc current/crblock busy等待事件

2.1 gc current block busy 等待事件

When a requestneeds a block in current mode, it sends arequest to the master instance. The requestor evenutally gets the blockvia cache fusion transfer. However sometimes the block transfer  isdelayed due to either the block was being used by a session on another instanceor the block transfer was delayed because the holding instance could not writethe corresponding redo records to the online logfile immediately.

--当请求的block是current模式,会发送一个请求到master 实例,最终请求者通过cache fusion获取到这个block。但是有时block在transfer过程中会有延时,比如这个block正在被其他的block使用,或者持有block的实例不能及时的将redo records写入online logfile。

One can use thesession level dynamic performance views v$session and v$session_event to findthe programs or sesions causing the most waits on this events

SQL>selecta.sid , a.time_waited , b.program , b.module from v$session_event a , v$sessionb where a.sid=b.sid and a.event=‘gc current block busy‘ order by a.time_waited;

2.2 gc cr block busy 等待事件

When a requestneeds a block in CR mode, it sends arequest to the master instance. The requestor evenutally gets the block viacache fusion transfer. However sometimes the block transfer is delayed due toeither the block was being used by a session on another instance or the blocktransfer was delayed because the holding instance could not write thecorresponding redo records to the online logfile immediately.

One can use thesession level dynamic performance views v$session and v$session_event to find theprograms or sesions causing the most waits on this events

SQL>selecta.sid , a.time_waited , b.program , b.module from v$session_event  a ,v$session b where a.sid=b.sid and a.event=‘gc cr block busy‘ order bya.time_waited;

2.3 相关说明

gc current blockbusy 等待是RAC中global cache全局缓存当前块的争用等待事件, 该等待事件时长由三个部分组成:

Time to process current block request inthe cache= (pin time + flush time + send time)

gc current block flush time

The currentblock flush time is part of the service (or processing) time for a currentblock. The pending redo needs to be flushed to the log file by LGWR before LMSsends it. The operation is asynchronous in that LMS queues the request, postsLGWR, and continues processing. The LMS would check its log flush queue forcompletions and then send the block, or go to sleep and be posted by LGWR. Theredo log write time and redo log sync time can influence theoverall service time significantly.

flush time 是Oracle为了保证Instance Recovery实例恢复机制,而要求每一个current block在本地节点local instance被修改后(modify/update) 必须要将该current block相关的redo 写入到logfile 后(要求LGWR必须完成写入后才能返回),才能由LMS进程传输给其他节点使用。

而gc buffer busy acquire/release 往往是 gc current block busy的衍生产品, 当同一实例内的多个进程并发地访问同一个数据块时 ,首先发起的进程 将进入 gc current block busy的等待 ,而在 buffer waiter list 上的后续进程 会陷入gc buffer busy acquire/release 等待(A user on the same instance has started a remote operation on thesame resource and the request has not completed yet or the block was requestedby another node and the block has not been released by the local instance whenthe new local access was made), 这里存在一个排队效应, 即 gc current block busy是缓慢的,那么在 排队的gc buffer busy acquire/release就会更慢:

Pin time = (timeto read the block into cache) + (time to modify/process the buffer)

Busy time =(average pin time) * (number of interested users waiting ahead of me)

不局限于current block (reference AWR Avg global cache current block flush time(ms)),  cr block(Avg global cache cr block flush time (ms)) 也存在flush time。

可以通过设置_cr_server_log_flush to false(LMSare/is waiting for LGWR to flush the pending redo during CR fabrication.Without going too much in to details, you can turn off the behaviourby setting   _cr_server_log_flush to false.) 来禁止crserver flush redo log,但是该参数对于current block的flush time无效, 也强烈不推荐使用。

该部分引自ML的论坛:

Oracle gc current block busy 等待事件 说明

http://t.askmaclean.com/viewthread.php?tid=438&highlight=

三.gc cr multi blockrequest等待事件

gc cr multiblock request实际就是globalcache cr multi block request,10G以后global cache被简称为gc,在RAC应用系统里面,这是一个常见的等待事件。

multi block一般情况下都是全表扫描或全索引扫描导致, gc cr multiblock request 会造成CPU 对内存的调度和管理,会消耗CPU 时间。

gc cr multiblock request 问题应在rac 层面上进行应用分离,即不同节点处理不同应用,节点之间通过配置,做为彼此的备用节点,在节点宕机时可以结果相关应用,提供高可用性。

Oracle RAC 全局等待事件 gc current block busy 和 gc cr multi block request 说明--转载(http://blog.csdn.net/tianlesoftware/article/details/7777511)

时间: 2024-08-27 23:43:39

Oracle RAC 全局等待事件 gc current block busy 和 gc cr multi block request 说明--转载(http://blog.csdn.net/tianlesoftware/article/details/7777511)的相关文章

解析Javascript事件冒泡机制(转) 本文转自:http://blog.csdn.net/luanlouis/article/details/23927347

本文转自:http://blog.csdn.net/luanlouis/article/details/23927347 1. 事件 在浏览器客户端应用平台,基本生都是以事件驱动的,即某个事件发生,然后做出相应的动作. 浏览器的事件表示的是某些事情发生的信号.事件的阐述不是本文的重点,尚未了解的朋友,可以访问W3school教程 进行了解,这将有助于更好地理解以下的内容 . 2. 冒泡机制 什么是冒泡呢? 下面这个图片大家应该心领神会吧,气泡从水底开始往上升,由深到浅,升到最上面.在上升的过程中

oracle聚簇表的理解 (转自:https://blog.csdn.net/gumengkai/article/details/51009345 )

Oracle支持两种类型的聚簇:索引聚簇和哈希聚簇 一.索引聚簇表的原理 聚簇:如果一些表有一些共同的列,则将这样一组表存储在相同的数据块中 聚簇还表示把相关的数据存储在同一个块上.利用聚簇,一个块可能包含多个表的数据. 概念上就是说如果两个表或多个表经常做连接操作,就可以预先把需要的数据也存储在一起. 聚簇还可以用于单个表,可以按某个列将数据分组存储. 简单的说,簇就是一组表,由一组共享相同数据块的多个表组成,将经常一起使用的表组合在一起成簇 就可以提高处理效率. 二.使用方法 建立的顺序:簇

oracle rownum ( 原:http://blog.csdn.net/lg312200538/article/details/4587455)

Oracle中rownum用法总结 2009-09-24 10:29 5068人阅读 评论(0) 收藏 举报 oracle数据库csql 对于Oracle的rownum问题,很多资料都说不支持>,>=,=,between……and,只能用以上符号(<.<=.!=),并非说用>,>=,=,between……and 时会提示SQL语法错误,而是经常是查不出一条记录来,还会出现似乎是莫名其妙的结果来,其实您只要理解好了这个rownum伪列的意义就不应该感到惊奇,同样是伪列,r

Oracle RAC LoadBalance

LoadBalance 就是把负载平均的分配到集群中的各个节点,从而提高整体的吞吐能力. Oracle 10g RAC 提供了两种不同的方法来分散负载: 1. 通过Connection Balancing,按照某种算法把用户分配到不同的节点.也可认为是纯技术的分散负载. 2. 通过Service,在应用层上进行分散,也可认为是面象业务的分散负载. 一.Connection Balancing Connection Balancing 这种负载均衡是在用户连接这个层次进行的,也就是在用户请求建立连

Oracle RAC + Data Guard 环境搭建

国庆之前就准备做这个实验了. 后来时间不够,就没搞了. 6天的长假一放,都散漫的不成样子了.懒散了很多. 今天7号. 上班也没啥精神,但是该做的实验还得继续. Oracle 高可用性的三个主要体现是: RAC, Data Guard 和 Stream.  所以熟练掌握这些技术就是评价DBA的标准一个. RAC + Data Guard 主要用在灾备或者报表服务器上. 比如用RAC+ 逻辑standby 做报表,从而减轻RAC 系统的压力. 关于Data Guard 的一些原理知识可以参考: Or

Oracle RAC 归档 与 非归档 切换

Oracle 的生产库都是启动在归档模式下,RAC下归档非归档的切换和单实例也是一样的,都是在MOUNT模式下执行ALTER DATABASE ARCHIVELOG/NOARCHIVELOG;命令. 不同的是:RAC环境下所有实例都必须处于非OPEN状态,然后在任意一个处于MOUNT状态的实例执行ALTER DATABASE命令,操作成功后,再正常启动其它实例即可. 注意:RAC数据库由于拥有多个实例,要注意每个实例相关初始化参数:LOG_ARCHIVE_DEST_n的设置,务必需要确保该参数设

Oracle RAC Failover 详解

Oracle  RAC 同时具备HA(High Availiablity) 和LB(LoadBalance). 而其高可用性的基础就是Failover(故障转移). 它指集群中任何一个节点的故障都不会影响用户的使用,连接到故障节点的用户会被自动转移到健康节点,从用户感受而言, 是感觉不到这种切换. Oracle 10g RAC 的Failover 可以分为3种: 1. Client-Side Connect time Failover 2. TAF 3. Service-Side TAF 注意事

ORACLE RAC 11G 更改 /etc/hosts文件

来自官方文档:(1)Can I change the public hostname in my Oracle Database 10g Cluster using Oracle Clusterware? Hostname changes are not supported in Oracle Clusterware (CRS), unless you want to perform a deletenode followed by a new addnode operation. The ho

Oracle Study之-- enq:SQ contention等待事件

Oracle Study之-- enq:SQ contention等待事件 通过AWR Report发现"enq:SQ contention"等待事件: 应用环境: 转自:http://www.xuebuyuan.com/1027129.html enq:SQ contention/row cache lock/DFS lock handle(SV) 这三个等待事件都与Oracle 的Sequence 有关. Oracle Sequence Cache 参数说明 http://blog