<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/AliDBA" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/AliDBA" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 06 Oct 2008 09:40:45 GMT</lastBuildDate><title>Alibaba DBA Team</title><description>这里记录着阿里巴巴数据库团队成员的点点滴滴</description><link>http://www.alidba.net</link><language>en</language><pubDate>Mon, 06 Oct 2008 09:44:50 GMT</pubDate><item><title>Silverlight技术</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/121108774/5028879/1/item.html</link><content:encoded>&lt;p&gt;Silverlight是一种全新的web展示方式。&lt;/p&gt;
&lt;p&gt;最早的网络，是以静态页面为主，后来有了动态（如ASP,ASP.NET,JAVA,PHP等）。在后期，在动态上做了扩展，就是有了ajax。ajax最大的好处，就是页面无刷新，用户体会不到每个post和fresh。ajax的后台其实是一堆js脚本实现的。&lt;/p&gt;
&lt;p&gt;但是想想，现在的网络技术，还是不能做出类似flash那种东西。因此有了Silverlight，它的好处在于程序员能够轻松的写出各种各样的花哨界面。感觉在未来会比较流行。目前Silverlight在国内，应用不多，但是已经有很多国外的demo网站了。&lt;/p&gt;
&lt;p&gt;我觉得比较适合51，开心网之类的交友网站。因为他们要“炫”为主！&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/117/feed</wfw:commentRss><description>Silverlight是一种全新的web展示方式。
最早的网络，是以静态页面为主，后来有了动态（如ASP,ASP.NET,JAVA,PHP等）。在后期，在动态上做了扩展，就是有了ajax。ajax最大的好处，就是页面无刷新，用户体会不到每个post和fresh。ajax的后台其实是一堆js脚本实现的。
但是想想，现在的网络技术，还是不能做出类似flash那种东西。因此有了Silverlight，它的好处在于程序员能够轻松的写出各种各样的花哨界面。感觉在未来会比较流行。目前Silverlight在国内，应用不多，但是已经有很多国外的demo网站了。
我觉得比较适合51，开心网之类的交友网站。因为他们要“炫”为主！</description><category>大话技术</category><pubDate>Mon, 06 Oct 2008 17:40:45 +0800</pubDate><author>vogts</author><comments>http://www.alidba.net/index.php/archives/117#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=117</guid><dc:creator>vogts</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/117</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/121108774/5028879</fs:itemid></item><item><title>MySQL Replication(复制)基本原理</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831245/5028879/1/item.html</link><content:encoded>&lt;p&gt;1、复制进程&lt;br /&gt;
Mysql的复制（replication）是一个异步的复制，从一个Mysql instace（称之为Master）复制到另一个Mysql instance（称之Slave）。实现整个复制操作主要由三个进程完成的，其中两个进程在Slave（Sql进程和IO进程），另外一个进程在 Master（IO进程）上。&lt;/p&gt;
&lt;p&gt;要实施复制，首先必须打开Master端的binary log（bin-log）功能，否则无法实现。因为整个复制过程实际上就是Slave从Master端获取该日志然后再在自己身上完全顺序的执行日志中所记录的各种操作。&lt;br /&gt;
复制的基本过程如下：&lt;br /&gt;
1)、Slave上面的IO进程连接上Master，并请求从指定日志文件的指定位置（或者从最开始的日志）之后的日志内容；&lt;br /&gt;
2)、Master接收到来自Slave的IO进程的请求后，通过负责复制的IO进程根据请求信息读取制定日志指定位置之后的日志信息，返回给Slave 的IO进程。返回信息中除了日志所包含的信息之外，还包括本次返回的信息已经到Master端的bin-log文件的名称以及bin-log的位置；&lt;br /&gt;
3)、Slave的IO进程接收到信息后，将接收到的日志内容依次添加到Slave端的relay-log文件的最末端，并将读取到的Master端的 bin-log的文件名和位置记录到master-info文件中，以便在下一次读取的时候能够清楚的高速Master“我需要从某个bin-log的哪 个位置开始往后的日志内容，请发给我”；&lt;br /&gt;
4)、Slave的Sql进程检测到relay-log中新增加了内容后，会马上解析relay-log的内容成为在Master端真实执行时候的那些可执行的内容，并在自身执行。&lt;/p&gt;
&lt;p&gt;实际上在老版本的Mysql的复制实现在Slave端并不是两个进程完成的，而是由一个进程完成。但是后来发现这样做存在较大的风险和性能问题，主要如下：&lt;br /&gt;
首先，一个进程就使复制bin-log日志和解析日志并在自身执行的过程成为一个串行的过程，性能受到了一定的限制，异步复制的延迟也会比较长。&lt;br /&gt;
另外，Slave端从Master端获取bin-log过来之后，需要接着解析日志内容，然后在自身执行。在这个过程中，Master端可能又产生了大量 变化并声称了大量的日志。如果在这个阶段Master端的存储出现了无法修复的错误，那么在这个阶段所产生的所有变更都将永远无法找回。如果在Slave 端的压力比较大的时候，这个过程的时间可能会比较长。&lt;br /&gt;
所以，后面版本的Mysql为了解决这个风险并提高复制的性能，将Slave端的复制改为两个进程来完成。提出这个改进方案的人是Yahoo!的一位工程 师“Jeremy Zawodny”。这样既解决了性能问题，又缩短了异步的延时时间，同时也减少了可能存在的数据丢失量。当然，即使是换成了现在这样两个线程处理以后，同 样也还是存在slave数据延时以及数据丢失的可能性的，毕竟这个复制是异步的。只要数据的更改不是在一个事物中，这些问题都是会存在的。如果要完全避免 这些问题，就只能用mysql的cluster来解决了。不过mysql的cluster是内存数据库的解决方案，需要将所有数据都load到内存中，这 样就对内存的要求就非常大了，对于一般的应用来说可实施性不是太大。&lt;/p&gt;
&lt;p&gt;2、复制实现级别&lt;br /&gt;
Mysql的复制可以是基于一条语句（Statement level），也可以是基于一条记录（Row level），可以在Mysql的配置参数中设定这个复制级别，不同复制级别的设置会影响到Master端的bin-log记录成不同的形式。&lt;br /&gt;
Row Level：日志中会记录成每一行数据被修改的形式，然后在slave端再对相同的数据进行修改。&lt;br /&gt;
优点：在row level模式下，bin-log中可以不记录执行的sql语句的上下文相关的信息，仅仅只需要记录那一条记录被修改了，修改成什么样了。所以row level的日志内容会非常清楚的记录下每一行数据修改的细节，非常容易理解。而且不会出现某些特定情况下的存储过程，或function，以及 trigger的调用和触发无法被正确复制的问题。&lt;br /&gt;
缺点：row level下，所有的执行的语句当记录到日志中的时候，都将以每行记录的修改来记录，这样可能会产生大量的日志内容，比如有这样一条update语 句：update product set owner_member_id = &amp;#8216;b&amp;#8217; where owner_member_id = &amp;#8216;a&amp;#8217;，执行之后，日志中记录的不是这条update语句所对应额事件（mysql以事件的形式来记录bin-log日志），而是这条语句所更新的每一条 记录的变化情况，这样就记录成很多条记录被更新的很多个事件。自然，bin-log日志的量就会很大。尤其是当执行alter table之类的语句的时候，产生的日志量是惊人的。因为Mysql对于alter table之类的表结构变更语句的处理方式是整个表的每一条记录都需要变动，实际上就是重建了整个表。那么该表的每一条记录都会被记录到日志中。&lt;br /&gt;
Statement Level:每一条会修改数据的sql都会记录到 master的bin-log中。slave在复制的时候sql进程会解析成和原来master端执行过的相同的sql来再次执行。&lt;br /&gt;
优点：statement level下的优点首先就是解决了row level下的缺点，不需要记录每一行数据的变化，减少bin-log日志量，节约IO，提高性能。因为他只需要记录在Master上所执行的语句的细节，以及执行语句时候的上下文的信息。&lt;br /&gt;
缺点：由于他是记录的执行语句，所以，为了让这些语句在slave端也能正确执行，那么他还必须记录每条语句在执行的时候的一些相关信息，也就是上下文信 息，以保证所有语句在slave端杯执行的时候能够得到和在master端执行时候相同的结果。另外就是，由于Mysql现在发展比较快，很多的新功能不 断的加入，使mysql得复制遇到了不小的挑战，自然复制的时候涉及到越复杂的内容，bug也就越容易出现。在statement level下，目前已经发现的就有不少情况会造成mysql的复制出现问题，主要是修改数据的时候使用了某些特定的函数或者功能的时候会出现，比 如：sleep()函数在有些版本中就不能真确复制，在存储过程中使用了last_insert_id()函数，可能会使slave和master上得到 不一致的id等等。由于row level是基于每一行来记录的变化，所以不会出现类似的问题。&lt;br /&gt;
从官方文档中看到，之前的Mysql一直都只有基于statement的复制模式，直到5.1.5版本的Mysql才开始支持row level的复制。从5.0开始，Mysql的复制已经解决了大量老版本中出现的无法正确复制的问题。但是由于存储过程的出现，给Mysql的复制又带来 了更大的新挑战。另外，看到官方文档说，从5.1.8版本开始，Mysql提供了除Statement Level和Row Level之外的第三种复制模式：Mixed，实际上就是前两种模式的结合。在Mixed模式下，Mysql会根据执行的每一条具体的sql语句来区分对 待记录的日志形式，也就是在Statement和Row之间选择一种。新版本中的Statment level还是和以前一样，仅仅记录执行的语句。而新版本的Mysql中队row level模式也被做了优化，并不是所有的修改都会以row level来记录，像遇到表结构变更的时候就会以statement模式来记录，如果sql语句确实就是update或者delete等修改数据的语句， 那么还是会记录所有行的变更。&lt;/p&gt;
&lt;p&gt;3、复制常用架构&lt;br /&gt;
Mysql复制环境90%以上都是一个Master带一个或者多个Slave的架构模式，主要用于读压力比较大的应用的数据库端廉价扩展解决方案。因为只 要master和slave的压力不是太大（尤其是slave端压力）的话，异步复制的延时一般都很少很少。尤其是自slave端的复制方式改成两个进程 处理之后，更是减小了slave端的延时。而带来的效益是，对于数据实时性要求不是特别的敏感度的应用，只需要通过廉价的pc server来扩展slave的数量，将读压力分散到多台slave的机器上面，即可解决数据库端的读压力瓶颈。这在很大程度上解决了目前很多中小型网站 的数据库压力瓶颈问题，甚至有些大型网站也在使用类似方案解决数据库瓶颈。&lt;br /&gt;
一个Master带多个slave的架构实施非常简单，多个slave和单个slave的实施并没有太大区别。在Master端并不care有多少个 slave连上了master端，只要有slave进程通过了连接认证，向他请求binlog信息，他就会按照连接上来的io进程的要求，读取自己的 binlog信息，返回给slave的IO进程。对于slave的配置细节，在Mysql的官方文档上面已经说的很清楚了，甚至介绍了多种实现slave 的配置方法。&lt;/p&gt;
&lt;p&gt;Mysql不支持一个Slave instance从属于多个Master的架构。就是说，一个slave instance只能接受一个master的同步源，听说有patch可以改进这样的功能，但没有实践过。Mysql AB之所以不实现这样的功能，主要是考虑到冲突解决的问题。&lt;/p&gt;
&lt;p&gt;Mysql也可以搭建成dual master模式，也就是说两个Mysql instance互为对方的Master，也同时为对方的Slave。不过一般这种架构也是只有一端提供服务，避免冲突问题。因为即使在两边执行的修改有 先后顺序，由于复制的异步实现机制，同样会导致即使在晚做的修改也可能会被早做的修改所覆盖，就像如下情形：&lt;br /&gt;
时间点   Mysql A                        Mysql B&lt;br /&gt;
1    更新x表y记录为10&lt;br /&gt;
2                                 更新x表y记录为20&lt;br /&gt;
3                                 获取到A日志并应用，更新x表的y记录为10（不符合期望）&lt;br /&gt;
4    获取B日志更新x表y记录为20（符合期望）&lt;br /&gt;
这样，不仅在B库上面的数据不是用户所期望的结果，A和B两边的数据也出现了不一致的情况。除非能将写操作根据某种条件固定分开在A和B两端，保证不会交叉写入，才能够避免上面的问题。&lt;/p&gt;
&lt;p&gt;原文首发： &lt;a href=&quot;http://www.jianzhaoyang.com/&quot;&gt;Sky.Jian 朝阳的天空&lt;/a&gt;&lt;br /&gt;
原文链接：&lt;a href=&quot;http://www.jianzhaoyang.com/2008/09/214&quot;&gt;MySQL Replication(复制)基本原理&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/116/feed</wfw:commentRss><description>1、复制进程
Mysql的复制（replication）是一个异步的复制，从一个Mysql instace（称之为Master）复制到另一个Mysql instance（称之Slave）。实现整个复制操作主要由三个进程完成的，其中两个进程在Slave（Sql进程和IO进程），另外一个进程在 Master（IO进程）上。
要实施复制，首先必须打开Master端的binary log（bin-log）功能，否则无法实现。因为整个复制过程实际上就是Slave从Master端获取该日志然后再在自己身上完全顺序的执行日志中所记录的各种操作。
复制的基本过程如下：
1)、Slave上面的IO进程连接上Master，并请求从指定日志文件的指定位置（或者从最开始的日志）之后的日志内容；
2)、Master接收到来自Slave的IO进程的请求后，通过负责复制的IO进程根据请求信息读取制定日志指定位置之后的日志信息，返回给Slave 的IO进程。返回信息中除了日志所包含的信息之外，还包括本次返回的信息已经到Master端的bin-log文件的名称以及bin-log的位置；
3)、Slave的IO进程接收到信息后，将接收到的日志内容依次添加到Slave端的relay-log文件的最末端，并将读取到的Master端的 bin-log的文件名和位置记录到master-info文件中，以便在下一次读取的时候能够清楚的高速Master“我需要从某个bin-log的哪 个位置开始往后的日志内容，请发给我”；
4)、Slave的Sql进程检测到relay-log中新增加了内容后，会马上解析relay-log的内容成为在Master端真实执行时候的那些可执行的内容，并在自身执行。
实际上在老版本的Mysql的复制实现在Slave端并不是两个进程完成的，而是由一个进程完成。但是后来发现这样做存在较大的风险和性能问题，主要如下：
首先，一个进程就使复制bin-log日志和解析日志并在自身执行的过程成为一个串行的过程，性能受到了一定的限制，异步复制的延迟也会比较长。
另外，Slave端从Master端获取bin-log过来之后，需要接着解析日志内容，然后在自身执行。在这个过程中，Master端可能又产生了大量 变化并声称了大量的日志。如果在这个阶段Master端的存储出现了无法修复的错误，那么在这个阶段所产生的所有变更都将永远无法找回。如果在Slave 端的压力比较大的时候，这个过程的时间可能会比较长。
所以，后面版本的Mysql为了解决这个风险并提高复制的性能，将Slave端的复制改为两个进程来完成。提出这个改进方案的人是Yahoo!的一位工程 师“Jeremy Zawodny”。这样既解决了性能问题，又缩短了异步的延时时间，同时也减少了可能存在的数据丢失量。当然，即使是换成了现在这样两个线程处理以后，同 样也还是存在slave数据延时以及数据丢失的可能性的，毕竟这个复制是异步的。只要数据的更改不是在一个事物中，这些问题都是会存在的。如果要完全避免 这些问题，就只能用mysql的cluster来解决了。不过mysql的cluster是内存数据库的解决方案，需要将所有数据都load到内存中，这 样就对内存的要求就非常大了，对于一般的应用来说可实施性不是太大。
2、复制实现级别
Mysql的复制可以是基于一条语句（Statement level），也可以是基于一条记录（Row level），可以在Mysql的配置参数中设定这个复制级别，不同复制级别的设置会影响到Master端的bin-log记录成不同的形式。
Row Level：日志中会记录成每一行数据被修改的形式，然后在slave端再对相同的数据进行修改。
优点：在row level模式下，bin-log中可以不记录执行的sql语句的上下文相关的信息，仅仅只需要记录那一条记录被修改了，修改成什么样了。所以row level的日志内容会非常清楚的记录下每一行数据修改的细节，非常容易理解。而且不会出现某些特定情况下的存储过程，或function，以及 trigger的调用和触发无法被正确复制的问题。
缺点：row level下，所有的执行的语句当记录到日志中的时候，都将以每行记录的修改来记录，这样可能会产生大量的日志内容，比如有这样一条update语 句：update product set owner_member_id = &amp;#8216;b&amp;#8217; where owner_member_id = &amp;#8216;a&amp;#8217;，执行之后，日志中记录的不是这条update语句所对应额事件（mysql以事件的形式来记录bin-log日志），而是这条语句所更新的每一条 记录的变化情况，这样就记录成很多条记录被更新的很多个事件。自然，bin-log日志的量就会很大。尤其是当执行alter table之类的语句的时候，产生的日志量是惊人的。因为Mysql对于alter table之类的表结构变更语句的处理方式是整个表的每一条记录都需要变动，实际上就是重建了整个表。那么该表的每一条记录都会被记录到日志中。
Statement Level:每一条会修改数据的sql都会记录到 master的bin-log中。slave在复制的时候sql进程会解析成和原来master端执行过的相同的sql来再次执行。
优点：statement level下的优点首先就是解决了row level下的缺点，不需要记录每一行数据的变化，减少bin-log日志量，节约IO，提高性能。因为他只需要记录在Master上所执行的语句的细节，以及执行语句时候的上下文的信息。
缺点：由于他是记录的执行语句，所以，为了让这些语句在slave端也能正确执行，那么他还必须记录每条语句在执行的时候的一些相关信息，也就是上下文信 息，以保证所有语句在slave端杯执行的时候能够得到和在master端执行时候相同的结果。另外就是，由于Mysql现在发展比较快，很多的新功能不 断的加入，使mysql得复制遇到了不小的挑战，自然复制的时候涉及到越复杂的内容，bug也就越容易出现。在statement level下，目前已经发现的就有不少情况会造成mysql的复制出现问题，主要是修改数据的时候使用了某些特定的函数或者功能的时候会出现，比 如：sleep()函数在有些版本中就不能真确复制，在存储过程中使用了last_insert_id()函数，可能会使slave和master上得到 不一致的id等等。由于row level是基于每一行来记录的变化，所以不会出现类似的问题。
从官方文档中看到，之前的Mysql一直都只有基于statement的复制模式，直到5.1.5版本的Mysql才开始支持row level的复制。从5.0开始，Mysql的复制已经解决了大量老版本中出现的无法正确复制的问题。但是由于存储过程的出现，给Mysql的复制又带来 了更大的新挑战。另外，看到官方文档说，从5.1.8版本开始，Mysql提供了除Statement Level和Row Level之外的第三种复制模式：Mixed，实际上就是前两种模式的结合。在Mixed模式下，Mysql会根据执行的每一条具体的sql语句来区分对 待记录的日志形式，也就是在Statement和Row之间选择一种。新版本中的Statment level还是和以前一样，仅仅记录执行的语句。而新版本的Mysql中队row level模式也被做了优化，并不是所有的修改都会以row level来记录，像遇到表结构变更的时候就会以statement模式来记录，如果sql语句确实就是update或者delete等修改数据的语句， 那么还是会记录所有行的变更。
3、复制常用架构
Mysql复制环境90%以上都是一个Master带一个或者多个Slave的架构模式，主要用于读压力比较大的应用的数据库端廉价扩展解决方案。因为只 要master和slave的压力不是太大（尤其是slave端压力）的话，异步复制的延时一般都很少很少。尤其是自slave端的复制方式改成两个进程 处理之后，更是减小了slave端的延时。而带来的效益是，对于数据实时性要求不是特别的敏感度的应用，只需要通过廉价的pc [...]</description><category>MySQL</category><category>MySQL复制</category><category>MySQL Replication</category><category>大话技术</category><pubDate>Wed, 24 Sep 2008 22:46:48 +0800</pubDate><author>sky</author><comments>http://www.alidba.net/index.php/archives/116#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=116</guid><dc:creator>sky</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/116</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/120831245/5028879</fs:itemid></item><item><title>MySQL单表到底可以多大</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831246/5028879/1/item.html</link><content:encoded>&lt;p&gt;前天突然收到Monitor Center发出来的报警：&lt;br /&gt;
PROBLEM:CN_DSL_***4/MAXFILE is CRITICAL,SNMP CRITICAL - *These File size is larger than 18932735283: /abc/def/ghi/***/***.MYD&lt;/p&gt;
&lt;p&gt;刚看到这个报警的时候，还吓了一跳。数据文件超过最大文件限制？不会吧？好像才18G嘛，怎么会就开始报警了？&lt;br /&gt;
于是开始查找报警来源，经过一番查找，总算找到监控脚本。这台机器之前是SA管理维护的，所以相关规范也是按照SA管理的web服务器来设计的。所以他们 在监控系统中添加了某些特定的目录下文件大小的限制，防止某些意外出现大文件的情况。最后我只得在监控脚本中过滤掉了MySQL的“.MYD”和 “.MYI”文件。&lt;/p&gt;
&lt;p&gt;说到文件大小，刚好常有人问我说MySQL是否有单个表的大小限制？限制多大呢？这里做一个简单的介绍吧。&lt;/p&gt;
&lt;p&gt;在老版本的MySQL 3.22中，MySQL的单表限大小为4GB，当时的MySQL的存储引擎还是ISAM存储引擎。但是，当出现MyISAM存储引擎之后，也就是从 MySQL 3.23开始，MySQL单表最大限制就已经扩大到了64PB了（官方文档显示）。也就是说，从目前的技术环境来看，MySQL数据库的MyISAM存储 引擎单表大小限制已经不是有MySQL数据库本身来决定，而是由所在主机的OS上面的文件系统来决定了。&lt;/p&gt;
&lt;p&gt;而MySQL另外一个最流行的存储引擎之一Innodb存储数据的策略是分为两种的，一种是共享表空间存储方式，还有一种是独享表空间存储方式。&lt;br /&gt;
当使用共享表空间存储方式的时候，Innodb的所有数据保存在一个单独的表空间里面，而这个表空间可以由很多个文件组成，一个表可以跨多个文件存在，所 以其大小限制不再是文件大小的限制，而是其自身的限制。从Innodb的官方文档中可以看到，其表空间的最大限制为64TB，也就是说，Innodb的单 表限制基本上也在64TB左右了，当然这个大小是包括这个表的所有索引等其他相关数据。&lt;br /&gt;
而当使用独享表空间来存放Innodb的表的时候，每个表的数据以一个单独的文件来存放，这个时候的单表限制，又变成文件系统的大小限制了。&lt;/p&gt;
&lt;p&gt;以下是从收集到的一点信息，不一定全部准确：&lt;br /&gt;
操作系统                                    大小限制&lt;br /&gt;
win32 w/ FAT/FAT32              2GB/4GB&lt;br /&gt;
win32 w/ NTFS                      2TB（可能更大）&lt;br /&gt;
Linux 2.2-Intel 32-bit            2GB (LFS: 4GB)&lt;br /&gt;
Linux 2.4+                            4TB(ext3)&lt;br /&gt;
Solaris 9/10                         16TB&lt;br /&gt;
NetWare w/NSS filesystem  8TB&lt;br /&gt;
MacOS X w/ HFS+               2TB&lt;/p&gt;
&lt;p&gt;以下是MySQL文档中的内容：&lt;br /&gt;
Windows用户请注意： FAT和VFAT (FAT32)不适合MySQL的生产使用。应使用NTFS。&lt;/p&gt;
&lt;p&gt;在默认情况下，MySQL创建的MyISAM表允许的最大尺寸为4GB。你可以使用SHOW TABLE STATUS语句或myisamchk -dv tbl_name检查表的最大尺寸。请参见13.5.4节，“SHOW语法”。&lt;/p&gt;
&lt;p&gt;如果需要使用大于4GB的MyISAM表（而且你的操作系统支持大文件），可使用允许AVG_ROW_LENGTH和MAX_ROWS选项的CREATE TABLE语句。创建了表后，也可以使用ALTER TABLE更改这些选项，以增加表的最大允许容量。&lt;/p&gt;
&lt;p&gt;原文首发： &lt;a href=&quot;http://www.jianzhaoyang.com&quot;&gt;Sky.Jian 朝阳的天空&lt;/a&gt;&lt;br /&gt;
原文链接：&lt;a href=&quot;http://www.jianzhaoyang.com/2008/09/211&quot;&gt;MySQL单表到底可以多大&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/115/feed</wfw:commentRss><description>前天突然收到Monitor Center发出来的报警：
PROBLEM:CN_DSL_***4/MAXFILE is CRITICAL,SNMP CRITICAL - *These File size is larger than 18932735283: /abc/def/ghi/***/***.MYD
刚看到这个报警的时候，还吓了一跳。数据文件超过最大文件限制？不会吧？好像才18G嘛，怎么会就开始报警了？
于是开始查找报警来源，经过一番查找，总算找到监控脚本。这台机器之前是SA管理维护的，所以相关规范也是按照SA管理的web服务器来设计的。所以他们 在监控系统中添加了某些特定的目录下文件大小的限制，防止某些意外出现大文件的情况。最后我只得在监控脚本中过滤掉了MySQL的“.MYD”和 “.MYI”文件。
说到文件大小，刚好常有人问我说MySQL是否有单个表的大小限制？限制多大呢？这里做一个简单的介绍吧。
在老版本的MySQL 3.22中，MySQL的单表限大小为4GB，当时的MySQL的存储引擎还是ISAM存储引擎。但是，当出现MyISAM存储引擎之后，也就是从 MySQL 3.23开始，MySQL单表最大限制就已经扩大到了64PB了（官方文档显示）。也就是说，从目前的技术环境来看，MySQL数据库的MyISAM存储 引擎单表大小限制已经不是有MySQL数据库本身来决定，而是由所在主机的OS上面的文件系统来决定了。
而MySQL另外一个最流行的存储引擎之一Innodb存储数据的策略是分为两种的，一种是共享表空间存储方式，还有一种是独享表空间存储方式。
当使用共享表空间存储方式的时候，Innodb的所有数据保存在一个单独的表空间里面，而这个表空间可以由很多个文件组成，一个表可以跨多个文件存在，所 以其大小限制不再是文件大小的限制，而是其自身的限制。从Innodb的官方文档中可以看到，其表空间的最大限制为64TB，也就是说，Innodb的单 表限制基本上也在64TB左右了，当然这个大小是包括这个表的所有索引等其他相关数据。
而当使用独享表空间来存放Innodb的表的时候，每个表的数据以一个单独的文件来存放，这个时候的单表限制，又变成文件系统的大小限制了。
以下是从收集到的一点信息，不一定全部准确：
操作系统                                    大小限制
win32 w/ FAT/FAT32              2GB/4GB
win32 w/ NTFS                      2TB（可能更大）
Linux 2.2-Intel 32-bit            2GB (LFS: 4GB)
Linux 2.4+                            4TB(ext3)
Solaris 9/10                         16TB
NetWare w/NSS filesystem  8TB
MacOS X w/ HFS+               2TB
以下是MySQL文档中的内容：
Windows用户请注意： FAT和VFAT (FAT32)不适合MySQL的生产使用。应使用NTFS。
在默认情况下，MySQL创建的MyISAM表允许的最大尺寸为4GB。你可以使用SHOW TABLE STATUS语句或myisamchk -dv tbl_name检查表的最大尺寸。请参见13.5.4节，“SHOW语法”。
如果需要使用大于4GB的MyISAM表（而且你的操作系统支持大文件），可使用允许AVG_ROW_LENGTH和MAX_ROWS选项的CREATE TABLE语句。创建了表后，也可以使用ALTER TABLE更改这些选项，以增加表的最大允许容量。
原文首发： Sky.Jian 朝阳的天空
原文链接：MySQL单表到底可以多大</description><category>表大小</category><category>MySQL</category><category>MySQL限制</category><category>大话技术</category><pubDate>Thu, 18 Sep 2008 11:46:07 +0800</pubDate><author>sky</author><comments>http://www.alidba.net/index.php/archives/115#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=115</guid><dc:creator>sky</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/115</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/120831246/5028879</fs:itemid></item><item><title>自己搞了函数行专列还是可以拼接</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831247/5028879/1/item.html</link><content:encoded>&lt;p&gt;今天有个需求，要求把一个表里的根据一列（例如id）分组并且将每行的任意几列的数据挨着拼装在一起中间加特殊字符，&lt;br /&gt;
然后分组之后每个id对应的几行合成一条记录，例如：&lt;br /&gt;
SQL&amp;gt; select * from test;&lt;/p&gt;
&lt;p&gt;P_ID NAME                 VALUE&lt;br /&gt;
&amp;#8212;&amp;#8212;&amp;#8212;- &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;&lt;br /&gt;
1 AAA                  aaa&lt;br /&gt;
2 BBB                  bbb&lt;br /&gt;
1 ABC                  abc&lt;br /&gt;
3 CCC                  ccc&lt;br /&gt;
2 DDD                  ddd&lt;/p&gt;
&lt;p&gt;SQL&amp;gt; SELECT P_ID, Mystrcat_n(NAME||chr(01)||value) NAME FROM TEST GROUP BY P_ID;&lt;/p&gt;
&lt;p&gt;P_ID&lt;br /&gt;
&amp;#8212;&amp;#8212;&amp;#8212;-&lt;br /&gt;
NAME&lt;br /&gt;
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;&lt;br /&gt;
1&lt;br /&gt;
2AAA2aaa2ABC2abc&lt;/p&gt;
&lt;p&gt;2&lt;br /&gt;
2BBB2bbb2DDD2ddd&lt;/p&gt;
&lt;p&gt;3&lt;br /&gt;
2CCC2ccc&lt;/p&gt;
&lt;p&gt;寻求&lt;a title=&quot;Sky.Jian 朝阳的天空&quot; href=&quot;http://www.jianzhaoyang.com&quot;&gt;Sky.Jian（简朝阳）&lt;/a&gt;帮助，给我了一个他自己搞的一个函数，结果不满足我的要求，&lt;br /&gt;
在他的基础上修改一下，可以满足以上要求，中间是用chr(01)来分隔的，函数体如下：&lt;br /&gt;
（执行此函数到底消耗多少资源没有测试过）&lt;/p&gt;
&lt;p&gt;create or replace type Mystrcat_new as object&lt;br /&gt;
(&lt;br /&gt;
str varchar2(4000),&lt;/p&gt;
&lt;p&gt;static function ODCIAggregateInitialize(sctx IN OUT Mystrcat_new) return number,&lt;br /&gt;
member function ODCIAggregateIterate(self IN OUT Mystrcat_new,value IN varchar2) return number,&lt;br /&gt;
member function ODCIAggregateTerminate(self IN Mystrcat_new,returnValue OUT varchar2, flags IN number) return number,&lt;br /&gt;
member function ODCIAggregateMerge(self IN OUT Mystrcat_new,ctx2 IN Mystrcat_new) return number&lt;br /&gt;
)&lt;br /&gt;
/&lt;/p&gt;
&lt;p&gt;create or replace type body Mystrcat_new is&lt;br /&gt;
static function ODCIAggregateInitialize(sctx IN OUT Mystrcat_new)&lt;br /&gt;
return number is&lt;br /&gt;
begin&lt;br /&gt;
sctx := Mystrcat_new(null);&lt;br /&gt;
return ODCIConst.Success;&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;member function ODCIAggregateIterate(self IN OUT Mystrcat_new, value IN varchar2)&lt;br /&gt;
return number is&lt;br /&gt;
begin&lt;br /&gt;
self.str := self.str||chr(01)||value;&lt;br /&gt;
return ODCIConst.Success;&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;member function ODCIAggregateTerminate(self IN Mystrcat_new, returnValue OUT varchar2, flags IN number) return number is&lt;br /&gt;
begin&lt;br /&gt;
returnValue := self.str;&lt;br /&gt;
return ODCIConst.Success;&lt;br /&gt;
end;&lt;/p&gt;
&lt;p&gt;member function ODCIAggregateMerge(self IN OUT Mystrcat_new, ctx2 IN Mystrcat_new) return number is&lt;br /&gt;
begin&lt;br /&gt;
null;&lt;br /&gt;
return ODCIConst.Success;&lt;br /&gt;
end;&lt;br /&gt;
end;&lt;br /&gt;
/&lt;/p&gt;
&lt;p&gt;CREATE OR REPLACE FUNCTION Mystrcat_n (input varchar2) RETURN varchar2&lt;br /&gt;
AGGREGATE USING Mystrcat_new;&lt;br /&gt;
/&lt;/p&gt;
&lt;p&gt;SELECT P_ID, Mystrcat_n(NAME||chr(01)||value) NAME FROM TEST GROUP BY P_ID;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/114/feed</wfw:commentRss><description>今天有个需求，要求把一个表里的根据一列（例如id）分组并且将每行的任意几列的数据挨着拼装在一起中间加特殊字符，
然后分组之后每个id对应的几行合成一条记录，例如：
SQL&amp;#62; select * from test;
P_ID NAME                 VALUE
&amp;#8212;&amp;#8212;&amp;#8212;- &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211; &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;
1 AAA                  aaa
2 BBB                  bbb
1 ABC                  abc
3 CCC                  ccc
2 DDD                  ddd
SQL&amp;#62; SELECT P_ID, Mystrcat_n(NAME&amp;#124;&amp;#124;chr(01)&amp;#124;&amp;#124;value) NAME FROM TEST GROUP BY P_ID;
P_ID
&amp;#8212;&amp;#8212;&amp;#8212;-
NAME
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;
1
2AAA2aaa2ABC2abc
2
2BBB2bbb2DDD2ddd
3
2CCC2ccc
寻求Sky.Jian（简朝阳）帮助，给我了一个他自己搞的一个函数，结果不满足我的要求，
在他的基础上修改一下，可以满足以上要求，中间是用chr(01)来分隔的，函数体如下：
（执行此函数到底消耗多少资源没有测试过）
create or replace type Mystrcat_new as object
(
str varchar2(4000),
static function ODCIAggregateInitialize(sctx IN OUT Mystrcat_new) return number,
member function ODCIAggregateIterate(self IN OUT Mystrcat_new,value IN varchar2) return number,
member function ODCIAggregateTerminate(self IN Mystrcat_new,returnValue [...]</description><category>大话技术</category><pubDate>Sat, 13 Sep 2008 00:20:01 +0800</pubDate><author>xiayulai</author><comments>http://www.alidba.net/index.php/archives/114#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=114</guid><dc:creator>xiayulai</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/114</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/120831247/5028879</fs:itemid></item><item><title>ASM Lib包务必注意小版本啊</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831248/5028879/1/item.html</link><content:encoded>&lt;p&gt;这件事是我太大意了，前几天装ASM的RPM包，怎么搞都搞不上去。我迷茫了好几天。到configure最后一步总是过不去，还调整了N多的OS参数，还上metalink上去查。报的错误是这样的：&lt;/p&gt;
&lt;p&gt;[root@localhost wt]# /etc/init.d/oracleasm configure&lt;br /&gt;
Configuring the Oracle ASM library driver.&lt;/p&gt;
&lt;p&gt;This will configure the on-boot properties of the Oracle ASM library&lt;br /&gt;
driver.  The following questions will determine whether the driver is&lt;br /&gt;
loaded on boot and what permissions it will have.  The current values&lt;br /&gt;
will be shown in brackets (&amp;#8217;[]&amp;#8216;).  Hitting &amp;lt;ENTER&amp;gt; without typing an&lt;br /&gt;
answer will keep that current value.  Ctrl-C will abort.&lt;/p&gt;
&lt;p&gt;Default user to own the driver interface [oracle]:&lt;br /&gt;
Default group to own the driver interface [oracle]: oinstall&lt;br /&gt;
Start Oracle ASM library driver on boot (y/n) [y]:&lt;br /&gt;
Fix permissions of Oracle ASM disks on boot (y/n) [y]:&lt;br /&gt;
Writing Oracle ASM library driver configuration: [  OK  ]&lt;br /&gt;
&lt;strong&gt;Loading module &amp;#8220;oracleasm&amp;#8221;: Unable to load module &amp;#8220;oracleasm&amp;#8221;&lt;br /&gt;
[FAILED]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;查了系统日志，给的信息是：&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sep 11 20:55:55 localhost modprobe: FATAL: Module oracleasm not found. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;搞的我一头雾水，看到oracle官方论坛上说，这是一个bug。一开始我也是这么认为了。&lt;/p&gt;
&lt;p&gt;今天再仔细看了下，是最最下面的小版本不对，ORACLE官方对小版本分的非常，非常细：&lt;/p&gt;
&lt;h5 class=&quot;boldbodycopy&quot;&gt;Drivers for kernel 2.6.18-92.el5&lt;/h5&gt;
&lt;ul&gt;
&lt;li class=&quot;bodycopy&quot;&gt;&lt;a class=&quot;bodylink&quot; href=&quot;http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/x86/2.0.4/2.6.18-92.el5/oracleasm-2.6.18-92.el5xen-2.0.4-1.el5.i686.rpm&quot;&gt;oracleasm-2.6.18-92.el5xen-2.0.4-1.el5.i686.rpm&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;bodycopy&quot;&gt;&lt;a class=&quot;bodylink&quot; href=&quot;http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/x86/2.0.4/2.6.18-92.el5/oracleasm-2.6.18-92.el5debug-2.0.4-1.el5.i686.rpm&quot;&gt;oracleasm-2.6.18-92.el5debug-2.0.4-1.el5.i686.rpm&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;bodycopy&quot;&gt;&lt;a class=&quot;bodylink&quot; href=&quot;http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/x86/2.0.4/2.6.18-92.el5/oracleasm-2.6.18-92.el5PAE-2.0.4-1.el5.i686.rpm&quot;&gt;oracleasm-2.6.18-92.el5PAE-2.0.4-1.el5.i686.rpm&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;bodycopy&quot;&gt;&lt;a class=&quot;bodylink&quot; href=&quot;http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/x86/2.0.4/2.6.18-92.el5/oracleasm-2.6.18-92.el5-2.0.4-1.el5.i686.rpm&quot;&gt;oracleasm-2.6.18-92.el5-2.0.4-1.el5.i686.rpm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;今天重新下了一个，小版本都一致的，结果就好了。&lt;/p&gt;
&lt;p&gt;看到论坛上，很多兄弟发生的情况，和我差不多。所以我特发此文。&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/113/feed</wfw:commentRss><description>这件事是我太大意了，前几天装ASM的RPM包，怎么搞都搞不上去。我迷茫了好几天。到configure最后一步总是过不去，还调整了N多的OS参数，还上metalink上去查。报的错误是这样的：
[root@localhost wt]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets (&amp;#8217;[]&amp;#8216;).  Hitting &amp;#60;ENTER&amp;#62; without typing an
answer will keep that current value.  Ctrl-C [...]</description><category>大话技术</category><pubDate>Fri, 12 Sep 2008 14:24:25 +0800</pubDate><author>vogts</author><comments>http://www.alidba.net/index.php/archives/113#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=113</guid><dc:creator>vogts</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/113</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/120831248/5028879</fs:itemid></item><item><title>oracle 11g standby query error: ora-08103 and ora-01410</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831249/5028879/1/item.html</link><content:encoded>&lt;p&gt;范鑫做的测试，我转过来。看起来很简单的一件事情，由于具有偶然性，不能每次都重现，所以特地记录下来，&lt;span style=&quot;宋体;&quot;&gt;一直报的&lt;/span&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;span&gt;ORA-08103: object no longer exists &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;宋体;&quot;&gt;&lt;span style=&quot;宋体;&quot;&gt;是由于&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; standby &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;宋体;&quot;&gt;&lt;span style=&quot;宋体;&quot;&gt;上的查询进程导致&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;宋体;&quot;&gt;&lt;span style=&quot;宋体;&quot;&gt;，把&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;standby &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;宋体;&quot;&gt;&lt;span style=&quot;宋体;&quot;&gt;激活后查询就正常了&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;当然这里要交代一下前提，就是在主数据库上有一个job，每天晚上将一个表truncate再插入数据，第二天就发现standby上查询错误，在主数据库上move表之后恢复正常。 但是手工做 truncate却取法重现，重新做个job任务偶尔重现，也不是一定得到这个现象。目前正在进一步测试中，但至少发现了 11g的 standby提供适时查询功能是存在缺陷的。当然不truncate就没问题。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;测试在一个已经存在问题的standby上进行，先以standby模式open，再open read only，最后激活open：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;oracle@ctr_db1:/home/oracle&amp;gt;export ORACLE_SID=testctrdmsb2&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;oracle@ctr_db1:/home/oracle&amp;gt;sqlplus /nolog&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Wed Sep 3 10:28:45 2008&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;@&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;@&amp;gt;sqlplus /nolog&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;SP2-0734: unknown command beginning &amp;#8220;sqlplus /n&amp;#8230;&amp;#8221; - rest of line ignored.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;@&amp;gt;conn / as sysdba&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Connected.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;select count(*) from mcc.sync_job_status;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;select count(*) from mcc.sync_job_status&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;                         *&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ERROR at line 1:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;ORA-01410: invalid ROWID&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;select count(*) from mcc.testd2;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;  COUNT(*)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&amp;#8212;&amp;#8212;&amp;#8212;-&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;      1127&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;shutdown immediate&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database closed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database dismounted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORACLE instance shut down.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;startup mount;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORA-32004: obsolete and/or deprecated parameter(s) specified&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORACLE instance started.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Total System Global Area 2004340736 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Fixed Size                  2145744 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Variable Size             402653744 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database Buffers         1593835520 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Redo Buffers                5705728 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database mounted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;alter database open ;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;select count(*) from mcc.sync_job_status;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;select count(*) from mcc.sync_job_status&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;                         *&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ERROR at line 1:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;ORA-08103: object no longer exists&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;shutdown immediate&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database closed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database dismounted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORACLE instance shut down.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;startup mount;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORA-32004: obsolete and/or deprecated parameter(s) specified&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORACLE instance started.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Total System Global Area 2004340736 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Fixed Size                  2145744 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Variable Size             402653744 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database Buffers         1593835520 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Redo Buffers                5705728 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database mounted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;alter database open read only;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;select count(*) from mcc.sync_job_status;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;select count(*) from mcc.sync_job_status&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;                         *&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ERROR at line 1:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;ORA-08103: object no longer exists&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;shutdown immediate&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database closed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database dismounted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORACLE instance shut down.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;startup mount;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORA-32004: obsolete and/or deprecated parameter(s) specified&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;ORACLE instance started.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Total System Global Area 2004340736 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Fixed Size                  2145744 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Variable Size             402653744 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database Buffers         1593835520 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Redo Buffers                5705728 bytes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database mounted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;alter database open;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;Database altered.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;sys@CTRDM_DB1&amp;gt;select count(*) from mcc.sync_job_status;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;  COUNT(*)&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;&amp;#8212;&amp;#8212;&amp;#8212;-&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt;        25&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;&lt;span style=&quot;Arial;&quot;&gt;sys@CTRDM_DB1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/109/feed</wfw:commentRss><description>范鑫做的测试，我转过来。看起来很简单的一件事情，由于具有偶然性，不能每次都重现，所以特地记录下来，一直报的 ORA-08103: object no longer exists 是由于 standby 上的查询进程导致 ，把standby 激活后查询就正常了 
当然这里要交代一下前提，就是在主数据库上有一个job，每天晚上将一个表truncate再插入数据，第二天就发现standby上查询错误，在主数据库上move表之后恢复正常。 但是手工做 truncate却取法重现，重新做个job任务偶尔重现，也不是一定得到这个现象。目前正在进一步测试中，但至少发现了 11g的 standby提供适时查询功能是存在缺陷的。当然不truncate就没问题。

测试在一个已经存在问题的standby上进行，先以standby模式open，再open read only，最后激活open：
 


oracle@ctr_db1:/home/oracle&amp;#62;export ORACLE_SID=testctrdmsb2
oracle@ctr_db1:/home/oracle&amp;#62;sqlplus /nolog
 
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Sep 3 10:28:45 2008
 
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
 
@&amp;#62;
@&amp;#62;sqlplus /nolog
SP2-0734: unknown command beginning &amp;#8220;sqlplus /n&amp;#8230;&amp;#8221; - rest of line ignored.
@&amp;#62;conn / as sysdba
Connected.
sys@CTRDM_DB1&amp;#62;
sys@CTRDM_DB1&amp;#62;select count(*) from mcc.sync_job_status;
select count(*) [...]</description><category>大话技术</category><pubDate>Wed, 03 Sep 2008 11:55:41 +0800</pubDate><author>fcp</author><comments>http://www.alidba.net/index.php/archives/109#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=109</guid><dc:creator>fcp</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/109</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/120831249/5028879</fs:itemid></item><item><title>如何恢复被删除的表空间？</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831250/5028879/1/item.html</link><content:encoded>&lt;p&gt;前几天看到论坛上有人问，看到大家都是纸上谈兵，我做了个example。&lt;/p&gt;
&lt;p&gt;下载地址：&lt;br /&gt;
&lt;a href=&quot;http://www.oracle.com.cn/attachment.php?aid=59778&quot; target=&quot;_blank&quot;&gt;删除表空间恢复.pdf&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/108/feed</wfw:commentRss><description>前几天看到论坛上有人问，看到大家都是纸上谈兵，我做了个example。
下载地址：
删除表空间恢复.pdf</description><category>大话技术</category><pubDate>Tue, 02 Sep 2008 13:19:09 +0800</pubDate><author>vogts</author><comments>http://www.alidba.net/index.php/archives/108#comments</comments><guid isPermaLink="false">http://www.alidba.net/?p=108</guid><dc:creator>vogts</dc:creator><fs:srclink>http://www.alidba.net/index.php/archives/108</fs:srclink><fs:srcfeed>http://www.alidba.net/index.php/feed</fs:srcfeed><fs:itemid>feedsky/AliDBA/~6920938/120831250/5028879</fs:itemid></item><item><title>学习latch笔记</title><link>http://item.feedsky.com/~feedsky/AliDBA/~6920938/120831251/5028879/1/item.html</link><content:encoded>&lt;p&gt;&amp;lt;!&amp;#8211; 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	&amp;#8211;&amp;gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;个人认为科学技术之间存在一定的相关性的，先举一个例子，来比较浅显的了解一下&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的一些特点。下图为一张十字路口照片，来来往往的车辆就是靠十字路口的一个交通信号灯来指挥的，当然有时候也会有按照交通警察的指令来执行。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;a href=&quot;http://www.alidba.net/wp-content/uploads/2008/08/e4baa4e9809ae58d81e5ad97e8b7afe58fa3.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-medium wp-image-107&quot; src=&quot;http://www.alidba.net/wp-content/uploads/2008/08/e4baa4e9809ae58d81e5ad97e8b7afe58fa3-300x246.jpg&quot; alt=&quot;&quot; width=&quot;300&quot; height=&quot;246&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&amp;lt;!&amp;#8211; 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	&amp;#8211;&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;中国的交通，十字路口有交通信号灯，信号灯周期性的变化。当东西直行的信号灯是绿的时，东西方向的汽车可以行走，此时南北方向的车需要等待；当南北方向的信号灯是绿的时候，南北方向的车是可以行走的，东西方向的车要等待。当一个方向为绿灯时另一个方向一定是红灯，除非线路故障。看到这个图，我突然想到和&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;很有一比，到底有多少呢，让我们一起看看下面几个问题：&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、那么信号灯是起一个什么作用呢？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;告诉行使的车里和行人你能不能通过十字路口。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、汽车等待的是什么？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;汽车在等待交通信号灯变成绿色，这样可以通过。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、汽车是使用信号灯呢还是使用十字路口的那一块马路呢？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;汽车得到绿色信号灯之后，会立即行使通过路口，他使用的就是那一个马路。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、 同时得到这个绿色信号灯的是不是不仅仅一辆车？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;同时看到绿灯的车辆有很多，并发的比较多。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、信号灯变化时间越长是不是就堵的更严重？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;信号灯的时间越长，导致一次等待的时间过长，押车的长度会变长，通过路口的速度要明显小于正常形式的速度，这样导致车会越来越多的堵在路上。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、是不是有的车得不到中间的道路资源他就不等待信号灯而直接右柺呢？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;有些车辆在直行的时候没有得到绿灯，他们还有别的方向可以选择，就会右转来直接走掉&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、是不是车辆的个头越大，同时通过路口的车辆就越少？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;一次占用整个车道，那岂不是要让后边的车没法通过？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、当一辆车在一次信号灯没有通过路口时，是不是继续等待，下一次绿色信号灯亮的时候是不是他第一时间可以通过？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;当一次绿灯正好没有通过路口，下一次绿灯到来的时候他就可以比较迅速的得到绿灯信号，而快速通过。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;发现交通信号灯这个设计很有意思，和&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;oracle&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;很像，不知道是谁学习的谁&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;strong&gt;Latch&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;strong&gt;到底是什么呢？&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;是能不能独自访问或执行某一种共享资源的信号灯。从程序上来讲就是一个变量，标记了某个资源的一个状态。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;有三种类型，父&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，子&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，独立&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;。其中，在&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch_parent&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;这个表中存放的是独立&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;和父&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，每一个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;存放一条记录。子&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;放在 &lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch_children&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;表中，每个子&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;存放一条记录，只有少数的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;有子&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，所以在&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch_children&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;表中，其&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;是一样的，但是其地址不一样，表明他保护&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;block&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;不想同。在&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;表中，保存了所有的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的聚合信息，在这里能看到宏观的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;信息，在&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch_children&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;中可以看到微观的每个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的信息。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;根据概念理解，对于共享的数据结构都是需要使用&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;进行保护的，有些数据结构使用一个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;有些数据结构使用多个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;（子&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;），多个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的使用可以增加并发度，因为不用访问一个资源而占用了整个链表的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的访问是独享的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&amp;lt;!&amp;#8211; 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	&amp;#8211;&amp;gt;
&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; lang=&quot;zh-CN&quot;&gt;&lt;span style=&quot;small;&quot;&gt;看了&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的概念，那么进程如何得到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;呢？&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;进程得到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的方式：&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willing-to-wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;和&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;no_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;两种方式：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Willing-to-wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;方式是请求一个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;如果一次请求&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;没有获得，然后又有经过&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;和&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;try again&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;经过多次的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;（&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;_SPIN_COUNT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;）&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;如果还没有得到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;则进入到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;状态，进入&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;前，它需要先安排一下他的后事&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，不能一睡不起呀&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;（如何醒来，超时和&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;repost&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;）&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，还有就是&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;通知&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$session_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;自己发生了&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch  free wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;了&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，从这里可以知道，每次&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;都会对应着一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch free wait event&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;。&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;也可以称之为&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;active wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间片该进程还没有消耗完毕，那么这样进程还是在消耗&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间的。&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;这样的方式请求的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的（&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;）级别要比自己持有的高才可以&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，为什么呢？如果&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;进程占有一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;为&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，它去请求一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;为&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，而进程&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，占有这个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;为&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，又去请求那个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;为&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，这样会有什么问题呢？因为它是可以去&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的，又是可以去&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;之后还是继续重复？那就永远没有完没有了了。所以呢，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;request&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是有&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;顺序的，不能随便的请求。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;为什么要&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;呢？&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是对于多&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;系统而言的，一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是没有必要的，因为，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是一个进程在&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间片内等待一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，它会让&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;进程去其他的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;去&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;pin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;一下，如果有其他的进程释放了该&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，那么就可以得到了，又因为一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，在一个时刻只能处理一个进程，进程切换的代价又很高，要建立上下文环境，所以尽量在&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;没有切换的时候能得到&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;最好。&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的次数也是有一个参数来指定的，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;_SPIN_COUNT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，文档上有一个公式说&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;_SPIN_COUNT * &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;em&gt;sleeps &lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;/ &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;em&gt;misses &lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的值越小越好，但是我没有明白过来，请大牛们解释一下。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;在&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;中，有&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;gets&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;misses&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;。那么&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;gets&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是什么意思呢？&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;gets&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是进程通过&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willng-to-wait&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;得到的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的次数，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;misses&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willing-to-wait&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;模式并且没有&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;pin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;也没有得到&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的次数。那么经过多次的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;得到&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;计作一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;gets&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，经过多次&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;没有的到&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，那就是&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;Georgia,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;了。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willing-to-wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;模式请求&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;失败了，然后就要去&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;要去告诉&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$session_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;和&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;V$SYSTEM_EVENT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;发生了&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch free &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;等待事件。&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;之后还是要醒来的，要么是闹钟（超时），要么就是告诉别人叫他一下（&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;repost&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;）。&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;醒来之后，其下次的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间要变长的，不知道为什么，睡得越多，每次睡眠的时间就越长（&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;2s&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;），但是当一个进程持有&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的时候睡眠的时间会很短（&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;厘秒）。&lt;/span&gt;&lt;/span&gt;&lt;span&gt;（&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1000&lt;/span&gt;毫秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(ms)&lt;/span&gt;&lt;span&gt;，&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;毫秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1&lt;/span&gt;／&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1,000&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(s) &lt;/span&gt;&lt;span&gt;，&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1,000,000 &lt;/span&gt;微秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(μs) &lt;/span&gt;&lt;span&gt;，&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;微秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1&lt;/span&gt;／&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1,000,000&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(s)&lt;/span&gt;&lt;span&gt;，&lt;/span&gt; &lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1,000,000,000 &lt;/span&gt;纳秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(ns)&lt;/span&gt;&lt;span&gt;，&lt;/span&gt; &lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;纳秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1&lt;/span&gt;／&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1,000,000,000&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(s) &lt;/span&gt;&lt;span&gt;，&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1,000,000,000,000 &lt;/span&gt;皮秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(ps)&lt;/span&gt;&lt;span&gt;，&lt;/span&gt; &lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1&lt;/span&gt;皮秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;=1&lt;/span&gt;／&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;1,000,000,000,000&lt;/span&gt;秒&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;(s)&lt;/span&gt;&lt;span&gt;）&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;在上面看来，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;如果出现&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleeps&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;比较多，造成的影响是比较严重，因为每次&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;request latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;都会耗用&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间，&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;说明了白白浪费了&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间，这样会造成资源的浪费。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;No_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;方式去请求一个&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，有两种情况：&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、他请求的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;有多个类型相同的&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;子&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;可以请求，会先请求一个，如果得不到，就请求下一个同样的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，如果都扫描了一遍，还是没有得到，则转入&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willing-to-wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;。&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、请求的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;级别与请求的相同或者低的时候&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，因为他有&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;deadlock&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;保护，所以可以。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; align=&quot;left&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;No_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;方式在&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的记录为：&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;IMMEDIATE_GETS &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;和 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;IMMEDIATE_MISSES&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cleanup&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，在&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的使用过程中，可能会出现一些异常，而导致有些&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;被异常占有得不到释放，这样就会有问题了，别的进程过来请求不到。出现这样的异常&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;pmon&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;进程会跟进处理，对于其处理的流程来说，最重要的莫过于将没有提交的事物回滚，那么就需要&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;支持恢复，那么&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;在开始操作前会先写一些信息去&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的恢复区。&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Pmon 3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;秒钟会自动运行一下，但是这也使很长的一段时间了，所以在进程在请求一个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;失败多次之后，会&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;post pmon&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;进程去&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;check&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;一下占有这个&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;process&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;是不是正常。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; lang=&quot;zh-CN&quot;&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;gets&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;misses&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cleanup&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;是对于多&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;系统而设计的，目的是为了能够尽量不发生进程交换的情况下得到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，该进程去查看别的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;有没有释放其需要的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;如果能得到就可以在一次&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;时间内处理完事情，多好呀。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Gets &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;：&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willing-to-wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;模式的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;not spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;和&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;（不论一次还是多次&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;spin&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;）的&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;gets&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Misses &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;：&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;willing-to-wait &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;fail to get without spin&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Sleep&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;：&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt; 在一次&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;cpu&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;时间内没有得到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;，就会睡眠&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;IMMEDIATE_GETS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;： &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;no_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;模式的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;IMMEDIATE_MISSES&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;： &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;no_wait&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;模式的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;miss&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Cleanup &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;占有&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的进程出现异常，需要&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;PMON&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;进行清理，以免长期占有&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;。在进程得到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;之后需要先将恢复数据写到恢复区，保证出现异常之后能够正常恢复。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;strong&gt;查看&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;strong&gt;latch&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;strong&gt;的视图：&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;select latch#, name from v$latchname&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;；&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; lang=&quot;zh-CN&quot;&gt;&lt;span style=&quot;small;&quot;&gt;可以看到&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;的名字&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;２、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Select total_waits from v$system_event where event=‘latch free’;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;２、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;Select sum(sleeps) from v$latch;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; lang=&quot;zh-CN&quot;&gt;&lt;span style=&quot;small;&quot;&gt;上面这两个的结果实一样的。&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;３、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;select name, gets, misses, immediate_gets, immediate_misses, sleeps from v$latch order by sleeps; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot; lang=&quot;zh-CN&quot;&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;、&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;select * from (&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;SELECT file#, dbablk, class, state, TCH FROM X$BH b,v$latch_children lc WHERE b.HLADDR=lc.addr &lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;order by &lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;TCH&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt; desc) where rownum&amp;lt;=10;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;此&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;sql&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;可以查询一下&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;hot block&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;，其中 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;TCH&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt; touch count header? &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;该值大，说明了被访问的次数相当多。&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;X$bh&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;中的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;HLaddr&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;就是说的在&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;block&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;头的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;latch&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;地址，正好是&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;v$latch_children&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;的&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Liberation Serif,serif;&quot;&gt;&lt;span style=&quot;small;&quot;&gt;addr&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;small;&quot;&gt;&lt;span&gt;。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;0cm;&quot;&gt;</content:encoded><wfw:commentRss>http://www.alidba.net/index.php/archives/106/feed</wfw:commentRss><description>&amp;#60;!&amp;#8211; 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	&amp;#8211;&amp;#62;
个人认为科学技术之间存在一定的相关性的，先举一个例子，来比较浅显的了解一下latch的一些特点。下图为一张十字路口照片，来来往往的车辆就是靠十字路口的一个交通信号灯来指挥的，当然有时候也会有按照交通警察的指令来执行。

&amp;#60;!&amp;#8211; 		@page { size: 21cm 29.7cm; margin: 2cm } 		P { margin-bottom: 0.21cm } 	&amp;#8211;&amp;#62;

中国的交通，十字路口有交通信号灯，信号灯周期性的变化。当东西直行的信号灯是绿的时，东西方向的汽车可以行走，此时南北方向的车需要等待；当南北方向的信号灯是绿的时候，南北方向的车是可以行走的，东西方向的车要等待。当一个方向为绿灯时另一个方向一定是红灯，除非线路故障。看到这个图，我突然想到和latch很有一比，到底有多少呢，让我们一起看看下面几个问题：
1、那么信号灯是起一个什么作用呢？
告诉行使的车里和行人你能不能通过十字路口。
2、汽车等待的是什么？
汽车在等待交通信号灯变成绿色，这样可以通过。
3、汽车是使用信号灯呢还是使用十字路口的那一块马路呢？
汽车得到绿色信号灯之后，会立即行使通过路口，他使用的就是那一个马路。
4、 同时得到这个绿色信号灯的是不是不仅仅一辆车？
同时看到绿灯的车辆有很多，并发的比较多。
5、信号灯变化时间越长是不是就堵的更严重？
信号灯的时间越长，导致一次等待的时间过长，押车的长度会变长，通过路口的速度要明显小于正常形式的速度，这样导致车会越来越多的堵在路上。
6、是不是有的车得不到中间的道路资源他就不等待信号灯而直接右柺呢？
有些车辆在直行的时候没有得到绿灯，他们还有别的方向可以选择，就会右转来直接走掉
7、是不是车辆的个头越大，同时通过路口的车辆就越少？
一次占用整个车道，那岂不是要让后边的车没法通过？
8、当一辆车在一次信号灯没有通过路口时，是不是继续等待，下一次绿色信号灯亮的时候是不是他第一时间可以通过？
当一次绿灯正好没有通过路口，下一次绿灯到来的时候他就可以比较迅速的得到绿灯信号，而快速通过。
发现交通信号灯这个设计很有意思，和oracle的latch很像，不知道是谁学习的谁.



Latch到底是什么呢？


是能不能独自访问或执行某一种共享资源的信号灯。从程序上来讲就是一个变量，标记了某个资源的一个状态。
Latch有三种类型，父latch，子latch，独立latch。其中，在v$latch_parent这个表中存放的是独立latch和父latch，每一个latch存放一条记录。子latch放在 v$latch_children表中，每个子latch存放一条记录，只有少数的latch有子latc