﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-回忆之城-随笔分类-测试技术相关</title><link>http://www.cnitblog.com/xijia0524/category/6086.html</link><description>生命在于折腾</description><language>zh-cn</language><lastBuildDate>Tue, 10 Jun 2014 11:54:06 GMT</lastBuildDate><pubDate>Tue, 10 Jun 2014 11:54:06 GMT</pubDate><ttl>60</ttl><item><title>【转】TCP、UDP和HTTP</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/10/89597.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Tue, 10 Jun 2014 08:57:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/10/89597.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89597.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/10/89597.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89597.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89597.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">先来一个讲TCP、UDP和HTTP关系的</p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">1、<span style="color: #ff0000;">TCP/IP是个协议组，可分为三个层次：网络层、传输层和应用层。<br />在网络层有IP协议、ICMP协议、ARP协议、RARP协议和BOOTP协议。<br />在传输层中有TCP协议与UDP协议。<br />在应用层有FTP、HTTP、TELNET、SMTP、DNS等协议。<br />因此，HTTP本身就是一个协议，是从Web服务器传输超文本到本地浏览器的传送协议。</span></p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">&nbsp;<wbr></p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">2、HTTP协议是建立在请求/响应模型上的。首先由客户建立一条与服务器的TCP链接，并发送一个请求到服务器，请求中包含请求方法、URI、协议版本以及相关的MIME样式的消息。服务器响应一个状态行，包含消息的协议版本、一个成功和失败码以及相关的MIME式样的消息。<br />HTTP/1.0为每一次HTTP的请求/响应建立一条新的TCP链接，因此一个包含HTML内容和图片的页面将需要建立多次的短期的TCP链接。一次TCP链接的建立将需要3次握手。<br />另外，为了获得适当的传输速度，则需要TCP花费额外的回路链接时间（RTT）。每一次链接的建立需要这种经常性的开销，而其并不带有实际有用的数据，只是保证链接的可靠性，因此HTTP/1.1提出了可持续链接的实现方法。HTTP/1.1将只建立一次TCP的链接而重复地使用它传输一系列的请求/响应消息，因此减少了链接建立的次数和经常性的链接开销。</p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">&nbsp;<wbr></p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">3、<span style="color: #ff0000;">结论：虽然HTTP本身是一个协议，但其最终还是基于TCP的</span>。不过，目前，有人正在研究基于TCP+UDP混合的HTTP协议。</p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; ">Socket是什么呢？<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<span style="color: #ff0000;">Socket是应用层与TCP/IP协议族通信的中间软件抽象层，它是一组接口</span>。在设计模式中，Socket其实就是一个门面模式，它把复杂的TCP/IP协议族隐藏在Socket接口后面，对用户来说，一组简单的接口就是全部，让Socket去组织数据，以符合指定的协议。</p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; "><br /><img title="HTTP、TCP、UDP、Socket&nbsp;&lt;wbr&gt;&nbsp;&lt;wbr&gt;&nbsp;&lt;wbr&gt;(转)" alt="HTTP、TCP、UDP、Socket&nbsp;&lt;wbr&gt;&nbsp;&lt;wbr&gt;&nbsp;&lt;wbr&gt;(转)" src="http://images.cnblogs.com/cnblogs_com/goodcandle/socket2.jpg" width="542" height="476" style="border: none; max-width: 100%;" /></p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89597.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-10 16:57 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/10/89597.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】mysql查询在一张表不在另外一张表的记录</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89595.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 08 Jun 2014 12:57:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89595.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89595.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89595.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89595.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89595.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: mysql查询在一张表不在另外一张表的记录&nbsp;问题：&nbsp;&nbsp;查询一个表（tb1）的字段记录不在另一个表（tb2）中 &nbsp;&nbsp;&nbsp; 条件：tb1的字段key的值不在tbl2表中 &nbsp;&nbsp;&nbsp; －－－－－－－－－－－－－－－－－－－－－－ &nbsp; &nbsp;最原始的写法： &nbsp;&nbsp...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2014/06/08/89595.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/89595.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-08 20:57 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/08/89595.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】求MYSQL中某字段内的重复数据</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89593.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 08 Jun 2014 12:54:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89593.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89593.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89593.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89593.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89593.html</trackback:ping><description><![CDATA[<pre style="padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 10px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-break: break-all; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="line mt-10 q-content" accuse="qContent">数据库: show<br />数据表: tbl_vod<br />字段:  d_name<br />查找字段 d_name 中重复的数据</pre><br /><br /><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="best-content-942043570" class="best-text mb-10" accuse="aContent">select d_name,count(d_name) from tbl_vod group by d_name having count(d_name)&gt;1</pre>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40927624" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(94,187,11); font-size: 12px" class="ask f-12 grid">追问</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40927624" class="replyask-content line ml-10" accuse="qRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="qRA">谢谢你,这个语句可以查出来某个数据重复的次数,,我想删除里面的重复保留一个要怎么写呢<br /><br />或让他全部显示我手工删除 ,现在查询出来只能显示某个数据的重复次数 没办法选择删除</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40927798" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(65,144,227); font-size: 12px" class="reply f-12 grid">回答</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40927798" class="replyask-content line ml-10" accuse="aRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="aRA">//去除重复的数据 如果是重复的只显示1个<br />select distinct d_name from tbl_vod<br />--下面是查出重复的记录<br />select d_name from tbl_vod<br />minus<br />select distinct d_name from tbl_vod</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40928067" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(94,187,11); font-size: 12px" class="ask f-12 grid">追问</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40928067" class="replyask-content line ml-10" accuse="qRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="qRA">我是想把重复的彻的删除掉呀</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40928167" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(65,144,227); font-size: 12px" class="reply f-12 grid">回答</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40928167" class="replyask-content line ml-10" accuse="aRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="aRA">有主键字段吗</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40928244" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(94,187,11); font-size: 12px" class="ask f-12 grid">追问</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40928244" class="replyask-content line ml-10" accuse="qRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="qRA">d_id 这个是主键</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40929033" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(65,144,227); font-size: 12px" class="reply f-12 grid">回答</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40929033" class="replyask-content line ml-10" accuse="aRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="aRA">delete from tbl_vod where d_id  in (<br />select d_id from tbl_vod<br />minus<br />select max(d_id) from tbl_vod group by d_name<br />)<br />这样应该可以了</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40935149" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(94,187,11); font-size: 12px" class="ask f-12 grid">追问</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40935149" class="replyask-content line ml-10" accuse="qRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="qRA">#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select max(d_id) from tbl_vod group by d_name)' at line 1<br /><br />d_id是不重复的</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-40937729" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(65,144,227); font-size: 12px" class="reply f-12 grid">回答</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-40937729" class="replyask-content line ml-10" accuse="aRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="aRA">delete from tbl_vod where d_id not in (<br />select max(d_id) from tbl_vod group by d_name<br />)<br />原来mysql不支持minus<br />数据不多的话 用这句<br />意思是先选出不重复d_name对应的d_id <br />然后删除d_id不在这些记录里的数据</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-41063407" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(94,187,11); font-size: 12px" class="ask f-12 grid">追问</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-41063407" class="replyask-content line ml-10" accuse="qRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="qRA">#1093 - You can't specify target table 'tbl_vod' for update in FROM clause<br /><br />有5万多数据 有几千条重复吧</pre></div></div>
<div style="padding-bottom: 5px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; letter-spacing: normal; font: 14px/24px arial, 宋体, sans-serif, 'Microsoft YaHei', tahoma; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 5px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="replyask-41227010" class="replyask line pt-5 pb-5">
<div style="display: inline; float: left; color: rgb(65,144,227); font-size: 12px" class="reply f-12 grid">回答</div>
<div style="word-wrap: break-word; margin-left: 40px; word-break: break-all" id="replyask-content-41227010" class="replyask-content line ml-10" accuse="aRA"><pre style="padding-bottom: 0px; margin: 0px 100px 0px 0px; padding-left: 0px; padding-right: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; padding-top: 0px" accuse="aRA">delect tbl_vod from tbl_vod a,<br />(select max(d_id) from tbl_vod group by d_name) b<br />where a.d_id&lt;b.d_id and a.d_name=b.d_name</pre></div></div><img src ="http://www.cnitblog.com/xijia0524/aggbug/89593.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-08 20:54 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/08/89593.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】mysql 一个表中的字段like另一个表中的字段的语句要怎么写</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89591.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 08 Jun 2014 12:53:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89591.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89591.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89591.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89591.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89591.html</trackback:ping><description><![CDATA[<pre style="padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 10px 0px 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-break: break-all; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="line mt-10 q-content" accuse="qContent">select a.shuy,b.mingz from a a,b b where a.pfmingc like '%b.mingz%<br /><br />做查询。。想法大概就是像上面的语句这样。。但是要怎么写正确。。</pre><br /><br /><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="recommend-content-1595016683" class="recommend-text mb-10" accuse="aContent">select a.shuy,b.mingz from a a,b b where a.pfmingc like '%'||b.mingz||'%'<br />或者使用<br /><strong><span style="color: red">select a.shuy,b.mingz from a a,b b where a.pfmingc like </span><span style="color: red">concat ('%&#8216;,b.mingz,'%')</span></strong></pre><br /><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="answer-content-1595398935" class="answer-text mb-10" accuse="aContent">select a.shuy,b.mingz from a a,b b where a.pfmingc like '%' +b.mingz+'%'</pre><img src ="http://www.cnitblog.com/xijia0524/aggbug/89591.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-08 20:53 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/08/89591.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】在linux下如何判断cpu是双核还是单核 </title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89590.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 08 Jun 2014 10:33:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89590.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89590.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/08/89590.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89590.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89590.html</trackback:ping><description><![CDATA[<span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">linux如何查看CPU，内存，机器型号，网卡信息&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">查看CPU信息（型号）&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># </span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c </strong></span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp; &nbsp; &nbsp; 8 &nbsp;Intel(R) Xeon(R) CPU &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;E5410 &nbsp; @ 2.33GHz (看到有8个逻辑CPU, 也知道了CPU型号)&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">#</span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong> cat /proc/cpuinfo | grep physical | uniq -c</strong> </span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp; &nbsp; &nbsp; 4 physical id &nbsp; &nbsp; &nbsp;: 0 &nbsp; &nbsp; &nbsp; 4 physical id &nbsp; &nbsp; &nbsp;: 1&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">(说明实际上是两颗4核的CPU)&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">PS：Jay added on 10th, May, 2011&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># 其实是可能有超线程HT技术，不一定是有4核，也可能是2核4线程；当时还理解不清楚&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># </span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>getconf LONG_BIT</strong></span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> &nbsp; &nbsp;32&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)</strong>&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># </span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l</strong></span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> &nbsp; &nbsp;8&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)</strong></span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> &nbsp;&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">再完整看cpu详细信息, 不过大部分我们都不关心而已. # dmidecode | grep -A81 'Processor Information' &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">查看主板型号：&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># dmidecode |grep -A16 "System Information$" &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">内存槽及内存条：&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># dmidecode |grep -A16 "Memory Device$" &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">查看内存信息&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># cat /proc/meminfo &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># uname -a&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">(查看当前操作系统内核信息)&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># cat /etc/issue | grep Linux&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Red Hat Enterprise Linux AS release 4 (Nahant Update 5) (查看当前操作系统发行版信息)&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">查看机器型号&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># dmidecode | grep "Product Name" &nbsp; &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">查看网卡信息&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># dmesg | grep -i eth &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># mii-tool &nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">硬盘：&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># fdisk -l&nbsp;</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; orphans: 2; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># smartctl -a /dev/sda</span><img src ="http://www.cnitblog.com/xijia0524/aggbug/89590.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-08 18:33 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/08/89590.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】adb install 和adb uninstall</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/06/89589.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 06 Jun 2014 04:10:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/06/89589.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89589.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/06/89589.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89589.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89589.html</trackback:ping><description><![CDATA[<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">ubnutu10.10环境下:<br /></span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">android在用命令安装一个apk包时方法如下:</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px"></span></p>
<div style="text-align: left; widows: 2; text-transform: none; background-color: rgb(231,229,220); text-indent: 0px; margin: 18px 0px; width: 693px; letter-spacing: normal; font: 12px/26px Consolas, 'Courier New', Courier, mono, serif; white-space: normal; orphans: 2; color: rgb(54,46,43); overflow: auto; word-spacing: 0px; padding-top: 1px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="dp-highlighter bg_html">
<div style="padding-left: 45px" class="bar">
<div style="border-left: rgb(108,226,108) 3px solid; padding-bottom: 10px; background-color: rgb(248,248,248); padding-left: 10px; padding-right: 8px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px" class="tools"><strong>[html]</strong><span class="Apple-converted-space">&nbsp;</span><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">view plain</a><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">copy</a> 
<div style="z-index: 99; position: absolute; width: 18px; height: 18px; top: 552px; left: 676px"><embed id="ZeroClipboardMovie_1" height="18" name="ZeroClipboardMovie_1" type="application/x-shockwave-flash" align="center" pluginspage="http://www.macromedia.com/go/getflashplayer" width="18" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="false" flashvars="id=1&amp;width=18&amp;height=18" wmode="transparent"></div></div></div>
<ol style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; background-color: rgb(255,255,255); list-style-type: decimal; margin: 0px 0px 1px 45px; padding-left: 0px; padding-right: 0px; color: rgb(92,92,92); border-top: medium none; border-right: medium none; padding-top: 0px" class="dp-xml"><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">adb&nbsp;install&nbsp;SpareParts.apk&nbsp;&nbsp;</span></span></li></ol></div><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" />
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">如果有：</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">401 KB/s (23592 bytes in 0.057s)<br />&nbsp;&nbsp; &nbsp;pkg: /data/local/tmp/SpareParts.apk<br />Success</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">表示安装成功</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">注：如果系统里有一个于这个包同名的包，安装会是失败，并提示安装的这个包已经存在，</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">要想通过命令安装，需要先将系统里的包删掉后在安装，</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br /></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">删除系统里的包的方法：</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px"></span></p>
<div style="text-align: left; widows: 2; text-transform: none; background-color: rgb(231,229,220); text-indent: 0px; margin: 18px 0px; width: 693px; letter-spacing: normal; font: 12px/26px Consolas, 'Courier New', Courier, mono, serif; white-space: normal; orphans: 2; color: rgb(54,46,43); overflow: auto; word-spacing: 0px; padding-top: 1px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="dp-highlighter bg_html">
<div style="padding-left: 45px" class="bar">
<div style="border-left: rgb(108,226,108) 3px solid; padding-bottom: 10px; background-color: rgb(248,248,248); padding-left: 10px; padding-right: 8px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px" class="tools"><strong>[html]</strong><span class="Apple-converted-space">&nbsp;</span><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">view plain</a><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">copy</a> 
<div style="z-index: 99; position: absolute; width: 18px; height: 18px; top: 997px; left: 676px"><embed id="ZeroClipboardMovie_2" height="18" name="ZeroClipboardMovie_2" type="application/x-shockwave-flash" align="center" pluginspage="http://www.macromedia.com/go/getflashplayer" width="18" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="false" flashvars="id=2&amp;width=18&amp;height=18" wmode="transparent"></div></div></div>
<ol style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; background-color: rgb(255,255,255); list-style-type: decimal; margin: 0px 0px 1px 45px; padding-left: 0px; padding-right: 0px; color: rgb(92,92,92); border-top: medium none; border-right: medium none; padding-top: 0px" class="dp-xml"><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">adb&nbsp;remount&nbsp;&nbsp;</span></span></li></ol></div><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">让系统的system目录变为读写</span> 
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">然后adb shell 进入系统，进入到system/app/目录下将其</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px"></span></p>
<div style="text-align: left; widows: 2; text-transform: none; background-color: rgb(231,229,220); text-indent: 0px; margin: 18px 0px; width: 693px; letter-spacing: normal; font: 12px/26px Consolas, 'Courier New', Courier, mono, serif; white-space: normal; orphans: 2; color: rgb(54,46,43); overflow: auto; word-spacing: 0px; padding-top: 1px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="dp-highlighter bg_html">
<div style="padding-left: 45px" class="bar">
<div style="border-left: rgb(108,226,108) 3px solid; padding-bottom: 10px; background-color: rgb(248,248,248); padding-left: 10px; padding-right: 8px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px" class="tools"><strong>[html]</strong><span class="Apple-converted-space">&nbsp;</span><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">view plain</a><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">copy</a> 
<div style="z-index: 99; position: absolute; width: 18px; height: 18px; top: 1176px; left: 676px"><embed id="ZeroClipboardMovie_3" height="18" name="ZeroClipboardMovie_3" type="application/x-shockwave-flash" align="center" pluginspage="http://www.macromedia.com/go/getflashplayer" width="18" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="false" flashvars="id=3&amp;width=18&amp;height=18" wmode="transparent"></div></div></div>
<ol style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; background-color: rgb(255,255,255); list-style-type: decimal; margin: 0px 0px 1px 45px; padding-left: 0px; padding-right: 0px; color: rgb(92,92,92); border-top: medium none; border-right: medium none; padding-top: 0px" class="dp-xml"><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">rm&nbsp;SpareParts.apk&nbsp;&nbsp;</span></span></li></ol></div>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">然后退出 在用命令按转即可</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">通过install命令安装的apk包会放在/data/app目录下，而且包名会改变。</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br /></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">卸载一个apk包方法：</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px"><span style="font-size: 16px"></span></span></p>
<div style="text-align: left; widows: 2; text-transform: none; background-color: rgb(231,229,220); text-indent: 0px; margin: 18px 0px; width: 693px; letter-spacing: normal; font: 12px/26px Consolas, 'Courier New', Courier, mono, serif; white-space: normal; orphans: 2; color: rgb(54,46,43); overflow: auto; word-spacing: 0px; padding-top: 1px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="dp-highlighter bg_html">
<div style="padding-left: 45px" class="bar">
<div style="border-left: rgb(108,226,108) 3px solid; padding-bottom: 10px; background-color: rgb(248,248,248); padding-left: 10px; padding-right: 8px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px" class="tools"><strong>[html]</strong><span class="Apple-converted-space">&nbsp;</span><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">view plain</a><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">copy</a> 
<div style="z-index: 99; position: absolute; width: 18px; height: 18px; top: 1409px; left: 676px"><embed id="ZeroClipboardMovie_4" height="18" name="ZeroClipboardMovie_4" type="application/x-shockwave-flash" align="center" pluginspage="http://www.macromedia.com/go/getflashplayer" width="18" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="false" flashvars="id=4&amp;width=18&amp;height=18" wmode="transparent"></div></div></div>
<ol style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; background-color: rgb(255,255,255); list-style-type: decimal; margin: 0px 0px 1px 45px; padding-left: 0px; padding-right: 0px; color: rgb(92,92,92); border-top: medium none; border-right: medium none; padding-top: 0px" class="dp-xml"><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">adb&nbsp;uninstall&nbsp;SpareParts.apk&nbsp;&nbsp;</span></span></li></ol></div><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">会提示失败</span> 
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">原因在于安装后的包名已将改变，变为AndroidMainifest.xml文件中&lt;manifest&gt;节点下，package元素所指定的名字</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">正确方法是：</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px"></span></p>
<div style="text-align: left; widows: 2; text-transform: none; background-color: rgb(231,229,220); text-indent: 0px; margin: 18px 0px; width: 693px; letter-spacing: normal; font: 12px/26px Consolas, 'Courier New', Courier, mono, serif; white-space: normal; orphans: 2; color: rgb(54,46,43); overflow: auto; word-spacing: 0px; padding-top: 1px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="dp-highlighter bg_html">
<div style="padding-left: 45px" class="bar">
<div style="border-left: rgb(108,226,108) 3px solid; padding-bottom: 10px; background-color: rgb(248,248,248); padding-left: 10px; padding-right: 8px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px" class="tools"><strong>[html]</strong><span class="Apple-converted-space">&nbsp;</span><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">view plain</a><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://blog.csdn.net/ydt_lwj/article/details/7766742#">copy</a> 
<div style="z-index: 99; position: absolute; width: 18px; height: 18px; top: 1654px; left: 676px"><embed id="ZeroClipboardMovie_5" height="18" name="ZeroClipboardMovie_5" type="application/x-shockwave-flash" align="center" pluginspage="http://www.macromedia.com/go/getflashplayer" width="18" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="false" flashvars="id=5&amp;width=18&amp;height=18" wmode="transparent"></div></div></div>
<ol style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; background-color: rgb(255,255,255); list-style-type: decimal; margin: 0px 0px 1px 45px; padding-left: 0px; padding-right: 0px; color: rgb(92,92,92); border-top: medium none; border-right: medium none; padding-top: 0px" class="dp-xml"><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">adb&nbsp;uninstall&nbsp;com.android.spare_parts&nbsp;&nbsp;</span></span></li></ol></div>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br /></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(54,46,43); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 16px">完成！</span></p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89589.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-06 12:10 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/06/89589.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】使用wireshark分析网络流量实例</title><link>http://www.cnitblog.com/xijia0524/archive/2014/05/26/89572.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 26 May 2014 07:02:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/05/26/89572.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89572.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/05/26/89572.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89572.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89572.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 工具：Wireshark（Windows或Linux），tcpdump（Linux）要求：使用过滤器捕获特定分组；用脚本分析大量流量数据（建议用perl）。内容：Web流量分析&nbsp;清除本机DNS缓存（ipconfig /flushdns），访问某一网站主页，捕获访问过程中的所有分组，分析并回答下列问题：（1）简述访问web页面的过程。（2）找出DNS解析请求、应答相...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2014/05/26/89572.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/89572.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-05-26 15:02 <a href="http://www.cnitblog.com/xijia0524/archive/2014/05/26/89572.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】Wireshark和TcpDump抓包分析心得</title><link>http://www.cnitblog.com/xijia0524/archive/2014/05/26/89571.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 26 May 2014 07:01:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/05/26/89571.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89571.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/05/26/89571.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89571.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89571.html</trackback:ping><description><![CDATA[<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">1. Wireshark与tcpdump介绍</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;Wireshark是一个网络协议检测工具，支持Windows平台和Unix平台，我一般只在Windows平台下使用Wireshark，如果是Linux的话，我直接用tcpdump了，因为我工作环境中的Linux一般只有字符界面，且一般而言Linux都自带的tcpdump，或者用tcpdump抓包以后用Wireshark打开分析。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在Windows平台下，Wireshark通过WinPcap进行抓包，封装的很好，使用起来很方便，可以很容易的制定抓包过滤器或者显示过滤器，具体在下面介绍。Wireshark是一个免费的工具，只要google一下就能很容易找到下载的地方。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">tcpdump是基于Unix系统的命令行式的数据包嗅探工具。如果要使用tcpdump抓取其他主机MAC地址的数据包，必须开启网卡混杂模式，所谓混杂模式，用最简单的语言就是让网卡抓取任何经过它的数据包，不管这个数据包是不是发给它或者是它发出的，点击【<a style="color: rgb(51,102,153); text-decoration: none" href="http://en.wikipedia.org/wiki/Promiscuous_mode">http://en.wikipedia.org/wiki/Promiscuous_mode</a>】获取更多有关混杂模式的资料。一般而言，Unix不会让普通用户设置混杂模式，因为这样可以看到别人的信息，比如telnet的用户名和密码，这样会引起一些安全上的问题，所以只有root用户可以开启混杂模式，开启混杂模式的命令是：ifconfig eth0 promisc, eth0是你要打开混杂模式的网卡。肯定有人要问如果在windows下要不要打开混杂模式，windows下网卡没有什么混杂模式不混杂模式，在于应用程序本身，如使用Wireshark抓包的时候可以通过设置为在混杂模式下抓包（这就是为什么该死的ARP欺骗病毒可以猖狂的原因）。tcpdump当然也可以指定抓包过滤器，而且其过滤器语言非常著名，叫做Berkeley包过滤，简称BPF语言。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">2.&nbsp;简单的例子</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我们通过访问<a style="color: rgb(51,102,153); text-decoration: none" href="http://www.google.com.hk/">www.google.com.hk</a>这个网址来看看抓包结果。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">2.1&nbsp;&nbsp;tcpdump</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">前面说过一般情况下Linux都自带了tcpdump，但是如果发生了小概率事件，发现没有tcpdump的话，可以到<a style="color: rgb(51,102,153); text-decoration: none" href="http://www.tcpdump.org/">http://www.tcpdump.org</a>下载源代码，编译安装。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">使用root用户登录，运行tcpdump命令就可以开始抓包。这里说明一下，如果使用SSH登录到远程Linux，然后直接运行tcpdump，会发现抓到大量的数据包，速度快的都看不清楚，这是因为tcpdump抓到的包发送给远程的终端显示，同时又抓了这个包，再显示，再抓取，造成了循环抓取。当然，这样抓包没有任何意义，除了证明你的网络是通的。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">因为没有打开网卡的混杂模式，所以如果本机没有任何进程访问网络，是抓不到包的，如果在字符界面下，用wget<a style="color: rgb(51,102,153); text-decoration: none" href="http://www.google.com.hk/">http://www.google.com.hk</a>&nbsp;访问网址，如果有GUI，可以打开firefox浏览器访问<a style="color: rgb(51,102,153); text-decoration: none" href="http://www.google.com.hk/">http://www.google.com.hk</a>。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">默认情况下，tcpdump会选择第一块网卡，也就是eth0，进行抓包，每行显示一个抓取的数据包，如：</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">0.003183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;192.168.21.137&nbsp;&nbsp;72.14.203.147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;38039 &gt; http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 SACK_PERM=1 TSV=36941509 TSER=0 WS=6</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">0.011707&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;72.14.203.147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;192.168.21.137&nbsp;&nbsp;TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http &gt; 38039 [SYN, ACK] Seq=0 Ack=1 Win=64240 Len=0 MSS=1460</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">0.011770&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;192.168.21.137&nbsp;&nbsp;72.14.203.147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TCP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;38039 &gt; http [ACK] Seq=1 Ack=1 Win=5840 Len=0</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">以上三个数据包就是著名的TCP三次握手的数据包，其中38039是客户端的TCP端口，http的默认端口是80，如果tcpdump在/etc/services中发现端口对应的服务名称，那么会自动的转为名字，所以这里会显示为http。表示客户端的38039端口和服务器端的http端口进行TCP三次握手。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">前面提到tcpdump默认选择第一块网卡进行抓包，我们可以使用-i参数指定通过哪一个网卡抓包，如（#表示我输入的命令，Linux下root用户的提示符就是#）：</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># tcpdump &#8211;i eth1</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">或者</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">#tcpdump &#8211;i any</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">如果想知道我们可以通过哪几个网卡抓包，可以使用-D参数，如：</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"># tcpdump &#8211;D</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">1.eth0</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">2.any</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">3.lo</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">因为我的机器上只有一个网卡，因此只有eth0，如果有多块网卡活动的话，会有eth1，eth2依次下去。any的意思是通过任意一块网卡进行抓包，lo是回环接口。（关于TCP三次握手和回环接口等网络问题，请参考《TCP/IP协议详解》）。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">默认情况下，tcpdump抓包结果显示在屏幕（严格点，专业点应该说是标准输出）上，显然这不利于进一步的数据分析，因此我们需要将抓包结果存放在文件中。可是使用-w命令将结果保存在文件中，如：</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">#tcpdump &#8211;w google.cap</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">这句命令将抓包结果存放在google.cap文件中，结束以后可以用Wireshark打开查看。同事，tcpdump出了抓包，还可以使用-r参数制定抓包数据文件，结合过滤器对抓包数据分析，如：</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">#tcpdump &#8211;r google.cap http</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">这句命令的意思是让tcpdump读取google.cap文件，把其中http协议的数据包都给过滤出来。关于过滤器在下面详细介绍。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">2.2&nbsp;&nbsp;Wireshark</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我在windows系统中使用Wireshark的，首先熟悉一下界面，图1是使用Wireshark打开google.cap文件的界面，</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_1292328766j23l.gif" width="600" height="429" /></p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图1&nbsp;&nbsp;&nbsp;Wireshark界面</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">图1中标注出三快区域，R1区域用来显示简单的数据包信息，我们用tcpdump抓包的时候，默认情况下也是显示成这样的；R2区域用来显示选中的数据包的详细信息，细心一点会发现他是按照TCP/IP四层结构显示的，第一行是数据链路层的信息，第二行是网络层信息（IP协议），第三行是传输层信息（TCP协议），第四行是应用层信息（HTTP协议），可以展开每一行用来观察具体的内容；R3区域是用来显示此数据包的真实面目。我们在R1和R2区域看到的信息都是Wireshark整理以后给我们看的，抓包的真实数据实际上是一堆二进制序列，用ultraedit打开google.cap文件可以看到就是一些数字，如图2所示。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_12923288875Lvb.gif" width="446" height="175" /></p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图2&nbsp;&nbsp;抓包文件长的样子</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">使用Wireshark抓包非常容易，直接点击按钮<img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_1292328956uQUE.gif" width="22" height="22" />（工具栏第三个按钮）<img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_1292328988L8kk.gif" width="20" height="18" />（工具栏第一个按钮）就开始抓包了，会发现只要一点击这个按钮，立刻就显示抓到包了，这是因为Wireshark默认在混杂模式下抓包，只要经过网卡的数据包都抓取下来（当然这台机器要连在网络中，如果没有数据流过当然没有包可抓），点击按钮<img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_1292329027Q6t8.gif" width="23" height="25" />停止此次抓包。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">如果机器上安装了多块网卡，Wireshark默认选择第一张网卡抓包，如果等抓包完成了，这是发现选错了网卡是一件极度郁闷的事情。点击按钮可以在抓包之前选择抓哪张网卡。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_1292329083Gn6e.gif" width="700" height="205" /></p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图3&nbsp;&nbsp;选择网卡</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我机器上只有一张网卡，另外两个是安装Vmware时的虚拟网卡，可以看到虽然Packets上面已经有数据了，实际上需要点击Start才开始抓包。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">解决了选择网卡的问题以后，考虑如果过滤抓包内容，点击菜单栏上的&#8221; Capture&#8221; &gt; &#8220;Options&#8221;可以看到制定抓包规则的界面，如图4所示。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center"><img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://hi.csdn.net/attachment/201012/14/0_129232912319i1.gif" width="636" height="650" /></p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="center">图4&nbsp;&nbsp;制定抓包规则</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">图4可以看到Caputre packets in promiscuous mode，默认是选中的，表示Wireshark默认在混杂模式下抓包。同样可以选择通过哪张网卡抓包，不过这些都不是重点，最重要的是Caupture Fileter这里，点击该按钮，可以看到弹出一些预定义好的过滤器。比如选择&#8220;HTTP TCP port(80)&#8221;，下面Filter string: tcp port http就是过滤器的表示。表示抓tcp协议的，端口为80的数据包（http协议的默认端口是80）。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">3.&nbsp;过滤器（BPF语言）的使用</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主要介绍一下在tcpdump中的过滤器使用，因为懂了这个就可以得心应手的使用wireshark了。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从最简单的开始，BPF语言主要有一个标志或者数字和限定词组成，限定词有三种：</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;第一种：指定类型</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host,&nbsp;定义抓取哪个IP地址（也可以给它mac地址，格式是00:00:00:00:00:00）的数据包，比如我想抓有关192.168.0.148这个IP地址的数据包，那么就写成tcpdump host 192.168.0.148, host是限定词，192.168.0.148就是标志。这条命令会抓取从<a style="color: rgb(51,102,153); text-decoration: none" name="OLE_LINK2"></a><a style="color: rgb(51,102,153); text-decoration: none" name="OLE_LINK1"></a>发出或者向192.168.0.148发送的数据包。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;net,&nbsp;定义抓取某个网络的数据包，给出网络号就行了，它根据给的网络号字节数是1,2,3来判断A类地址，B类地址或者C类地址，比如tcpdump net 10.1.1&nbsp;，它就认为这是一个C类地址。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">port，指定端口，比如tcpdump host&nbsp;<a style="color: rgb(51,102,153); text-decoration: none" name="OLE_LINK4"></a><a style="color: rgb(51,102,153); text-decoration: none" name="OLE_LINK3"></a>and port 22,&nbsp;这是抓端口为22的数据包，不管是TCP还是UDP的，这里我稍微早一点的给出了逻辑操作，and&nbsp;<span>J</span>，如果只想抓TCP的，那么可以写tcpdump host 192.168.0.148 and tcp port 22。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">portrange，顾名思义，这个是指定端口范围的，用连字符&#8221;-&#8221;指定范围，比如tcpdump port 1025-8080</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; 第二种：指定方向</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我们之前的命令都是说&#8220;这条命令会抓取从192.168.0.148发出或者向192.168.0.148发送&#8221;，所以，如果指向抓从<a style="color: rgb(51,102,153); text-decoration: none" name="OLE_LINK6"></a><a style="color: rgb(51,102,153); text-decoration: none" name="OLE_LINK5"></a>发出的数据包可以使用限定词src,&nbsp;命令：tcpdump src host 192.168.0.148，反过来，想抓发向192.168.0.148的数据包，使用限定词dst,命令：tcpdump dst host 192.168.0.148。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;第三种：指定协议</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我们知道网络协议有N种。。。我列一下常用的几种，其他的可以去google一下<span>J</span></p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">ether和fddi,&nbsp;以太网协议</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">tr, TR协议</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">ip, IP协议</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">ip6，&nbsp;IPv6协议</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">arp,&nbsp;&nbsp;ARP协议</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好了，最后还需要注意的是逻辑运算，and, or, not（与，或，非），上面已经有一个例子了，&nbsp;这里就不再罗嗦了，和普通的编程语言没有什么不同。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">除此之外，还有更加牛X的功能，比如指定TCP中的某个标识位是什么，这种应用我一般很少用，不再罗嗦了。</p>
<p style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89571.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-05-26 15:01 <a href="http://www.cnitblog.com/xijia0524/archive/2014/05/26/89571.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】教你从redhat官网获取ISO镜像</title><link>http://www.cnitblog.com/xijia0524/archive/2014/05/07/89534.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 07 May 2014 02:20:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/05/07/89534.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89534.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/05/07/89534.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89534.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89534.html</trackback:ping><description><![CDATA[<span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; float: none; color: rgb(44,44,44); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">教你从redhat官网获取ISO镜像</span> 
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">笔者 ：李晓辉</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">RHEL,即Red Hat Enterprise Linux的缩写，是Red Hat公司的Linux系统。该系列有三个版本：Red Hat Enterprise Linux (Server including virtualization)，Red Hat Enterprise Linux Virtualization Platform。</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">不同于私有的软件, 开放来源的软件有公开可利用的原始代码, 可被最小之物复制, 修改和分销。该网站, REDHAT, 是关于开放来源软件的主导网上信息和新闻来源和最大的开放来源软件用户和开发商的网上小区之一。当然了，上面也有我们需要的ISO镜像，我们可以用来安装服务器，下载也有一定的技巧性，今天我们就来说一下。因为很多用户都不知道怎么下载，看完我这篇后，大家都应该能自由下载的，哈哈。</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">首先，打开官方网站<a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://cn.redhat.com/" target='\"_blank\"'>http://cn.redhat.com/#</a>,我们能看到右上角有登录我了之后有注册，我们要先有账户才行的</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192437SuOY.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image002 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image002 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192437jN5z.jpg" height=161 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?550?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">填写我们的用户信息，要选好是公司还是个人</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192438WsdO.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image004 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image004 src="http://img1.51cto.com/attachment/201209/21/4042188_13481924388SEk.jpg" height=400 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?534?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">然后往下拉，最后点提交</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192438sd1j.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image006 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image006 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192439JOPw.jpg" height=400 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?439?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">当然了，这些寻常的注册过程大家可能已经熟悉的不能再熟悉了，下一个页面是让我们同意一下协议，我们点同意即可，然后我们点继续</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192440p17T.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image008 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image008 src="http://img1.51cto.com/attachment/201209/21/4042188_13481924400oFI.jpg" height=324 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?557?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，现在我们填写的邮箱中应该可以收到一份邮件了</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">打开看看，我们点那个链接，验证我们的地址</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192443Z29b.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image010 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image010 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192444ibjS.jpg" height=326 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?550?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，点了之后我们就看到以下画面，确认完成</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_134819244442Bz.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image012 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image012 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192444pkKe.jpg" height=278 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?558?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">回到首页，我们在登录那里输入我们的信息，然后登录，或直接https://access.redhat.com/downloads</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192445BkeW.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image014 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image014 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192445MTv7.jpg" height=161 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?554?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">登录完后我们点&#8220;产品&#8221;，然后我们选服务器</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192445aJqI.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image016 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image016 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192446BF4j.jpg" height=275 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?546?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，现在我们可以点&#8220;下载&#8221;</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192446Mxsz.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image018 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image018 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192446Gyt2.jpg" height=303 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?551?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，现在我们来下一个rhel</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192447SZ5e.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image020 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image020 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192447JlXV.jpg" height=316 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?555?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，这是点进去的界面，什么都没有，我们点那个查看完整列表</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192447qD0y.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image022 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image022 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192448v5An.jpg" height=292 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?556?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">列表中我们没有看到想要的，只有老掉牙的ISO</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192448UqEw.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image024 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image024 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192448tBxG.jpg" height=400 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?464?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">现在我们不能下任何软件吧，我们去申请一下，我们在下图中点30天评估，我问过红帽了，这个没有任何限制，和购买得到的是一样的，只不过没有服务和更新</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192449NOzX.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image026 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image026 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192449JFDt.jpg" height=351 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?558?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，现在我们可以点那个链接了，如下图</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192450zq5j.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image028 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image028 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192450qQpV.jpg" height=340 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?552?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我了个去，不能用QQ邮箱，必须有个商业的，那我换一个，你们注意一下就行，不要用QQ的</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192451QMY1.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image030 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image030 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192451yVWP.jpg" height=193 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?550?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，现在我们回来，你们应该直接出现的就是下图，选好之后我们点subnet</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_13481924515lcm.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image032 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image032 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192452Giss.jpg" height=383 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?552?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">然后我们同意协议</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_13481924529kFe.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image034 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image034 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192452U5gg.jpg" height=333 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?551?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好找，我们申请成功了，如下图所示</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192453fEXk.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image036 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image036 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192453hiJX.jpg" height=267 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?550?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">这个时候你的邮箱会收到另一份邮件，看看就行，不用管</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192453qoA6.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image038 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image038 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192454htne.jpg" height=310 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?551?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，我们下面这个页面上点这个下载链接</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_13481924542bKf.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image040 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image040 src="http://img1.51cto.com/attachment/201209/21/4042188_13481924558vYr.jpg" height=367 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?555?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">如下图，看rhel 5、rhel 6都出来了吧，我们要下最新的rhel 6.3的64位，那我们就点第二个</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_13481924556jS8.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image042 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image042 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192456KAQV.jpg" height=400 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?425?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">好的，现在我们点<a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" name="OLE_LINK2" target='\"_blank\"'></a><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" name="OLE_LINK1" target='\"_blank\"'>Binary DVD</a>，下载光盘即可，boot.iso是启动盘，p2v是将物理机转成虚拟机的工具，下面还有源ISO ，我不需要，我只要光盘，那我点Binary DVD</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192456hgli.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image044 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image044 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192457gfSh.jpg" height=400 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?527?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">看，已经开始了吧</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192457IUWu.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image046 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image046 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192457d3UH.jpg" height=261 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?412?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">看任务属性，是从官方下的吧</div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://img1.51cto.com/attachment/201209/21/4042188_1348192458HH8j.jpg" target='\"_blank\"'><img onblur="" style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; vertical-align: top; border-top: 0px; border-right: 0px; padding-top: 0px" onkeydown="" onabort="" onmouseup="" onerror="" onload="if(this.width>650) this.width=650;" onresize="" onfocus="" onmouseover="" onmousemove="" title=clip_image048 ondblclick="" onkeypress="" onkeyup="" onmouseout="" onmousedown="" onclick="" border=0 alt=clip_image048 src="http://img1.51cto.com/attachment/201209/21/4042188_1348192458S1c3.jpg" height=400 onchange="" onunload="" onsubmit="" onselect="" onreset="" ?379?=""></a></div>
<div style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; color: rgb(44,44,44); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">完美成功，祝大家成功。不成功的留言<a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" name="_GoBack" target='\"_blank\"'></a></div>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/28px 宋体, 'Arial Narrow', arial, serif; white-space: normal; orphans: 2; height: auto; color: rgb(44,44,44); clear: both; overflow: hidden; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">本文出自 &#8220;<a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://ucweb.blog.51cto.com/">阳光&#9734;奋进</a>&#8221; 博客，请务必保留此出处<a style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(104,39,2); text-decoration: none; padding-top: 0px" href="http://ucweb.blog.51cto.com/4042188/1001505">http://ucweb.blog.51cto.com/4042188/1001505</a></p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89534.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-05-07 10:20 <a href="http://www.cnitblog.com/xijia0524/archive/2014/05/07/89534.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】常见HTTP状态（304，200等）</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89531.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 30 Apr 2014 09:38:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89531.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89531.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89531.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89531.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89531.html</trackback:ping><description><![CDATA[<p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 2em; margin: 0px 0px 5px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px simsun; word-wrap: normal; white-space: normal; orphans: 2; color: rgb(70,70,70); word-break: normal; border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在网站建设的实际应用中，容易出现很多小小的失误，就像mysql当初优化不到位，影响整体网站的浏览效果一样，其实，网站的常规http状态码的表现也是一样，<a style="color: rgb(64,96,116); text-decoration: none" href="http://www.linwan.net.cn/archives/2794.html" target="_blank">Google无法验证网站几种解决办法</a>，提及到由于404状态页面设置不正常，导致了<span style="line-height: 21px; word-wrap: normal; word-break: normal"><a style="color: rgb(64,96,116); text-decoration: none" title="google" href="http://www.gosoa.com.cn/category/google">google</a></span>管理员工具无法验证的情况，当然，影响的不仅仅是这一方面，影响的更是网站的整体浏览效果。因此，比较清楚详细的了解http状态码的具体含义，对于一个网站站长来说，这是很有必要俱备的网站制作基础条件。</p>
<div style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 2em; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">如果某项请求发送到您的服务器要求显示您网站上的某个网页（例如，用户通过浏览器访问您的网页或 Googlebot 抓取网页时），服务器将会返回 HTTP 状态码响应请求。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">此状态码提供关于请求状态的信息，告诉 Googlebot 关于您的网站和请求的网页的信息。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">一些常见的状态码为：</p>
<ul style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; list-style-type: none; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px"><li style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; list-style-type: disc; margin: 0px 0px 0px 30px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px"><strong>200</strong><span class="Apple-converted-space">&nbsp;</span>&#8211; 服务器成功返回网页</li><li style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; list-style-type: disc; margin: 0px 0px 0px 30px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px"><strong>404</strong><span class="Apple-converted-space">&nbsp;</span>&#8211; 请求的网页不存在</li><li style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; list-style-type: disc; margin: 0px 0px 0px 30px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px"><strong>503</strong><span class="Apple-converted-space">&nbsp;</span>&#8211; 服务器超时</li></ul>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">下面提供 HTTP 状态码的完整列表。点击链接可了解详情。您也可以访问<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(64,96,116); text-decoration: none" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"><font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#0000cc">HTTP 状态码上的 W3C 页获取更多信息</font></a>。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px"><strong style="font-weight: bold">1xx</strong><strong style="font-weight: bold">（临时响应）</strong><br />表示临时响应并需要请求者继续执行操作的状态码。</p>
<table style="padding-bottom: 0px; line-height: normal; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">100（继续）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求者应当继续提出请求。服务器返回此代码表示已收到请求的第一部分，正在等待其余部分。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">101（切换协议）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求者已要求服务器切换协议，服务器已确认并准备切换。</td></tr></tbody></table>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px"><strong style="font-weight: bold">2xx</strong><span class="Apple-converted-space">&nbsp;</span><strong style="font-weight: bold">（成功）</strong></p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">表示成功处理了请求的状态码。</p>
<table style="padding-bottom: 0px; line-height: normal; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; font-weight: bold; padding-top: 0px">200（成功）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; font-weight: bold; padding-top: 0px">服务器已成功处理了请求。通常，这表示服务器提供了请求的网页。如果是对您的 robots.txt 文件显示此状态码，则表示 Googlebot 已成功检索到该文件。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">201（已创建）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求成功并且服务器创建了新的资源。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">202（已接受）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器已接受请求，但尚未处理。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">203（非授权信息）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器已成功处理了请求，但返回的信息可能来自另一来源。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">204（无内容）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器成功处理了请求，但没有返回任何内容。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">205（重置内容）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器成功处理了请求，但没有返回任何内容。与 204 响应不同，此响应要求请求者重置文档视图（例如，清除表单内容以输入新内容）。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">206（部分内容）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器成功处理了部分 GET 请求。</td></tr></tbody></table>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px"><strong style="font-weight: bold">3xx</strong><span class="Apple-converted-space">&nbsp;</span><strong style="font-weight: bold">（重定向）</strong><br />要完成请求，需要进一步操作。通常，这些状态码用来重定向。Google 建议您在每次请求中使用重定向不要超过 5 次。您可以使用网站管理员工具查看一下 Googlebot 在抓取重定向网页时是否遇到问题。<strong style="font-weight: bold">诊断</strong>下的<a style="color: rgb(64,96,116); text-decoration: none" href="http://www.google.cn/support/webmasters/bin/answer.py?answer=35156"><font style="line-height: 21px; word-wrap: normal; word-break: normal" color="#0000cc">网络抓取</font></a>页列出了由于重定向错误导致 Googlebot 无法抓取的网址。</p>
<table style="padding-bottom: 0px; line-height: normal; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">300（多种选择）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">针对请求，服务器可执行多种操作。服务器可根据请求者 (user agent) 选择一项操作，或提供操作列表供请求者选择。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">301（永久移动）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求的网页已永久移动到新位置。服务器返回此响应（对 GET 或 HEAD 请求的响应）时，会自动将请求者转到新位置。您应使用此代码告诉 Googlebot 某个网页或网站已永久移动到新位置。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">302（临时移动）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 GET 和 HEAD 请求的 301 代码类似，会自动将请求者转到不同的位置，但您不应使用此代码来告诉 Googlebot 某个网页或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">303（查看其他位置）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求者应当对不同的位置使用单独的 GET 请求来检索响应时，服务器返回此代码。对于除 HEAD 之外的所有请求，服务器会自动转到其他位置。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; font-weight: bold; padding-top: 0px">304（未修改）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 17px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; font-weight: bold; border-right: 0px; padding-top: 0px">自从上次请求后，请求的网页未修改过。服务器返回此响应时，不会返回网页内容。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 17px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; font-weight: bold; border-right: 0px; padding-top: 0px">如果网页自请求者上次请求后再也没有更改过，您应将服务器配置为返回此响应（称为 If-Modified-Since HTTP 标头）。服务器可以告诉 Googlebot 自从上次抓取后网页没有变更，进而节省带宽和开销。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 17px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px"><br /></p></td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">305（使用代理）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求者只能使用代理访问请求的网页。如果服务器返回此响应，还表示请求者应使用代理。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">307（临时重定向）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器目前从不同位置的网页响应请求，但请求者应继续使用原有位置来响应以后的请求。此代码与响应 GET 和 HEAD 请求的 &lt;a href=answer.py?answer=&gt;301&lt;/a&gt; 代码类似，会自动将请求者转到不同的位置，但您不应使用此代码来告诉 Googlebot 某个页面或网站已经移动，因为 Googlebot 会继续抓取原有位置并编制索引。</td></tr></tbody></table>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px"><strong style="font-weight: bold">4xx（请求错误）</strong><br />这些状态码表示请求可能出错，妨碍了服务器的处理。</p>
<table style="padding-bottom: 0px; line-height: normal; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">400（错误请求）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器不理解请求的语法。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">401（未授权）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求要求身份验证。对于登录后请求的网页，服务器可能返回此响应。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">403（禁止）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器拒绝请求。如果您在 Googlebot 尝试抓取您网站上的有效网页时看到此状态码（您可以在 Google 网站管理员工具<strong style="font-weight: bold">诊断</strong>下的<strong style="font-weight: bold">网络抓取</strong>页面上看到此信息），可能是您的服务器或主机拒绝了 Googlebot 访问。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">404（未找到）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 17px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">服务器找不到请求的网页。例如，对于服务器上不存在的网页经常会返回此代码。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 17px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">如果您的网站上没有 robots.txt 文件，而您在 Google 网站管理员工具<a style="color: rgb(64,96,116); text-decoration: none" href="http://www.google.cn/support/webmasters/bin/answer.py?answer=35237"><font style="line-height: 17px; word-wrap: normal; word-break: normal" color="#0000cc">&#8220;诊断&#8221;标签的 robots.txt 页</font></a>上看到此状态码，则这是正确的状态码。但是，如果您有 robots.txt 文件而又看到此状态码，则说明您的 robots.txt 文件可能命名错误或位于错误的位置（该文件应当位于顶级域，名为 robots.txt）。</p>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 17px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px">如果对于 Googlebot 抓取的网址看到此状态码（在&#8221;诊断&#8221;标签的<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(64,96,116); text-decoration: none" href="http://www.google.cn/support/webmasters/bin/answer.py?answer=35122"><font style="line-height: 17px; word-wrap: normal; word-break: normal" color="#0000cc">HTTP 错误页面</font></a>上），则表示 Googlebot 跟随的可能是另一个页面的无效链接（是旧链接或输入有误的链接）。</p></td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">405（方法禁用）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">禁用请求中指定的方法。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">406（不接受）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">无法使用请求的内容特性响应请求的网页。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">407（需要代理授权）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">此状态码与 &lt;a href=answer.py?answer=35128&gt;401（未授权）&lt;/a&gt;类似，但指定请求者应当授权使用代理。如果服务器返回此响应，还表示请求者应当使用代理。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">408（请求超时）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器等候请求时发生超时。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">409（冲突）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器在完成请求时发生冲突。服务器必须在响应中包含有关冲突的信息。服务器在响应与前一个请求相冲突的 PUT 请求时可能会返回此代码，以及两个请求的差异列表。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">410（已删除）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">如果请求的资源已永久删除，服务器就会返回此响应。该代码与 404（未找到）代码类似，但在资源以前存在而现在不存在的情况下，有时会用来替代 404 代码。如果资源已永久移动，您应使用 301 指定资源的新位置。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">411（需要有效长度）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器不接受不含有效内容长度标头字段的请求。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">412（未满足前提条件）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器未满足请求者在请求中设置的其中一个前提条件。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">413（请求实体过大）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器无法处理请求，因为请求实体过大，超出服务器的处理能力。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">414（请求的 URI 过长）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求的 URI（通常为网址）过长，服务器无法处理。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">415（不支持的媒体类型）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">请求的格式不受请求页面的支持。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">416（请求范围不符合要求）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">如果页面无法提供请求的范围，则服务器会返回此状态码。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">417（未满足期望值）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器未满足&#8221;期望&#8221;请求标头字段的要求。</td></tr></tbody></table>
<p style="border-bottom: 0px; border-left: 0px; padding-bottom: 0px; line-height: 21px; list-style-type: none; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; word-wrap: normal; word-break: normal; border-top: 0px; border-right: 0px; padding-top: 0px"><strong style="font-weight: bold">5xx</strong><strong style="font-weight: bold">（服务器错误）</strong><br />这些状态码表示服务器在处理请求时发生内部错误。这些错误可能是服务器本身的错误，而不是请求出错。</p>
<table style="padding-bottom: 0px; line-height: normal; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">500（服务器内部错误）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器遇到错误，无法完成请求。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">501（尚未实施）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器不具备完成请求的功能。例如，服务器无法识别请求方法时可能会返回此代码。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">502（错误网关）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器作为网关或代理，从上游服务器收到无效响应。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">503（服务不可用）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器目前无法使用（由于超载或停机维护）。通常，这只是暂时状态。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">504（网关超时）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器作为网关或代理，但是没有及时从上游服务器收到请求。</td></tr>
<tr>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">505（HTTP 版本不受支持）</td>
<td style="padding-bottom: 0px; line-height: 17px; margin: 0px; padding-left: 0px; padding-right: 0px; font-family: Verdana, 宋体, sans-serif; font-size: 12px; padding-top: 0px">服务器不支持请求中所用的 HTTP 协议版本。</td></tr></tbody></table></div>
<p style="border-bottom: 0px; text-align: left; border-left: 0px; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 2em; margin: 0px 0px 5px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px simsun; word-wrap: normal; white-space: normal; orphans: 2; color: rgb(70,70,70); word-break: normal; border-top: 0px; border-right: 0px; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">上书大部分实际内容源自googel管理员博客近日文章所引用的<a style="color: rgb(64,96,116); text-decoration: none" href="http://www.google.cn/support/webmasters/bin/answer.py?answer=40132">有关301说明的有些链接</a>，感觉非常有用，因此收藏注释，以备以后警戒注意学习。合理利用这些状态码，避免错误利用，必将会为你的网站带来更佳的浏览者体会，得到更加亲和的搜索引擎收录，得到更准确的搜索引擎切入，从而，为你的网站发展，奠定坚实的发展基础。</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89531.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-30 17:38 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/30/89531.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】HTTP协议 (六) 状态码详解</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89530.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 30 Apr 2014 09:35:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89530.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89530.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89530.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89530.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89530.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: HTTP状态码，我都是现查现用。 我以前记得几个常用的状态码，比如200，302，304，404， 503。 一般来说我也只需要了解这些常用的状态码就可以了。&nbsp; 如果是做AJAX，REST,网络爬虫，机器人等程序。还是需要了解其他状态码。&nbsp; 本文我花了一个多月的时间把所有的状态码都总结了下，内容太多，看的时候麻烦耐心点了。HTTP状态码的学习资料到处都有，但是都是理论上讲解...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2014/04/30/89530.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/89530.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-30 17:35 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/30/89530.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】软件测试面试 (一) 如何测试一个杯子</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89529.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 30 Apr 2014 09:33:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89529.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89529.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89529.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89529.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89529.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在软件测试的面试中， 经常会碰到类似的问题。 比如：如何测试一个杯子， 或者如何测试一只笔。 要求你设计20个以上的test case.&nbsp;</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">这类的面试题目，是考察面试者是否熟悉各种软件测试方法， 设计test case的能力, 以及test sense。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">首先应该反问下面试官， 需求是什么样的，比如大概是个什么样的杯子。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我回答这类问题的思路, 从<span style="background-color: rgb(255,255,153)">软件测试的各种不同方法来联想</span>,&nbsp; 具体如下。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<h1 style="widows: 2; text-transform: none; background-color: rgb(165,165,165); font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="tank_h1">功能测试(Function test)</h1>
<ol style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; padding-left: 50px; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li style="list-style-type: decimal; margin-left: 10px">能否装水，</li><li style="list-style-type: decimal; margin-left: 10px">除了装水， 能否装其他液体。比如可乐，酒精</li><li style="list-style-type: decimal; margin-left: 10px">能装多少ML的水</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否有刻度表</li><li style="list-style-type: decimal; margin-left: 10px">杯子能否泡茶，跑咖啡</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否能放冰箱，做冰块</li><li style="list-style-type: decimal; margin-left: 10px">杯子的材质是什么（玻璃，塑料,黄金做的）</li></ol>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<h1 style="widows: 2; text-transform: none; background-color: rgb(165,165,165); font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="tank_h1">界面测试(UI Test)</h1>
<ol style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; padding-left: 50px; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li style="list-style-type: decimal; margin-left: 10px">外观好不好看。</li><li style="list-style-type: decimal; margin-left: 10px">什么颜色</li><li style="list-style-type: decimal; margin-left: 10px">杯子的形状是怎么样的。</li><li style="list-style-type: decimal; margin-left: 10px">杯子的重量是多少</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否有异味</li><li style="list-style-type: decimal; margin-left: 10px">杯子的图案是否合理</li></ol>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<h1 style="widows: 2; text-transform: none; background-color: rgb(165,165,165); font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="tank_h1">性能测试(performance test)</h1>
<ol style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; padding-left: 50px; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li style="list-style-type: decimal; margin-left: 10px">能否装100度的开水 (泡茶)</li><li style="list-style-type: decimal; margin-left: 10px">能否装0度冰水</li><li style="list-style-type: decimal; margin-left: 10px">装满水，放几天后，是否会漏水</li><li style="list-style-type: decimal; margin-left: 10px">杯子内壁上的涂料是否容易脱落。</li><li style="list-style-type: decimal; margin-left: 10px">杯子上的颜色是否容易褪色或者脱落</li><li style="list-style-type: decimal; margin-left: 10px">被我坦克压下，是否会碎 (这条是开玩笑的哈)</li></ol>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<h1 style="widows: 2; text-transform: none; background-color: rgb(165,165,165); font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="tank_h1">安全性测试(Security test)</h1>
<ol style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; padding-left: 50px; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li style="list-style-type: decimal; margin-left: 10px">制作杯子的材料，是否有毒</li><li style="list-style-type: decimal; margin-left: 10px">放微波炉里转的时候，是否会爆炸, 或者杯子是否会熔化。</li><li style="list-style-type: decimal; margin-left: 10px">从桌子上掉到水泥地上是否会摔碎。</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否容易长细菌</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否有缺口，会划坏嘴巴</li><li style="list-style-type: decimal; margin-left: 10px">杯子内壁上的材料，是否会溶解到水中</li><li style="list-style-type: decimal; margin-left: 10px">杯子破碎后，是否会对使用者造成伤害</li></ol>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<h1 style="widows: 2; text-transform: none; background-color: rgb(165,165,165); font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="tank_h1">可用性测试(Usability Test)</h1>
<ol style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; padding-left: 50px; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li style="list-style-type: decimal; margin-left: 10px">杯子是否容易烫手</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否好端，好拿</li><li style="list-style-type: decimal; margin-left: 10px">杯子的水是否容易喝到</li><li style="list-style-type: decimal; margin-left: 10px">杯子是否有防滑措施</li></ol>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<h1 style="widows: 2; text-transform: none; background-color: rgb(165,165,165); font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="tank_h1">总结</h1>
<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 10px auto; letter-spacing: normal; font: 14px/21px 'black Verdana', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">一不小心， 就写了30多个test case。 &nbsp; 下次碰到 &#8220;如何测试一台自动售货机&#8221; 这样的问题， 按照相同的思路， 也能容易的回答出来。</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89529.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-30 17:33 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/30/89529.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】HTTP工具：wget（for windows）</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89528.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 30 Apr 2014 09:16:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89528.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89528.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89528.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89528.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89528.html</trackback:ping><description><![CDATA[<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">【虎.无名】以前在Linux下用wget和curl等命令行工具很方便，想在windows下有没有类似工具。还真找到了，名字也一样是wget，只有一个exe执行文件。很容易完成下载、Auth、断点续传、网站镜像等功能。还有一个httpdebug.exe的gui工具，也很好用。<a style="color: rgb(63,167,203); text-decoration: underline" href="http://dupola.com/post/151"><br />http://dupola.com/post/151</a>&nbsp;&nbsp; 看过&#8220;<a style="color: rgb(63,167,203); text-decoration: underline" href="http://dupola.com/post/79" target="_balnk">如何在Win主机下运行DreamHost的SSH命令</a>&#8221;的朋友肯定记的其中的wget，不过那个是putty中集成的，用于在服务器间传输文件的工具，原来是linux系统中的一个下载工具。现在向大家介绍它的windows版。 先【下载<a style="color: rgb(63,167,203); text-decoration: underline" href="http://www.interlog.com/~tcharron/wgetwin-1_5_3_1-binary.zip" target="_blank">wget for windows</a>】，随便放在一个目录。然后在&#8220;运行&#8221;里运行cmd,然后进入那个wget.exe所在的目录，接着就可以了&#8230;&#8230;直接输入wget,提示wget &#8211;help，按照帮助，输入，显示好多参数，直接定位到-r参数，也就是递归下载。恩，就是这个，马上输入：wget -r<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(63,167,203); text-decoration: underline" href="http://www.live555.com/liveMedia/public/doxygen/" target="_blank">http://www.live555.com/liveMedia/public/doxygen/</a><span class="Apple-converted-space">&nbsp;</span>。剩下的就是它事情了，它会自动在wget.exe的目录下建立一个<a style="color: rgb(63,167,203); text-decoration: underline" href="http://www.live555.com/" target="_blank">www.live555.com</a><span class="Apple-converted-space">&nbsp;</span>目录，也按照服务器的目录建立子目录。</p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">它的其它一些参数如下（用法）[1]：用法: wget [选项]&#8230; [URL]&#8230;命令的引数使用长项目与短项目相同.<br /><strong>启动:</strong><br />-V, &#8211;version显示Wget的版本并且离开.<br />-h, &#8211;help显示这个说明档.<br />-b, -background在启动之後跳到背景去.<br />-e, -execute=COMMAND执行一个`.wgetrc&#8217;里面的COMMAND指令.<br /><strong>纪录档与输入的档案:</strong><br />-o, &#8211;output-file=FILE纪录讯息到FILE去.<br />-a, -append-output=FILE增加讯息到FILE去.<br />-d, &#8211;debug显示除错的输出.<br />-q, &#8211;quiet安静模式(不输入任何讯息).<br />-v, &#8211;verbose冗长模式(这是内定值).<br />-nv, &#8211;non-verbose关闭verboseness,但不是安静模式.<br />-i, &#8211;input-file=FILE从FILE读取URL .<br />-F, &#8211;force-html把输入的档案当作HTML.<br />下载:<br />-t, &#8211;tries=NUMBER设定重复尝试NUMBER次(0是无限制).<br />-O &#8211;output-document=FILE把文件写到FILE里.<br />-nc, &#8211;no-clobber不破坏已经存在的档案.<br />-c, &#8211;continue重新取得一个已经存在的档案.<br />&#8211;dot-style=STYLE设定取回状况的显示风格.<br />-N, &#8211;timestamping不取回比本地旧的档案.<br /><strong style="color: red">-S, &#8211;server-response显示伺服器回应状况.</strong><strong><br /></strong>&#8211;spider不下载任何东西.<br />-T, &#8211;timeout=SECONDS设定读取时超过的时间为SECONDS秒.<br />-w, &#8211;wait=SECONDS在取回档案时等待SECONDS秒.<br />-Y, &#8211;proxy=on/off开启或关闭Proxy.<br />-Q, &#8211;quota=NUMBER设定取回档案的定额限制为NUMBER个.<br />目录:<br />-nd &#8211;no-directories不建立目录.<br />-x, &#8211;force-directories强制进行目录建立的工作.<br />-nH, &#8211;no-host-directories不建立主机的目录.<br />-P, &#8211;directory-prefix=PREFIX把档案存到PREFIX/&#8230;<br />&#8211;cut-dirs=NUMBER忽略NUMBER个远端的目录元件.<br />HTTP选项:<br />&#8211;http-user=USER设http使用者为USER.<br />&#8211;http-passwd=PASS设http使用者的密码为PASS.<br />-C, &#8211;cache=on/off提供/关闭快取伺服器资料(正常情况为提供).<br />&#8211;ignore-length忽略`Content-Length&#8217;标头栏位.<br />&#8211;proxy-user=USER设USER为Proxy使用者名称.<br />&#8211;proxy-passwd=PASS设PASS为Proxy密码.<br />-s, &#8211;save-headers储存HTTP标头成为档案.<br />-U, &#8211;user-agent=AGENT使用AGENT取代Wget/VERSION作为识别代号.<br /><strong>FTP选项:</strong><br />&#8211;retr-symlinks取回FTP的象徵连结.<br />-g, &#8211;glob=on/off turn file name globbing on ot off.<br />&#8211;passive-ftp使用&#8221;passive&#8221;传输模式.<br /><strong>使用递回方式的取回:</strong><br />-r, &#8211;recursive像是吸入web的取回&#8211;请小心使用!.<br />-l, &#8211;level=NUMBER递回层次的最大值(0不限制).<br />&#8211;delete-after删除下载完毕的档案.<br />-k, &#8211;convert-links改变没有关连的连结成为有关连.<br />-m, &#8211;mirror开启适合用来映射的选项.<br />-nr, &#8211;dont-remove-listing不要移除`.listing&#8217;档.<br />递回式作业的允许与拒绝选项:<br />-A, &#8211;accept=LIST允许的扩充项目的列表.<br />-R, &#8211;reject=LIST拒绝的扩充项目的列表.<br />-D, &#8211;domains=LIST允许的网域列表.<br />&#8211;exclude-domains=LIST拒绝的网域列表(使用逗号来分隔).<br />-L, &#8211;relative只跟随关联连结前进.<br />&#8211;follow-ftp跟随HTML文件里面的FTP连结.<br />-H, &#8211;span-hosts当开始递回时便到外面的主机.<br />-I, &#8211;include-directories=LIST允许的目录列表.<br />-X, &#8211;exclude-directories=LIST排除的目录列表.<br />-nh, &#8211;no-host-lookup不透过DNS查寻主机.<br />-np, &#8211;no-parent不追朔到起源目录.</p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">[Ref.] [1]wget参数使用参考 [2]wget project<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(63,167,203); text-decoration: underline" href="http://www.gnu.org/software/wget/" target="_blank">http://www.gnu.org/software/wget/</a></p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">版权声明 ：作者：<a style="color: rgb(63,167,203); text-decoration: underline" href="http://dupola.com/">dupola</a><span class="Apple-converted-space">&nbsp;</span>原文标题：<a style="color: rgb(63,167,203); text-decoration: underline" title="肚破惊天:《推荐一款下载工具 wget for windows》" href="http://dupola.com/post/151" rel="bookmark" target="_blank">推荐一款下载工具 wget for windows</a><span class="Apple-converted-space">&nbsp;</span>原文链接：<a style="color: rgb(63,167,203); text-decoration: underline" title="肚破惊天:《推荐一款下载工具 wget for windows》" href="http://dupola.com/post/151" rel="bookmark" target="_blank">http://dupola.com/post/151</a><br />(C)<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(63,167,203); text-decoration: underline" title="肚破惊天" href="http://dupola.com/" target="_blank">dupola</a><span class="Apple-converted-space">&nbsp;</span>版权所有，转载时必须以链接形式注明作者和原始出处及本声明。</p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="color: rgb(63,167,203); text-decoration: underline" href="http://www.cnlei.org/blog/article.asp?id=169">http://www.cnlei.org/blog/article.asp?id=169</a><span class="Apple-converted-space">&nbsp;</span><strong>最初用的下载工具是Flashget、网络蚂蚁<br /></strong>之后就是Webzip、Offline Explorer 。今天，从同事那听说WGet，据说它的下载功能更强，就下载了个WGET for Windows (win32)，一经试用果然十分强悍啊！<br /><strong>WGET for Windows (win32)&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></strong>"GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without Xsupport, etc."<span class="Apple-converted-space">&nbsp;</span><br />上边是Wget官方的简介，<a style="color: rgb(63,167,203); text-decoration: underline" title="http://users.ugent.be/~bpuype/wget/" href="http://users.ugent.be/~bpuype/wget/" target="_blank"><span class="Apple-converted-space">&nbsp;</span>WGET for Windows</a>是Windows下的移植版，用这个可以方便地下载文件或备份网站（HTTP、HTTPS、FTP协议）。和Heiko Herold的版本不同的是：这个静态链接到OpenSSL，这样你只需要一个wget.exe就够了 。<br />断点续传：wget -c http://...<br />完全备份一个网站：wget -mrnp http://...</p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="color: rgb(63,167,203); text-decoration: underline" href="http://linuxtoy.org/archives/wget-tips.html">http://linuxtoy.org/archives/wget-tips.html</a><span class="Apple-converted-space">&nbsp;</span>wget 使用技巧</p>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><a style="color: rgb(63,167,203); text-decoration: underline" href="http://www.gnu.org/software/wget/">wget</a><span class="Apple-converted-space">&nbsp;</span>是一个命令行的下载工具。对于我们这些 Linux 用户来说，几乎每天都在使用它。下面为大家介绍几个有用的 wget 小技巧，可以让你更加高效而灵活的使用 wget。</p>
<ol style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><code>$ wget -r -np -nd http://example.com/packages/</code><span class="Apple-converted-space">&nbsp;</span>这条命令可以下载 http://example.com 网站上 packages 目录中的所有文件。其中，<code>-np</code><span class="Apple-converted-space">&nbsp;</span>的作用是不遍历父目录，<code>-nd</code><span class="Apple-converted-space">&nbsp;</span>表示不在本机重新创建目录结构。</li><li style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><code>$ wget -r -np -nd --accept=iso http://example.com/centos-5/i386/</code><span class="Apple-converted-space">&nbsp;</span>与上一条命令相似，但多加了一个<span class="Apple-converted-space">&nbsp;</span><code>--accept=iso</code><span class="Apple-converted-space">&nbsp;</span>选项，这指示 wget 仅下载 i386 目录中所有扩展名为 iso 的文件。你也可以指定多个扩展名，只需用逗号分隔即可。</li><li style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><code>$ wget -i filename.txt</code><span class="Apple-converted-space">&nbsp;</span>此命令常用于批量下载的情形，把所有需要下载文件的地址放到 filename.txt 中，然后 wget 就会自动为你下载所有文件了。</li><li style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><code>$ wget -c http://example.com/really-big-file.iso</code><span class="Apple-converted-space">&nbsp;</span>这里所指定的<span class="Apple-converted-space">&nbsp;</span><code>-c</code><span class="Apple-converted-space">&nbsp;</span>选项的作用为断点续传。</li><li style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><code>$ wget -m -k (-H) http://www.example.com/</code><span class="Apple-converted-space">&nbsp;</span>该命令可用来镜像一个网站，wget 将对链接进行转换。如果网站中的图像是放在另外的站点，那么可以使用<span class="Apple-converted-space">&nbsp;</span><code>-H</code><span class="Apple-converted-space">&nbsp;</span>选项。</li></ol>
<p style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; orphans: 2; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">对于上面的朋友说的在windows下不能用wget的问题，有一个比较好的解决方案。Ming Bai(<a style="color: rgb(63,167,203); text-decoration: underline" href="http://mbbill.googlepages.com/">http://mbbill.googlepages.com/</a>) 推荐了一个<span class="Apple-converted-space">&nbsp;</span><strong>unxutils</strong><span class="Apple-converted-space">&nbsp;</span>的windows工具包。里面包括了静态编译好的很多unix/Linux下面的工具(当然包括wget)。这个包的好处是体积非常小，而且不依赖任何动态连接库。感兴趣的朋友可以在如下地址下载到：<a style="color: rgb(63,167,203); text-decoration: underline" href="http://unxutils.sourceforge.net/">http://unxutils.sourceforge.net/</a></p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89528.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-30 17:16 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/30/89528.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】301跳转和302跳转 有什么区别 对性能有影响吗？</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89527.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 30 Apr 2014 07:59:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89527.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89527.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/30/89527.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89527.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89527.html</trackback:ping><description><![CDATA[<pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="recommend-content-1448200164" class="recommend-text mb-10" accuse="aContent">302跳转就网址重定向的一种，它区别于301跳转，301是网址永久重定向，302则是网址的临时定向。302转向或者302重定向（302 redirect）指的是当浏览器要求一个网页的时候，主机所返回的状态码。302状态码的意义是暂时转向到另外一个网址。</pre><br />
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">301转向：是当用户或搜索引擎向网站服务器发出浏览请求时，服务器返回的HTTP数据流中头信息(header)中的状态码的一种，表示本网页永久性转移到另一个地址。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">302重定向又称之为302代表暂时性转移(Temporarily Moved )， 也被认为是暂时重定向(temporary redirect)，一条对网站浏览器的指令来显示浏览器被要求显示的不同的URL，当一个网页经历过短期的URL的变化时使用。一个暂时重定向是一种服务器端的重定向，能够被搜索引擎蜘蛛正确地处理。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">301重定向与302重定向的区别在于302重定向是暂时的重定向，搜索引擎会抓取新的内容而保留旧的网址。因为服务器返回302代码，搜索引擎认为新的网址只是暂时的。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">301重定向是永久的重定向，搜索引擎在抓取新内容的同时也将旧的网址替换为重定向之后的网址。</p><br />
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">301的含义是&#8220;永久重定向&#8221;，而302的含义是&#8220;临时重定向&#8221;<br />301 代表永久性转移是网页更改地址后对搜索引擎友好的最好方法，只要不是暂时搬移的情况,都建议使用301来做转址。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">由于搜索引擎排名算法只是程序而不是人，在遇到302重定向的时候，并不能像人一样的去准确判定哪一个网址更适当，这就造成了网址URL劫持的可能性。也就是说，一个不道德的人在他自己的网址A做一个302重定向到你的网址B，出于某种原因， Google搜索结果所显示的仍然是网址A，但是所用的网页内容却是你的网址B上的内容，这种情况就叫做网址URL劫持。你辛辛苦苦所写的内容就这样被别人偷走了。<br /><br /><br /></p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">大家都已经对基本的301跳转和302跳转做了解释, 我从我的理解解答下。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">如果从便于搜索引擎友好的话当然是301最合适，一般情况下非特意临时性URL转移，都尽量用301跳转，这样的一个好处是搜索引擎会把该URL的PR值都带到跳转后的地址，而302跳转早期被很多网站当作作弊手段，已经被多数搜索引擎重点盯查。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">而性能方面原则上301跳转和302跳转没有多大差别，不过考虑到搜索引擎个案对待，也建议使用301跳转，301跳转搜索引擎是不对原地址进行访问的，而302跳转除了象<a style="outline-style: none; outline-color: invert; outline-width: medium; color: rgb(0,75,115); text-decoration: none" href="http://www.dewen.org/q/1233/301%E8%B7%B3%E8%BD%AC%E5%92%8C302%E8%B7%B3%E8%BD%AC+%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB+%E5%AF%B9%E6%80%A7%E8%83%BD%E6%9C%89%E5%BD%B1%E5%93%8D%E5%90%97%EF%BC%9F#ans2652">@张洪保</a>所讲可能被劫持之外，还有可能会加大对服务器的URL请求数量。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">搜索引擎对302跳转进行判断的时候，如果发现跳转目标页面URL更加复杂，就会返回来对原URL进行访问，寻取一个简单友好的地址，这样无形会加重服务器性能损耗，因此301跳转要比302跳转靠普也对服务器性能有保障。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br />&nbsp;</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">说法同<a style="outline-style: none; outline-color: invert; outline-width: medium; color: rgb(0,75,115); text-decoration: none" href="http://www.dewen.org/q/1233/301%E8%B7%B3%E8%BD%AC%E5%92%8C302%E8%B7%B3%E8%BD%AC+%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB+%E5%AF%B9%E6%80%A7%E8%83%BD%E6%9C%89%E5%BD%B1%E5%93%8D%E5%90%97%EF%BC%9F#ans2652">@张洪保</a><span class="Apple-converted-space">&nbsp;</span>以下是301和302状态码解释：</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">301 Moved Permanently</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">　　被请求的资源已永久移动到新位置，并且将来任何对此资源的引用都应该使用本响应返回的若干个 URI 之一。如果可能，拥有链接编辑功能的客户端应当自动把请求的地址修改为从服务器反馈回来的地址。除非额外指定，否则这个响应也是可缓存的。<br />　　新的永久性的 URI 应当在响应的 Location 域中返回。除非这是一个 HEAD 请求，否则响应的实体中应当包含指向新的 URI 的超链接及简短说明。<br />　　如果这不是一个 GET 或者 HEAD 请求，因此浏览器禁止自动进行重定向，除非得到用户的确认，因为请求的条件可能因此发生变化。<br />　　注意：对于某些使用 HTTP/1.0 协议的浏览器，当它们发送的 POST 请求得到了一个301响应的话，接下来的重定向请求将会变成 GET 方式。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">302 Found</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">　　请求的资源现在临时从不同的 URI 响应请求。由于这样的重定向是临时的，客户端应当继续向原有地址发送以后的请求。只有在Cache-Control或Expires中进行了指定的情况下，这个响应才是可缓存的。<br />　　新的临时性的 URI 应当在响应的 Location 域中返回。除非这是一个 HEAD 请求，否则响应的实体中应当包含指向新的 URI 的超链接及简短说明。<br />　　如果这不是一个 GET 或者 HEAD 请求，那么浏览器禁止自动进行重定向，除非得到用户的确认，因为请求的条件可能因此发生变化。<br />　　注意：虽然RFC 1945和RFC 2068规范不允许客户端在重定向时改变请求的方法，但是很多现存的浏览器将302响应视作为303响应，并且使用 GET 方式访问在 Location 中规定的 URI，而无视原先请求的方法。状态码303和307被添加了进来，用以明确服务器期待客户端进行何种反应。</p>
<p style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: none; text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/24px 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(51,51,51); border-top: medium none; border-right: medium none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br />&nbsp;</p><br /><br /> <img src ="http://www.cnitblog.com/xijia0524/aggbug/89527.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-30 15:59 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/30/89527.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】memcached命令行参数说明</title><link>http://www.cnitblog.com/xijia0524/archive/2014/03/24/89346.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 24 Mar 2014 07:42:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/03/24/89346.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89346.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/03/24/89346.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89346.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89346.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1、启动Memcache 常用参数-p &lt;num&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 设置TCP端口号(默认不设置为: 11211)-U &lt;num&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UDP监听端口(默认: 11211, 0 时关闭)&nbsp;-l &lt;ip_addr&gt;&nbsp; 绑定地址(默认:...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2014/03/24/89346.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/89346.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-03-24 15:42 <a href="http://www.cnitblog.com/xijia0524/archive/2014/03/24/89346.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】java JVM ： Xms Xmx PermSize MaxPermSize 区别</title><link>http://www.cnitblog.com/xijia0524/archive/2014/01/24/89237.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 24 Jan 2014 01:27:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/01/24/89237.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89237.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/01/24/89237.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89237.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89237.html</trackback:ping><description><![CDATA[<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;java JVM虚拟机选项： Xms Xmx PermSize MaxPermSize 区别 &nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Xms 是指设定程序启动时占用内存大小。一般来讲，大点，程序会启动的 快一点，但是也可能会导致机器暂时间变慢。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Xmx 是指设定程序运行期间最大可占用的内存大小。如果程序运行需要占 用更多的内存，超出了这个设置值，就会抛出OutOfMemory 异常。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Xss 是指设定每个线程的堆栈大小。这个就要依据你的程序，看一个线程 大约需要占用多少内存，可能会有多少线程同时运行等。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;以上三个参数的设置都是默认以Byte 为单位的，也可以在数字后面添加 [k/K]或者[m/M]来表示KB 或者MB。而且，超过机器本身的内存大小也是不可 以的，否则就等着机器变慢而不是程序变慢了。 因此，对于一般的java 应用程序来讲，我们只要把前两个参数设置合适基 本上就可以了。第三个参数还是需要有很强的 各应用程序的设置方法&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-Xmx1600m -XX:PermSize=64m -XX:MaxPermSize=256m&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-Xms40m -Xmx512m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">java JVM捏造机选项： Xms Xmx PermSize MaxPermSize 差别</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">java固然是主动采用内存，但是利用步伐，尤其办事器步伐最好根据业务环境指明内存分派限定。不然大概导致利用步伐宕失。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">举例阐明含义：</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-Xms128m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">表现JVM Heap(堆内存)最小尺寸128MB，初始分派</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-Xmx512m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">表现JVM Heap(堆内存)最大容许的尺寸256MB，按需分派。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">阐明：倘若-Xmx不指定大概指定偏小，利用大概会导致java.lang.OutOfMemory毛病，此毛病来自JVM不是Throwable的，无法用try...catch捕获。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">PermSize和MaxPermSize指明捏造机为java永世天生东西（Permanate generation）如，class东西、要领东西这些可反射（reflective）东西分派内存限定，这些内存不包含在Heap（堆内存）区之中。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-XX:PermSize=64MB 最小尺寸，初始分派</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-XX:MaxPermSize=256MB 最大容许分派尺寸，按需分派</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">过小会导致：java.lang.OutOfMemoryError: PermGen space</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">MaxPermSize缺省值和-server -client选项相干。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-server选项下默认MaxPermSize为64m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-client选项下默认MaxPermSize为32m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">经历：</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">1、慎用最小限定选项Xms,PermSize已节俭系统资源。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">修正捏造内存"%jboss_home%\bin\run.conf"</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">JAVA_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=512m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">java.lang.OutOfMemoryError 涌现时，有多种环境，比如:PermGen space ，Java heap space 。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/25px Helvetica, Tahoma, Arial, sans-serif; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">遇到的是java.lang.OutOfMemoryError: PermGen space ，是内存的永世保 存地区溢出了，永世生存地区是存放class信息和meta信息的，分派了后，jvm是不会往采用的。必须让jvm分派更多的permsize，才干办理这个标题。</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89237.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-01-24 09:27 <a href="http://www.cnitblog.com/xijia0524/archive/2014/01/24/89237.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】Xms Xmx PermSize MaxPermSize 区别</title><link>http://www.cnitblog.com/xijia0524/archive/2014/01/24/89236.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 24 Jan 2014 01:25:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/01/24/89236.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89236.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/01/24/89236.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89236.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89236.html</trackback:ping><description><![CDATA[<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Eclipse崩溃，错误提示：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />MyEclipse has detected that less than 5% of the 64MB of Perm&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />Gen (Non-heap memory) space remains. It is strongly recommended<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />that you exit and restart MyEclipse with new virtual machine memory<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />paramters to increase this memory.&nbsp;&nbsp; Failure to do so can result in<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />data loss. The recommended Eclipse memory parameters are:&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />eclipse.exe -vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />1.参数的含义<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: rgb(255,0,0); padding-top: 0px">-vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-vmargs 说明后面是VM的参数，所以后面的其实都是JVM的参数了<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xms128m JVM初始分配的堆内存<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xmx512m JVM最大允许分配的堆内存，按需分配<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:PermSize=64M JVM初始分配的非堆内存<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:MaxPermSize=128M JVM最大允许分配的非堆内存，按需分配</span></strong></p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我们首先了解一下JVM内存管理的机制，然后再解释每个参数代表的含义。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">1)堆(Heap)和非堆(Non-heap)内存</strong></p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;按照官方的说法：&#8220;Java 虚拟机具有一个堆，堆是运行时数据区域，所有类实例和数组的内存均从此处分配。堆是在 Java 虚拟机启动时创建的。&#8221;&#8220;在JVM中堆之外的内存称为非堆内存(Non-heap memory)&#8221;。<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;可以看出JVM主要管理两种类型的内存：堆和非堆。简单来说堆就是Java代码可及的内存，是留给开发人员使用的；非堆就是JVM留给自己用的，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;所以方法区、JVM内部处理或优化所需的内存(如JIT编译后的代码缓存)、每个类结构(如运行时常数池、字段和方法数据)以及方法和构造方法的代码都在非堆内存中。&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">堆内存分配</strong></p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;JVM初始分配的堆内存由-Xms指定，默认是物理内存的1/64；JVM最大分配的堆内存由-Xmx指定，默认是物理内存的1/4。默认空余堆内存小于40%时，JVM就会增大堆直到-Xmx的最大限制；<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;空余堆内存大于70%时，JVM会减少堆直到-Xms的最小限制。因此服务器一般设置-Xms、-Xmx 相等以避免在每次GC 后调整堆的大小。<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;说明：如果-Xmx 不指定或者指定偏小，应用可能会导致java.lang.OutOfMemory错误，此错误来自JVM，不是Throwable的，无法用try...catch捕捉。&nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">非堆内存分配</strong></p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;JVM使用-XX:PermSize设置非堆内存初始值，默认是物理内存的1/64；由XX:MaxPermSize设置最大非堆内存的大小，默认是物理内存的1/4。（还有一说：MaxPermSize缺省值和-server -client选项相关，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;-server选项下默认MaxPermSize为64m，-client选项下默认MaxPermSize为32m。这个我没有实验。）<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;上面错误信息中的PermGen space的全称是Permanent Generation space，是指内存的永久保存区域。还没有弄明白PermGen space是属于非堆内存，还是就是非堆内存，但至少是属于了。<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />XX:MaxPermSize设置过小会导致java.lang.OutOfMemoryError: PermGen space 就是内存益出。&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />说说为什么会内存益出：&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />（1）这一部分内存用于存放Class和Meta的信息，Class在被 Load的时候被放入PermGen space区域，它和存放Instance的Heap区域不同。&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />（2）GC(Garbage Collection)不会在主程序运行期对PermGen space进行清理，所以如果你的APP会LOAD很多CLASS 的话,就很可能出现PermGen space错误。<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp; 这种错误常见在web服务器对JSP进行pre compile的时候。 &nbsp;</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" /><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px">2)JVM内存限制(最大值)</strong></p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;首先JVM内存限制于实际的最大物理内存，假设物理内存无限大的话，JVM内存的最大值跟操作系统有很大的关系。简单的说就32位处理器虽然可控内存空间有4GB,但是具体的操作系统会给一个限制，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;这个限制一般是2GB-3GB（一般来说Windows系统下为1.5G-2G，Linux系统下为2G-3G），而64bit以上的处理器就不会有限制了。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">2. 为什么有的机器我将-Xmx和-XX:MaxPermSize都设置为512M之后Eclipse可以启动，而有些机器无法启动？<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;通过上面对JVM内存管理的介绍我们已经了解到JVM内存包含两种：堆内存和非堆内存，另外JVM最大内存首先取决于实际的物理内存和操作系统。所以说设置VM参数导致程序无法启动主要有以下几种原因：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />1) 参数中-Xms的值大于-Xmx，或者-XX:PermSize的值大于-XX:MaxPermSize；<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />2) -Xmx的值和-XX:MaxPermSize的总和超过了JVM内存的最大限制，比如当前操作系统最大内存限制，或者实际的物理内存等等。说到实际物理内存这里需要说明一点的是，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;如果你的内存是1024MB，但实际系统中用到的并不可能是1024MB，因为有一部分被硬件占用了。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">3. 为何将上面的参数写入到eclipse.ini文件Eclipse没有执行对应的设置？<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />&nbsp;那为什么同样的参数在快捷方式或者命令行中有效而在eclipse.ini文件中是无效的呢？这是因为我们没有遵守eclipse.ini文件的设置规则：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />参数形如&#8220;项 值&#8221;这种形式，中间有空格的需要换行书写，如果值中有空格的需要用双引号包括起来。比如我们使用-vm C:/Java/jre1.6.0/bin/javaw.exe参数设置虚拟机，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />在eclipse.ini文件中要写成这样：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-vm&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />C:/Java/jre1.6.0/bin/javaw.exe&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-vmargs&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xms128M&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xmx512M&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:PermSize=64M&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:MaxPermSize=128M&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />实际运行的结果可以通过Eclipse中&#8220;Help&#8221;-&#8220;About Eclipse SDK&#8221;窗口里面的&#8220;Configuration Details&#8221;按钮进行查看。<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />另外需要说明的是，Eclipse压缩包中自带的eclipse.ini文件内容是这样的：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-showsplash&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />org.eclipse.platform&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />--launcher.XXMaxPermSize&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />256m&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-vmargs&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xms40m&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xmx256m&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />其中&#8211;launcher.XXMaxPermSize（注意最前面是两个连接线）跟-XX:MaxPermSize参数的含义基本是一样的，我觉得唯一的区别就是前者是eclipse.exe启动的时候设置的参数，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />而后者是eclipse所使用的JVM中的参数。其实二者设置一个就可以了，所以这里可以把&#8211;launcher.XXMaxPermSize和下一行使用#注释掉。</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">4. 其他的启动参数。 如果你有一个双核的CPU，也许可以尝试这个参数:<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:+UseParallelGC<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />让GC可以更快的执行。（只是JDK 5里对GC新增加的参数）</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">补充：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />　　如果你的WEB APP下都用了大量的第三方jar，其大小超过了服务器jvm默认的大小，那么就会产生内存益出问题了。<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />解决方法： 设置MaxPermSize大小&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />可以在myelipse里选中相应的服务器比如tomcat5，展开里面的JDK子项页面，来增加服务器启动的JVM参数设置：<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xms128m&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-Xmx256m&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:PermSize=128M&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:MaxNewSize=256m&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />-XX:MaxPermSize=256m<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />或者手动设置MaxPermSize大小,比如tomcat，<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />修改TOMCAT_HOME/bin/catalina.bat，在echo "Using CATALINA_BASE: $CATALINA_BASE"上面加入以下行：&nbsp;<br style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" />JAVA_OPTS="-server -XX:PermSize=64M -XX:MaxPermSize=128m</p>
<p style="text-align: left; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(250,247,239); text-indent: 0px; margin: 10px auto; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px verdana, 'ms song', Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; color: rgb(57,57,57); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">建议：将相同的第三方jar文件移置到tomcat/shared/lib目录下，这样可以减少jar 文档重复占用内存</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-01-24 09:25 <a href="http://www.cnitblog.com/xijia0524/archive/2014/01/24/89236.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】BugFree和SVN的整合</title><link>http://www.cnitblog.com/xijia0524/archive/2013/03/27/87171.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 27 Mar 2013 01:19:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2013/03/27/87171.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/87171.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2013/03/27/87171.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/87171.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/87171.html</trackback:ping><description><![CDATA[<p>Subversion是目前主流的版本管理工具之一，在很多项目的开发中我们都可以看到它的身影。<br />每次fix bug并提交代码到SVN，必然会有一些文件更新（或增加、或删除），那么如何将这些文件的更新信息同BugFree中被fix的Bug有机的结合起来呢？下面的内容能够帮助你实现这一目的。</p>
<p><strong>一、准备工作</strong></p>
<ul><li>安装/升级至BugFree2.0.2</li><li>在Subversion的服务器上安装php</li><li>安装 <a title="viewvc" href="http://viewvc.org/" target="_blank"><u><font color="#0066cc">ViewVC</font></u></a>（一种web端浏览Subversion的工具）。如果没有比较版本历史差异的需求，可跳过此步骤</li><li>下载<a href="http://www.bugfree.org.cn/download/BugFreeforSVN.tar.gz"><u><font color="#0066cc">BugFreeforSVN.tar.gz</font></u></a> </li></ul>
<p><a href="http://www.bugfree.org.cn/download/BugFreeforSVN.tar.gz"><u><font color="#0066cc">BugFreeforSVN.tar.gz</font></u></a>中的文件说明：</p>
<ul><li>&nbsp;svn_ci.php ：用于向BugFree提交svn信息的php脚本。你可以将此文件放置在Subversion服务器的某个目录，如：/somwhere/svn_ci.php</li><li>post-commit：svn每次成功提交后触发的钩子脚本。应将此文件放置在代码库的hooks目录中，如：/home/svnadmin/repos/yourproject/hooks/。一般情况下，你应该给该文件设置可执行权限。 
<ul><font color="#003366">cd /home/svnadmin/repos/yourproject/hooks/<br />chmod +x post-commit </font></ul></li><li>post-commit.bat：功能同上，用于windows平台</li><li>class.http.php：第三方的http类文件。你也可以到 <a href="http://www.phpfour.com/lib/http" target="_blank"><u><font color="#0066cc">http://www.phpfour.com/lib/http</font></u></a> 自行下载 </li></ul>
<p><strong>二、修改配置</strong></p>
<p>修改svn_ci.php：</p>
<ul><li>define(&#8217;API_NEWLINE&#8217;, chr(0&#215;03));&nbsp; // API行分隔符，默认不用修改</li><li>define(&#8217;API_DEVIDER&#8217;, chr(0&#215;04));&nbsp; // API列分隔符，默认不用修改</li><li>define(&#8217;API_KEY&#8217;, &#8216;YOUR_KEY&#8217;);&nbsp;&nbsp;&nbsp;&nbsp; // API加密KEY，请参考BugFree的Include/Api.inc.php中的值进行修改</li><li>define(&#8217;API&#8217;, &#8220;http://127.0.0.1/bugfree/api.php&#8221;);&nbsp; // BugFree的api地址</li><li>define(&#8217;USER_NAME&#8217;, &#8216;admin&#8217;);&nbsp;&nbsp;&nbsp; // 用于向BugFree提交svn信息的用户名（建议设为管理员之一，这样可以修改所有的Bug）</li><li>define(&#8217;USER_PASSWORD&#8217;, &#8216;e10adc3949ba59abbe56e057f20f883e&#8217;); // 用户加密后的密码（默认是md5(原始密码)）</li><li>define(&#8217;VIEWVC&#8217;, &#8216;http://bugfree.svn.sourceforge.net/viewvc/bugfree/&#8217;); // ViewVC查看代码的根地址 </li></ul>
<p>修改post-commit：</p>
<ul><li>PHP_EXE=&#8217;/phppath/php&#8217;&nbsp; #php可执行文件的路径</li><li>CHECK_IN_PHP=&#8217;/somwhere/svn_ci.php&#8217;&nbsp;&nbsp;&nbsp; #svn_ci.php的路径</li><li>SVN_LOOK_EXE=&#8217;/svnpath/svnlook&#8217;&nbsp;&nbsp; #svnlook可执行文件的路径 </li></ul>
<p>windows平台下post-commit.bat的修改可参考post-commit</p>
<p><strong>三、如何使用</strong></p>
<p>每次提交代码时，在注释里填写含有&#8221; fix bug #123&#8221; 等类似格式的信息，就会把相应的文件更新信息提交到BugFree中。</p>
<p>例：</p>
<ol><li>修改文件branch/BugFree2.0_demo/Bug.php</li><li>提交修改，假设此次fix的Bug号为123： svn ci -m &#8216; fix bug #123 &#8216;</li><li>查看BugFree中Bug号为123的Bug，则会发现其多了一行类似以下格式的注释： </li></ol>
<dl style="padding-bottom: 0pt; text-align: left; padding-top: 0pt; padding-left: 0pt; margin: 6px 3px; padding-right: 0pt">
<dd style="margin: 5px 0pt 0pt 4px">
<blockquote style="margin: 10px 1px">
<p>2008-08-08 08:08:08 <strong>Edited</strong> by <strong>admin</strong></p></blockquote>
<blockquote style="margin: 10px 1px">
<p>Changeset&nbsp;[559]&nbsp;by&nbsp;leeyupeng,&nbsp;2008-08-08&nbsp;08:08:08&nbsp;+0800&nbsp;(Fri,&nbsp;8 Aug&nbsp;2008)</p>
<p>U&nbsp;&nbsp; branch/BugFree2.0_demo/Bug.php&nbsp; <a href="http://bugfree.svn.sourceforge.net/viewvc/bugfree/branch/BugFree2.0_demo/Bug.php?r1=559&amp;sortdir=down&amp;r2=454&amp;sortby=log" target="_blank"><u><font color="#0066cc">[diff]</font></u></a></p></blockquote></dd></dl>
<p>注释说明：</p>
<ul><li>&nbsp;[559]：提交后的版本号</li><li>leeyupeng ：提交人</li><li>2008-08-08&nbsp;08:08:08&nbsp;+0800&nbsp;(Fri,&nbsp;8 Aug&nbsp;2008)：提交时间</li><li>U&nbsp;&nbsp; branch/BugFree2.0_demo/Bug.php：修改的文件列表。若一次提交有多个文件被修改，则分行显示</li><li><a href="http://bugfree.svn.sourceforge.net/viewvc/bugfree/branch/BugFree2.0_demo/Bug.php?r1=559&amp;sortdir=down&amp;r2=454&amp;sortby=log" target="_blank"><u><font color="#0066cc">[diff]</font></u></a> ：与前一版本的差异比较链接 </li></ul>
<p><strong>四、其他说明</strong></p>
<p>关于提交信息的格式：</p>
<p>一次提交可能修改了多个bug，那么我们在svn提交填写提交信息时，多个Bug号可以用空格、英文逗号隔开。<br />如下格式都是可以的：</p>
<blockquote>
<p>fixbug #123 #456<br />lee fix bug #123,#456<br />fix&nbsp; bug&nbsp;&nbsp;&nbsp; #123,&nbsp; #456<br />fix bug #123, #456. God!</p></blockquote>
<p>每个Bug号开头用#标识，并保证文字<strong>fix bug </strong>和第一个Bug号之间不少于一个空格。</p>
<p>当然，这可能并不符合你所在团队的习惯，你可以通过修改svn_ci.php中35行附近的正则表达式：<strong><font color="#993300">/fixs*bug&#8230;/i</font></strong>来定制自己的message格式 :-)。</p>
<p>关于diff链接 ：</p>
<p>你可能没有安装ViewVC，或者有其他Web方式浏览版本库的工具，那么可以通过修改 svn_ci.php中60行附近的<strong><font color="#993300"><em>$note .= &#8216; [url=&#8217; . VIEWVC . $fileName . &#8216;?r1=&#8217;. $pre . &#8216;&amp;sortdir=down&amp;r2=&#8217; . $rev . &#8216;&amp;sortby=log][diff][/url]&#8217;;</em></font></strong>来定制链接参数。</p>
<p><strong>参考文章 </strong></p><img src ="http://www.cnitblog.com/xijia0524/aggbug/87171.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2013-03-27 09:19 <a href="http://www.cnitblog.com/xijia0524/archive/2013/03/27/87171.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'</title><link>http://www.cnitblog.com/xijia0524/archive/2013/01/17/86931.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Thu, 17 Jan 2013 07:14:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2013/01/17/86931.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/86931.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2013/01/17/86931.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/86931.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/86931.html</trackback:ping><description><![CDATA[　今天 给开发更新了表结构后，遇到了这样的问题： 
<div>　　mysql&gt; INSERT INTO `sg_medal_action` (`action_name`,`action_code`,`status`) VALUES ('121212','testCode',2);</div>
<div>　　ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'</div>
<div><br /></div>
<div>　　问题重现：</div>
<div><br /></div>
<div>　　修改前，表的结构如下：</div>
<div><wbr><wbr><wbr>mysql&gt; show create table sg_medal_action\G</div>
<div>　　*************************** 1. row ***************************</div>
<div>　　 <wbr><wbr><wbr>Table: sg_medal_action</div>
<div>　　Create Table: CREATE TABLE `sg_medal_action` (</div>
<div><wbr>　`action_id` int(10) unsigned NOT NULL,</div>
<div>　 <wbr>`action_code` char(20) NOT NULL,</div>
<div>　 <wbr>`action_name` varchar(80) NOT NULL,</div>
<div><wbr>　`status` tinyint(4) unsigned DEFAULT '1',</div>
<div>　　 <font color="#ff0000"><wbr>PRIMARY KEY (`action_id`,`action_code`)</font></div>
<div>　　) ENGINE=<font color="#ff0000">InnoDB</font> DEFAULT CHARSET=utf8</div>
<div>　　1 row in set (0.00 sec)</div>
<div>　　</div>
<div>　　表的状态信息如下：</div>
<div>　　mysql&gt; show table status like 'sg_medal_action'\G</div>
<div>　　*************************** 1. row ***************************</div>
<div><wbr><wbr>　　 <wbr>　　 Name: sg_medal_action</div>
<div>　　 <wbr><wbr><wbr><wbr>Engine: InnoDB</div>
<div>　　 <wbr><wbr><wbr><wbr>Version: 10</div>
<div>　　 <wbr><wbr>Row_format: Compact</div>
<div>　　 <wbr><wbr><wbr><wbr><wbr>Rows: 7</div>
<div>　　 Avg_row_length: 2340</div>
<div>　　 <wbr><wbr>Data_length: 16384</div>
<div>　　Max_data_length: 0</div>
<div>　　 <wbr>Index_length: 0</div>
<div>　　 <wbr><wbr><wbr>Data_free: 0</div>
<div>　　 <font color="#ff0000">Auto_increment: NULL</font></div>
<div>　　 <wbr><wbr>Create_time: 2011-11-03 16:36:12</div>
<div>　　 <wbr><wbr>Update_time: NULL</div>
<div>　　 <wbr><wbr>Check_time: NULL</div>
<div>　　 <wbr><wbr><wbr>Collation: utf8_general_ci</div>
<div>　　 <wbr><wbr><wbr>Checksum: NULL</div>
<div>　　 Create_options: <wbr></div>
<div><wbr><wbr>　　 <wbr><wbr>Comment: <wbr></div>
<div>　　1 row in set (0.00 sec)</div>
<div><br /></div>
<div>　　表里面的内容：</div>
<div>　　mysql&gt; select * from sg_medal_action;</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| action_id | action_code <wbr>| action_name <wbr><wbr><wbr><wbr>| status |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| <wbr><wbr><wbr><wbr>1 | buyAddr <wbr><wbr><wbr>| 购买线索数量 <wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>2 | fans <wbr><wbr><wbr><wbr><wbr>| 粉丝数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>3 | header <wbr><wbr><wbr><wbr>| 上传头像 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>4 | login <wbr><wbr><wbr><wbr>| 登录 <wbr><wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>5 | mark <wbr><wbr><wbr><wbr><wbr>| 锚点数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>6 | showGoods <wbr><wbr>| 晒货数量 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>7 | showGoodsLove | 晒货喜欢数 <wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　7 rows in set (0.00 sec)</div>
<div><br /></div>
<div>　　修改表结构语句如下：</div>
<div>　　alter table sg_medal_action <font color="#ff0000">drop primary key;</font></div>
<div>　　alter table sg_medal_action <font color="#ff0000">add primary key</font>(action_id);</div>
<div>　</div>
<div>　　执行完以上操作后，表结构、表状态信息分别如下：</div>
<div>　　mysql&gt; show create table sg_medal_action\G</div>
<div>　　*************************** 1. row ***************************</div>
<div><wbr><wbr>　　 <wbr>Table: sg_medal_action</div>
<div>　　Create Table: CREATE TABLE `sg_medal_action` (</div>
<div>　　 <wbr>`action_id` int(10) <font color="#ff0000">unsigned NOT NULL,</font></div>
<div>　　 <wbr>`action_code` char(20) NOT NULL,</div>
<div>　　 <wbr>`action_name` varchar(80) NOT NULL,</div>
<div>　　 <wbr>`status` tinyint(4) unsigned DEFAULT '1',</div>
<div>　　 <wbr>PRIMARY KEY (`action_id`)</div>
<div>　　) ENGINE=InnoDB DEFAULT CHARSET=utf8</div>
<div>　　1 row in set (0.00 sec)</div>
<div><br /></div>
<div>　　mysql&gt; show table status like 'sg_medal_action'\G</div>
<div>　　*************************** 1. row ***************************</div>
<div><wbr><wbr>　　 <wbr><wbr><wbr>Name: sg_medal_action</div>
<div>　　 <wbr><wbr><wbr><wbr>Engine: InnoDB</div>
<div>　　 <wbr><wbr><wbr><wbr>Version: 10</div>
<div>　　 <wbr><wbr>Row_format: Compact</div>
<div>　　 <wbr><wbr><wbr><wbr><wbr>Rows: 7</div>
<div>　　 Avg_row_length: 2340</div>
<div>　　 <wbr><wbr>Data_length: 16384</div>
<div>　　Max_data_length: 0</div>
<div>　　 <wbr>Index_length: 0</div>
<div>　　 <wbr><wbr><wbr>Data_free: 0</div>
<div>　　 <font color="#ff0000">Auto_increment: NULL</font></div>
<div><wbr><wbr>　　Create_time: 2011-11-03 16:42:45</div>
<div>　　 <wbr><wbr>Update_time: NULL</div>
<div>　　 <wbr><wbr>Check_time: NULL</div>
<div>　　 <wbr><wbr><wbr>Collation: utf8_general_ci</div>
<div>　　 <wbr><wbr><wbr>Checksum: NULL</div>
<div>　　 Create_options: <wbr></div>
<div>　　 <wbr><wbr><wbr><wbr>Comment: <wbr></div>
<div>　　1 row in set (0.00 sec)</div>
<div><br /></div>
<div>　　mysql&gt; <wbr></div>
<div><br /></div>
<div>　　执行 insert 操作，如下：</div>
<div>　　mysql&gt; INSERT INTO `sg_medal_action` (`action_name`,`action_code`,`status`) VALUES ('121212','testCode',2);</div>
<div>　　Query OK, 1 row affected, 1 warning (0.00 sec)</div>
<div><br /></div>
<div>　　插入操作执行成功，查看表中记录情况如下：</div>
<div><br /></div>
<div>　　mysql&gt; select * from sg_medal_action;</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| action_id | action_code <wbr>| action_name <wbr><wbr><wbr><wbr>| status |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| <wbr><wbr><wbr><wbr>0 | testCode <wbr><wbr><wbr>| 121212 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>2 |</div>
<div>　　| <wbr><wbr><wbr><wbr>1 | buyAddr <wbr><wbr><wbr>| 购买线索数量 <wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>2 | fans <wbr><wbr><wbr><wbr><wbr>| 粉丝数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>3 | header <wbr><wbr><wbr><wbr>| 上传头像 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>4 | login <wbr><wbr><wbr><wbr>| 登录 <wbr><wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>5 | mark <wbr><wbr><wbr><wbr><wbr>| 锚点数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>6 | showGoods <wbr><wbr>| 晒货数量 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>7 | showGoodsLove | 晒货喜欢数 <wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　8 rows in set (0.00 sec)</div>
<div><br /></div>
<div>　　再执行一次插入操作，报错如下：</div>
<div>　　</div>
<div>　　mysql&gt; INSERT INTO `sg_medal_action` (`action_name`,`action_code`,`status`) VALUES ('345','Code',2);</div>
<div>　　ERROR 1062 (23000): <font color="#ff0000">Duplicate entry '0'</font> for key 'PRIMARY'</div>
<div>　　</div>
<div>　　这说明每次往表中插入记录的PRIMARY值均为0。</div>
<div>　　</div>
<div>　　解决问题思路：</div>
<div>　　1、老的表结构，使用的复合索引&#8212;&#8212;&#8220;<span style="color: rgb(255,0,0)">PRIMARY KEY (`action_id`,`action_code`)</span>&#8221;，没有指定 auto_increment 的值；</div>
<div>　　2、删除原来主键，重新创建新主键时（alter table sg_medal_action <wbr><font color="#ff0000">add primary key</font>(action_id);</div>
<div>），也未指定 auto_increment的值，所以在创建了新主键后，再看表 <wbr>sg_medal_action 的状态时，<span style="color: rgb(255,0,0)"> <wbr></span><span style="color: rgb(255,0,0)">Auto_increment</span> 一栏的值仍为 <span style="color: rgb(255,0,0)">NULL；</span></div>
<div>　　3、mysql 不支持 &#8220;alter table sg_medal_action <wbr><font color="#ff0000">add auto_increment primary key</font>(action_id);&#8221;这样的语句，请详看 alter 的语法 <wbr><a href="http://dev.mysql.com/doc/refman/5.0/en/alter-table.html"><u><font color="#0066cc">http://dev.mysql.com/doc/refman/5.0/en/alter-table.html</font></u></a> <wbr>；</div>
<div>　　4、解决问题</div>
<div>　　mysql&gt; alter table sg_medal_action modify column action_id int unsigned auto_increment;</div>
<div>　　　　　　Query OK, 7 rows affected (0.06 sec)</div>
<div>　　　　　　Records: 7 <wbr>Duplicates: 0 <wbr>Warnings: 0</div>
<div>　　</div>
<div>　　执行了此操作后，再查看 <wbr>sg_medal_action <wbr>表结构及状态信息，如下：</div>
<div>　　mysql&gt; show create table sg_medal_action\G</div>
<div>　　*************************** 1. row ***************************</div>
<div><wbr><wbr>　　 <wbr>Table: sg_medal_action</div>
<div>　　Create Table: CREATE TABLE `sg_medal_action` (</div>
<div>　　 <wbr>`action_id` int(10) unsigned NOT NULL <font color="#ff0000">AUTO_INCREMENT,</font></div>
<div>　　 <wbr>`action_code` char(20) NOT NULL,</div>
<div>　　 <wbr>`action_name` varchar(80) NOT NULL,</div>
<div>　　 <wbr>`status` tinyint(4) unsigned DEFAULT '1',</div>
<div>　　 <wbr>PRIMARY KEY (`action_id`)</div>
<div>　　) ENGINE=InnoDB <font color="#ff0000">AUTO_INCREMENT=8</font> DEFAULT CHARSET=utf8</div>
<div>　　1 row in set (0.00 sec)</div>
<div>　　</div>
<div>　　mysql&gt; show table status like 'sg_medal_action'\G</div>
<div>　　*************************** 1. row ***************************</div>
<div><wbr><wbr>　　 <wbr><wbr><wbr>Name: sg_medal_action</div>
<div>　　 <wbr><wbr><wbr><wbr>Engine: InnoDB</div>
<div>　　 <wbr><wbr><wbr><wbr>Version: 10</div>
<div><wbr><wbr>　　 Row_format: Compact</div>
<div><wbr><wbr><wbr><wbr>　　 <wbr>Rows: 8</div>
<div>　　 Avg_row_length: 2048</div>
<div><wbr><wbr>　　Data_length: 16384</div>
<div>　　Max_data_length: 0</div>
<div>　　 <wbr>Index_length: 0</div>
<div><wbr><wbr>　　 <wbr>Data_free: 0</div>
<div>　　 <font color="#ff0000">Auto_increment: 8</font></div>
<div><wbr><wbr>　　Create_time: 2011-11-03 16:25:58</div>
<div>　　 <wbr><wbr>Update_time: NULL</div>
<div>　　 <wbr><wbr>Check_time: NULL</div>
<div><wbr><wbr>　　 <wbr>Collation: utf8_general_ci</div>
<div>　　 <wbr><wbr><wbr>Checksum: NULL</div>
<div>　　 Create_options: <wbr></div>
<div><wbr><wbr>　　 <wbr><wbr>Comment: <wbr></div>
<div>　　1 row in set (0.00 sec)</div>
<div><br /></div>
<div>　　再执行insert操作，如下：</div>
<div>　　mysql&gt; INSERT INTO `sg_medal_action` (`action_name`,`action_code`,`status`) VALUES ('121212','testCode',2);</div>
<div>　　Query OK, 1 row affected (0.00 sec)</div>
<div>　　</div>
<div>　　查询其结果：</div>
<div>　　mysql&gt; select * from sg_medal_action;</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| action_id | action_code <wbr>| action_name <wbr><wbr><wbr><wbr>| status |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| <wbr><wbr><wbr><wbr>1 | buyAddr <wbr><wbr><wbr>| 购买线索数量 <wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>2 | fans <wbr><wbr><wbr><wbr><wbr>| 粉丝数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>3 | header <wbr><wbr><wbr><wbr>| 上传头像 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>4 | login <wbr><wbr><wbr><wbr>| 登录 <wbr><wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>5 | mark <wbr><wbr><wbr><wbr><wbr>| 锚点数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>6 | showGoods <wbr><wbr>| 晒货数量 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>7 | showGoodsLove | 晒货喜欢数 <wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>8 | testCode <wbr><wbr><wbr>| 121212 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>2 |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　8 rows in set (0.00 sec)</div>
<div><br /></div>
<div>　　再插入一行：</div>
<div>　　mysql&gt; INSERT INTO `sg_medal_action` (`action_name`,`action_code`,`status`) VALUES ('345','Code',2);</div>
<div>　　Query OK, 1 row affected (0.01 sec)</div>
<div><br /></div>
<div>　　查询结果：</div>
<div>　　mysql&gt; select * from sg_medal_action;</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| action_id | action_code <wbr>| action_name <wbr><wbr><wbr><wbr>| status |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　| <wbr><wbr><wbr><wbr>1 | buyAddr <wbr><wbr><wbr>| 购买线索数量 <wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>2 | fans <wbr><wbr><wbr><wbr><wbr>| 粉丝数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>3 | header <wbr><wbr><wbr><wbr>| 上传头像 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>4 | login <wbr><wbr><wbr><wbr>| 登录 <wbr><wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>5 | mark <wbr><wbr><wbr><wbr><wbr>| 锚点数 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>6 | showGoods <wbr><wbr>| 晒货数量 <wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>7 | showGoodsLove | 晒货喜欢数 <wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>1 |</div>
<div>　　| <wbr><wbr><wbr><wbr>8 | testCode <wbr><wbr><wbr>| 121212 <wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>2 |</div>
<div>　　| <wbr><wbr><wbr><wbr>9 | Code <wbr><wbr><wbr><wbr><wbr>| 345 <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>| <wbr><wbr><wbr>2 |</div>
<div>　　+-----------+---------------+--------------------+--------+</div>
<div>　　9 rows in set (0.00 sec)</div>
<div><br /></div>
<div><br /></div>
<div>　　OK，问题 处理到此结束。</div>
<div><br /></div>
<div>　　总结下：</div>
<div>　　　　auto_increment 与 primary key 如果不一起存在，则做 insert 操作时，必须自己指定 primary key 列的值；</div>
<div>　　　　小测试如下：</div>
<div>　　　　mysql&gt; create table dd (i int primary key,b char(10));</div>
<div>　　　　Query OK, 0 rows affected (0.01 sec)</div>
<div><br /></div>
<div>　　　　mysql&gt; show create table dd\G</div>
<div>　　　　*************************** 1. row ***************************</div>
<div>　　　　 <wbr><wbr><wbr>Table: dd</div>
<div>　　　　Create Table: CREATE TABLE `dd` (</div>
<div>　　　　 <wbr>`i` int(11) NOT NULL,</div>
<div>　　　　 <wbr>`b` char(10) DEFAULT NULL,</div>
<div>　　　　 <wbr>PRIMARY KEY (`i`)</div>
<div>　　　　) ENGINE=InnoDB DEFAULT CHARSET=utf8</div>
<div>　　　　1 row in set (0.00 sec)</div>
<div>　</div>
<div>　　　　mysql&gt; insert into dd(b) values('dkf');</div>
<div>　　　　Query OK, 1 row affected, 1 warning (0.00 sec)</div>
<div>　</div>
<div>　　　　mysql&gt; select * from dd;</div>
<div>　　　　+---+------+</div>
<div>　　　　| i | b <wbr><wbr>|</div>
<div>　　　　+---+------+</div>
<div>　　　　| 0 | dkf <wbr>|</div>
<div>　　　　+---+------+</div>
<div>　　　　1 row in set (0.00 sec)</div>
<div><br /></div>
<div>　　　　mysql&gt; insert into dd(b) values('lll');</div>
<div>　　　　ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'</div>
<div>　　　　mysql&gt; select * from dd;</div>
<div>　　　　+---+------+</div>
<div>　　　　| i | b <wbr><wbr>|</div>
<div>　　　　+---+------+</div>
<div>　　　　| 0 | dkf <wbr>|</div>
<div>　　　　+---+------+</div>
<div>　　　　1 row in set (0.00 sec)</div>
<div>　　</div>
<div>　　　　mysql&gt; insert into dd values(1,'lll');</div>
<div>　　　　Query OK, 1 row affected (0.01 sec)</div>
<div><br /></div>
<div>　　　　mysql&gt; select * from dd;</div>
<div>　　　　+---+------+</div>
<div>　　　　| i | b <wbr><wbr>|</div>
<div>　　　　+---+------+</div>
<div>　　　　| 0 | dkf <wbr>|</div>
<div>　　　　| 1 | lll <wbr>|</div>
<div>　　　　+---+------+</div>
<div>　　　　2 rows in set (0.00 sec)</div>
<div><br /></div>
<div>　　　　mysql&gt; insert into dd(b) values('lll');</div>
<div>　　　　ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'</div>
<div><br /></div>
<div><br /></div>
<div><wbr><wbr>另外，请参阅下InnoDB引擎下update操作对atuo_increment影响的文章 <wbr><a href="http://bugs.mysql.com/bug.php?id=38839"><u><font color="#0066cc">http://bugs.mysql.com/bug.php?id=38839</font></u></a></div>
<div><u><br /><font color="#0066cc"></font></u></div>
<div>　　参阅：<a href="http://www.phwinfo.com/forum/comp-databases-mysql/317343-error-1062-23000-duplicate-entry-0-key-1-a.html"><u><font color="#0066cc">http://www.phwinfo.com/forum/comp-databases-mysql/317343-error-1062-23000-duplicate-entry-0-key-1-a.</font></u></a><a href="http://www.phwinfo.com/forum/comp-databases-mysql/317343-error-1062-23000-duplicate-entry-0-key-1-a.html"><u><font color="#0066cc">html</font></u></a></div><img src ="http://www.cnitblog.com/xijia0524/aggbug/86931.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2013-01-17 15:14 <a href="http://www.cnitblog.com/xijia0524/archive/2013/01/17/86931.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】64位windows7 上安装32位oracle 10g 的方法 &amp; 64位win7下PL/SQL Developer 报“ORA-12154: 错误的解决办法 </title><link>http://www.cnitblog.com/xijia0524/archive/2012/10/02/86467.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Tue, 02 Oct 2012 14:44:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2012/10/02/86467.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/86467.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2012/10/02/86467.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/86467.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/86467.html</trackback:ping><description><![CDATA[历尽种种磨难，终于把工作用的32位oracle 10g 装到64 位 windows7上了。不要问我为什么不装64位oracle或者 oracle 11g，工作需要，这是唯一理由。<br />遇到的种种问题，绕过的弯路就不罗嗦了，直接给出成功步骤。<br />哦~~ 再罗嗦一句，说一下软件环境：<br />操作系统: windows7 中文旗舰版 <br />oracle安装版本: 10.2.0.1 中文版，升级补丁至 10.2.0.3<br /><br />下面说正题<br /><span style="color: rgb(255,0,0)">首先，我们要解除oracle安装的windows版本检测<br /></span>1、编辑安装包内文件 database\stage\prereq\db\refhost.xml <br />增加下面节点<br /><span style="background-color: rgb(192,192,192)">&lt;OPERATING_SYSTEM&gt; <br />&lt;VERSION VALUE="6.1"/&gt;<br />&lt;/OPERATING_SYSTEM&gt; </span><br />2、编辑安装包内文件 database\install\oraparam.ini<br />找到[Certified Versions]小节 在下面的第二行中增加windows版本6.1，如下面所示<br /><span style="background-color: rgb(192,192,192)">Windows=4.0,5.0,5.1,5.2,6.1<span style="background-color: rgb(255,255,255)"> <br /></span><span style="background-color: rgb(255,255,255)">注意要把windows 前面的"#"去掉，否则无效<br /><span style="color: rgb(255,0,0)">其次我们必须关闭window7的 UAC。不要心存侥幸，这东西开着安装到一半就会被卡住，而且没有任何提示窗体。</span><br />3、执行C:\Windows\System32\UserAccountControlSettings.exe 把旁边的控制块拉到最下面。<br /><span style="color: rgb(255,0,0)">最后，要以兼容形式运行安装程序。<br /></span>4、右击setup.exe 点击属性-兼容性- 勾选以兼容模式运行这个程序 ，下拉列表中选择windos xp sp3<br /><br />一切完成以后点击setup开始安装吧。<br />oracle 装好了？很兴奋？接下来还有其他软件的问题了<br /><br />接着上次的话题，<a href="http://www.bardfarm.com/post/2010/07/15/64e4bd8dwindows7-e4b88ae5ae89e8a38532e4bd8doracle-10g-e79a84e696b9e6b395.aspx"><u><font color="#0066cc">在64位win7上装了32位oracle10</font></u></a>g 以后又出现了新的问题：<br />在使用oracle自带的sqlplus连接本机或者远程的oracle实例均能成功过，但使用 PL/SQL Developer (我装的是7.1版本) 连接任何一个实例在登录时均报&#8220;ORA-12154: TNS:无法解析指定的连接标识符&#8221;错误。<br />冷静，先分析原因，既然sqlplus已经能够连接，说明oracle的安装（至少客户端的安装）是正常的，TNS的配置是正确的。问题应该出在PL/SQL Developer 自身。考虑到本次安装oracle的过程中有诺干次安装失败且变换过oracle home，是否是注册表中的信息有写垃圾未清理？！进入 PL/SQL Developer 的 preferences中发现可以设定oracle home。该选项为空是自动选择，也可以手工填入路径。但是设置后没有效果。之后又检查了注册表、oracle设置均无异常。<br />无奈之下选择了重装PL/SQL Developer 。运行安装程序以后弹出一个警告框，这次仔细的看了一下，大概意思是安装目录中含有特殊字符可能导致oracle无法连接。该提示窗口按&#8220;确认&#8221;按钮后依然会继续安装。恍然大悟啊，64位win7会把32位应用程序默认的安装到Program Files (x86)目录下，那两个括号可能让oracle郁闷了。改变安装路径为一个比较&#8220;大众化&#8221;的路径，再次进行数据库连接，一切问题都解决了。<br />经验总结：哥么以后打死也不往默认的32位 program files目录下装东西了。<br /></span></span><img src ="http://www.cnitblog.com/xijia0524/aggbug/86467.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2012-10-02 22:44 <a href="http://www.cnitblog.com/xijia0524/archive/2012/10/02/86467.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>要做好性能测试，该掌握些什么？【转】</title><link>http://www.cnitblog.com/xijia0524/archive/2010/03/01/64429.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 01 Mar 2010 06:58:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2010/03/01/64429.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/64429.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2010/03/01/64429.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/64429.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/64429.html</trackback:ping><description><![CDATA[<font color=#ff0000 size=2>【转】</font>
<p><font face=Arial color=#ff9933 size=2>今天有同行在blog上留言，问&#8220;想从</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%B9%A6%C4%DC%B2%E2%CA%D4');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, '%B9%A6%C4%DC%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><font color=#000066>功能测试</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>转向</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%D0%D4%C4%DC%B2%E2%CA%D4');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, '%D0%D4%C4%DC%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><font color=#000066>性能测试</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>，但不知道需要哪些了解哪些知识，及怎样进行一个系统的</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%D1%A7%CF%B0');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, '%D1%A7%CF%B0');" href="javascript:;" target=_self><u><strong><font color=#000066>学习</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>&#8221;。这类问题之前也被问到很多次了，所以这次干脆整理一下，发个主题供同行们参考。如果需要补充，也欢迎大家留言一起讨论。</font>
<p><font face=Arial color=#ff9933 size=2>如果想真的做好性能测试，需要学习的东西还是比较多的。简单列一下吧。</font>
<p><font face=Arial color=#ff9933 size=2>1. 精通性能测试的基本概念，过程，方法论，了解性能工程；</font></p>
<p><font face=Arial color=#ff9933 size=2>2. 精通1个商业性能测试工具+1个开源性能</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%B2%E2%CA%D4%B9%A4%BE%DF');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, '%B2%E2%CA%D4%B9%A4%BE%DF');" href="javascript:;" target=_self><u><strong><font color=#000066>测试工具</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>，知道工具可以做什么，不可以做什么，以及工具使用中常见的问题和解决思路；</font></p>
<p><font face=Arial color=#ff9933 size=2>3. 扎实的计算机专业基础知识，包括计算机组成原理、</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%B2%D9%D7%F7%CF%B5%CD%B3');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, '%B2%D9%D7%F7%CF%B5%CD%B3');" href="javascript:;" target=_self><u><strong><font color=#000066>操作系统</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>、</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%CA%FD%BE%DD%BF%E2');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, '%CA%FD%BE%DD%BF%E2');" href="javascript:;" target=_self><u><strong><font color=#000066>数据库</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>原理、计算机网络原理；</font></p>
<p><font face=Arial color=#ff9933 size=2>4. 熟悉至少1个常用的数据库产品，例如</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, 'SQL');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, 'SQL');" href="javascript:;" target=_self><u><strong><font color=#000066>SQL</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>Server或者 Oracle，能进行一般的数据库管理操作，熟悉SQL脚本的使用，熟悉常用的数据调优工具和常用的counter；</font></p>
<p><font face=Arial><font size=2><font color=#ff9933><span style="DISPLAY: none">5</span>. 熟悉至少一个操作系统的原理，</font></font></font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, 'Windows');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, 'Windows');" href="javascript:;" target=_self><u><strong><font color=#000066>Windows</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>或者</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, 'Linux');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, 'Linux');" href="javascript:;" target=_self><u><strong><font color=#000066>Linux</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>都可以，熟悉操作系统的体系架构、操作系统的重要基础概念，以及内存管理、存储/文件系统、驱动/硬件的管理、网络协议的实现及构成、性能的监控方法和原理，熟悉常用的counter；</font></p>
<p><font face=Arial color=#ff9933 size=2>6. 熟悉至少一个</font><a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, 'web');"><u><strong><font face=Arial size=2><a onclick="javascript:tagshow(event, 'web');" href="javascript:;" target=_self><u><strong><font color=#000066>web</font></strong></u></a></font></strong></u></a><font face=Arial color=#ff9933 size=2>server 产品，例如apache，了解一般的配置和常用的counter；</font></p>
<p><font face=Arial color=#ff9933 size=2>7. 熟悉至少一个应用服务器产品，例如tomcat，了解一般的配置，熟悉常用的服务器性能监控方法和原理，熟悉常用的counter；</font></p>
<p><span style="DISPLAY: none"></span><font face=Arial color=#ff9933 size=2>8. 至少熟悉TCP/IP协议，熟悉HTTP协议，至少见过并了解三层、四层交换或者路由器的使用和配置。了解常用的与网络性能相关的counter；</font></p>
<p><font face=Arial color=#ff9933 size=2>9. 了解一般的大型企业应用的部署架构和应用架构；</font></p>
<p><font face=Arial color=#ff9933 size=2>10. 了解知名大型web应用、高并发量、高流量、实时响应要求高的超大规模网站的架构和优化历程；</font></p>
<p><br><font face=Arial color=#ff9933 size=2>11. 熟悉统计学的基础知识、常用分析方法以及实验设计方法，了解数学建模相关的知识；</font></p>
<p><font face=Arial><font size=2><font color=#ff9933><span style="DISPLAY: none">12</span>. 熟悉专属行业的业务知识和用户场景，例如电信行业的OSS系统所涉及的业务知识和用户场景，证券交易系统所涉及的业务知识和用户场景；</font></font></font></p>
<p><font face=Arial><font size=2><font color=#ff9933><span style="DISPLAY: none">13</span>. 大量的实际性能测试及优化<a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%BE%AD%D1%E9');"><u><strong><font color=#000066>经验</font></strong></u></a>；</font></font></font></p>
<p><font face=Arial color=#ff9933 size=2>14. 积极的参与到各类圈子、社团的讨论和交流、分享中。</font></p>
<p><span style="BACKGROUND-COLOR: #ffff00"><br></span><font face=Arial color=#ff9933 size=2>另外，我之前也整理发布过不少性能测试方面的资料，从入门级的文章到 升级的必读都有一些，有兴趣可以参考。</font></p>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/64429.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2010-03-01 14:58 <a href="http://www.cnitblog.com/xijia0524/archive/2010/03/01/64429.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】软件测试应该遵循的十条基本原则</title><link>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45911.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 20 Jun 2008 14:31:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45911.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/45911.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45911.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/45911.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/45911.html</trackback:ping><description><![CDATA[<p>从用户的角度出发，就是希望通过<a onclick="javascript:tagshow(event, '%C8%ED%BC%FE%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><a onclick="javascript:tagshow(event, '%C8%ED%BC%FE');" href="javascript:;" target=_self><u><strong><font color=#000000>软件</font></strong></u></a>测试</strong></u></a>能充分暴露软件中存在的问题和缺陷；从<a onclick="javascript:tagshow(event, '%BF%AA%B7%A2');" href="javascript:;" target=_self><u><strong><font color=#000000>开发</font></strong></u></a>者的角度出发，就是希望测试能表明软件产品不存在错误，已经正确地实现了用户的<a onclick="javascript:tagshow(event, '%D0%E8%C7%F3');" href="javascript:;" target=_self><u><strong><font color=#000000>需求</font></strong></u></a>。软件测试的<a onclick="javascript:tagshow(event, '%D4%AD%D4%F2');" href="javascript:;" target=_self><u><strong><font color=#000000>原则</font></strong></u></a>尚没有标准的说法，大多只是经验之谈，以下可以作为测试的基本原则。 </p>
<p><span style="DISPLAY: none">Ic7TFUqD.l</span>　　(1)所有的测试都应追溯到用户需求。<span style="DISPLAY: none">TestAge 中国软件测试时代mpN{ L#h^rL</span></p>
<p><span style="DISPLAY: none">mQ8s*jS</span>　　软件测试的目标在于揭示错误。从用户角度来看，最严重的错误是那些导致<a onclick="javascript:tagshow(event, '%B3%CC%D0%F2');" href="javascript:;" target=_self><u><strong><font color=#000000>程序</font></strong></u></a>无法满足需求的错误。<span style="DISPLAY: none">TestAge 中国软件测试时代)A|B#x_^(G*Z</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代5M7G5u L#s1j/@ JxN!nF</span> </p>
<p>　　(2)应当把&#8220;尽早地和不断地进行软件测试&#8221;作为软件测试者的座右铭。</p>
<p><span style="DISPLAY: none">8^ tF;\Ad9d!P;i</span> </p>
<p><span style="DISPLAY: none">T%a-w$y'BZ'A6|</span>　　应该在测试工作真正开始前的较长时间内就进行测试计划。测试计划可以在需求<a onclick="javascript:tagshow(event, '%C4%A3%D0%CD');" href="javascript:;" target=_self><u><strong><font color=#000000>模型</font></strong></u></a>一完成就开始，详细的测试<a onclick="javascript:tagshow(event, '%D3%C3%C0%FD');" href="javascript:;" target=_self><u><strong><font color=#000000>用例</font></strong></u></a>定义可以在<a onclick="javascript:tagshow(event, '%C9%E8%BC%C6');" href="javascript:;" target=_self><u><strong><font color=#000000>设计</font></strong></u></a>模型被确定后立即开始。因此，所有测试应该在任何<a onclick="javascript:tagshow(event, '%B4%FA%C2%EB');" href="javascript:;" target=_self><u><strong><font color=#000000>代码</font></strong></u></a>被产生前就进行计划和设计。<span style="DISPLAY: none">TestAge 中国软件测试时代wf q b:pK;M4v</span></p>
<p><span style="DISPLAY: none">s h\7D?}*C;e%x</span>　　(3)pareto原则：测试发现的错误中80%很可能起源于20%的模块中。</p>
<p><span style="DISPLAY: none">r3{(V.QM([</span><span style="DISPLAY: none">TestAge 中国软件测试时代ya3l!pUO-n'y[O</span> </p>
<p>　　当某个<a onclick="javascript:tagshow(event, '%B9%A6%C4%DC');" href="javascript:;" target=_self><u><strong><font color=#000000>功能</font></strong></u></a>出问题，其对用户的影响有多大?然后根据风险大小确定测试的优先级。优先级高的测试，优先得到执行，一般来讲，针对用户最常用的20%功能(优先级高)的测试会得到完全执行，而低优先级的测试(另外用户不经常用的80%功能)就不是必要的，如果时间或经费不够，就暂时不做或少做。<span style="DISPLAY: none">TestAge 中国软件测试时代@q{:p+@{ @</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代CxW(r;{ l'g</span> </p>
<p>　　(4)完全测试是不可能的，测试需要终止。</p>
<p><span style="DISPLAY: none">?HUf'z'e l</span> </p>
<p><span style="DISPLAY: none">DG Q K fw v1gl</span>　　测试无法显示软件潜在的缺陷，&#8220;测试只能证明软件存在错误而不能证明软件没有错误&#8221;。最初的测试通常把焦点放在单个程序模块上，进一步测试的焦点则转向在集成的模块簇中寻找错误，最后在整个<a onclick="javascript:tagshow(event, '%CF%B5%CD%B3');" href="javascript:;" target=_self><u><strong><font color=#000000>系统</font></strong></u></a>中寻找错误。在测试中不可能运行路径的每一种组合。然而，充分覆盖程序逻辑，并确保程序设计中使用的所有条件是有可能的。</p>
<p><span style="DISPLAY: none">)V T OG.Bk!W)G2aT</span> </p>
<p><span style="DISPLAY: none">i i9xaTJxp</span>　　(5)应由独立的第三方来构造测试。</p>
<p><span style="DISPLAY: none">m \,?-OL</span> </p>
<p><span style="DISPLAY: none">O0c&amp;g t ~T0KD</span>　　第三方测试最大的特点在于它的专业性、独立性、客观性和公正性。对于软件开发商来说，经过第三方测试机构的测试，不仅可以通过专业化的测试手段发现软件错误，帮助开发商提升软件的品质，而且可以对软件有一个客观、科学的评价，有助于开发商认清自己产品的定位。对于行业主管部门以及软件使用者来说，由于第三方测试机构独立公正的地位，可以对被测试的软件有一个客观公正的评价，帮助用户选择合适、优秀的软件产品。<span style="DISPLAY: none">TestAge 中国软件测试时代ot+\.iT&amp;V'lV{</span></p>
<p><span style="DISPLAY: none">ij7p!EY</span>　　(6)充分注意测试中的群集现象。<span style="DISPLAY: none">TestAge 中国软件测试时代d7T {7?Yh2a</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代6h\~0O(i:CF#q</span> </p>
<p>　　测试后程序残存的错误数目与该程序中已发现的错误数目或检错率成正比。不要在某个程序段中找到几个错误就误认为该程序段就没有错误而不再测试，相反应该对错误群集的程序段进行重点测试。</p>
<p><span style="DISPLAY: none">6F5Yz%^"Eg</span> </p>
<p><span style="DISPLAY: none">-`'?7P6}r ?8JM [</span>　　(7)尽量避免测试的随意性。<span style="DISPLAY: none">TestAge 中国软件测试时代8|3} |$Q ECC</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代dhA:UH8nij:GK</span> </p>
<p>　　测试计划应包括：所测软件的功能，输入和输出，测试内容，各项测试的进度安排，资源要求，测试资料，测试<a onclick="javascript:tagshow(event, '%B9%A4%BE%DF');" href="javascript:;" target=_self><u><strong><font color=#000000>工具</font></strong></u></a>，测试用例的选择，测试的控制方法和过程，系统的配置方式，跟踪规则，调试规则，以及回归测试的规定等以及评价标准。</p>
<p><span style="DISPLAY: none">3G1u7D W#X'd9t8Z'l</span><span style="DISPLAY: none">TestAge 中国软件测试时代I$qeT| w/T ~4f</span> </p>
<p>　　(8)兼顾合理的输入和不合理的输入<a onclick="javascript:tagshow(event, '%CA%FD%BE%DD');" href="javascript:;" target=_self><u><strong><font color=#000000>数据</font></strong></u></a>。<span style="DISPLAY: none">TestAge 中国软件测试时代j"X/I,C3Pb {yw</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代6dp1D nxeB*U</span> </p>
<p>　　(9)程序修改后要回归测试</p>
<p><span style="DISPLAY: none">A%y*Rk~8{/s</span><span style="DISPLAY: none">TestAge 中国软件测试时代W_*c }!tQ3{ o</span> </p>
<p>　　修改程序后，应该重新进行测试以确认修改没有引入新的错误或导致其他代码产生错误。<span style="DISPLAY: none">TestAge 中国软件测试时代'Hgq HvC)v_"Y</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代 w3}$yT,@ B?o</span> </p>
<p>　　(10)应长期保留测试用例，直至系统废弃。<span style="DISPLAY: none">TestAge 中国软件测试时代Q?%P4r3YB4O</span></p>
<p><span style="DISPLAY: none">TestAge 中国软件测试时代Hxc1z{y</span> </p>
<p>　　妥善保存测试计划，测试用例，出错统计和最终分析报告，为维护等提供方便。</p>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/45911.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-06-20 22:31 <a href="http://www.cnitblog.com/xijia0524/archive/2008/06/20/45911.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】如何进行升级测试</title><link>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45909.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 20 Jun 2008 14:09:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45909.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/45909.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45909.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/45909.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/45909.html</trackback:ping><description><![CDATA[什么是升级测试？比如说你们公司<a onclick="javascript:tagshow(event, '%BF%AA%B7%A2');" href="javascript:;" target=_self><u><strong><font color=#000000>开发</font></strong></u></a>的产品现已经发布的是V1.0，由于被发现存在缺陷，这时就需开发Patch或Hot Fix，并进行升级测试，然后发布V1.1。<span style="DISPLAY: none">E QG^,b;q&amp;e</span><span style="DISPLAY: none">TestAge 中国软件测试时代I)_&amp;yl5hbm</span>
<p>升级测试听起来似乎挺平常的，但它其实也是软件测试中比较重要的一部分，它通常包括以下内容：</p>
<span style="DISPLAY: none">G cr(u%m;rq7I)p</span>安装测试 <a onclick="javascript:tagshow(event, '%CA%FD%BE%DD%BF%E2');" href="javascript:;" target=_self><u><strong><a onclick="javascript:tagshow(event, '%CA%FD%BE%DD');" href="javascript:;" target=_self><u><strong><font color=#000000>数据</font></strong></u></a>库</strong></u></a>测试 <a onclick="javascript:tagshow(event, '%D3%A6%D3%C3');" href="javascript:;" target=_self><u><strong><font color=#000000>应用</font></strong></u></a>测试 文档测试
<p><span style="DISPLAY: none">/u%YS Z'q?d</span>安装测试</p>
<span style="DISPLAY: none">L^+T)KO#MMy1C</span>
<p><span style="DISPLAY: none">A"C c?"n</span>当发布一个<a onclick="javascript:tagshow(event, '%CF%B5%CD%B3');" href="javascript:;" target=_self><u><strong><font color=#000000>系统</font></strong></u></a>的新版本时，<a onclick="javascript:tagshow(event, '%B3%CC%D0%F2');" href="javascript:;" target=_self><u><strong><font color=#000000>程序</font></strong></u></a><a onclick="javascript:tagshow(event, '%B4%FA%C2%EB');" href="javascript:;" target=_self><u><strong><font color=#000000>代码</font></strong></u></a>肯定是被修改过了，安装测试的目的是确保安装完成后修改过的文件被复制到了正确的位置，比如说某个文件夹包含了所有更新的HTML文件，这时就要检查相关的CSS文件夹下的文件是不是更新了，如果只更新了HTML而没更新CSS，那么相应的颜色/字体就不能正确地显示。</p>
<span style="DISPLAY: none">.@Q/ye"u:O)j3l f+l5R2Y</span>
<p><span style="DISPLAY: none">.~ u7lh?3_</span>如果公司研发过程比较规范，安装测试通常是在<a onclick="javascript:tagshow(event, '%C5%E4%D6%C3%B9%DC%C0%ED');" href="javascript:;" target=_self><u><strong><font color=#000000>配置管理</font></strong></u></a>员的配合下完成的。首先，是文件夹级的测试，检查安装过程中复制到系统中的文件夹的时间戳是否变化；其次，检查被修改过的文件的大小，并和之前的版本进行比较，当然，这分两种测试，如果是白盒测试，测试人员要打开相应的文件确认新代码和改过的代码，如果是黑盒测试，那就要检查文件大小应与旧版本的不同。</p>
<span style="DISPLAY: none">#]9a;~r:u)mgY-J</span>
<p><span style="DISPLAY: none">qq*| m|</span>数据库测试<span style="DISPLAY: none">TestAge 中国软件测试时代 h-q5D r8s`IXp'w}</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代o5@.x(m$Yx</span>
<p>很多情况下，系统的升级都是伴随着数据库脚本的更新，数据库测试通常也是由DBA人员或在DBA的配合下进行。升级前要停止数据库并做备份，然后执行升级脚本，之后测试人员需要查看数据库日志，并检查库中被修改的记录是否正确。如果升级脚本是在库中创建一个新的Table或是新的Relation，那么数据库测试应该关注对空库的测试，比如先建一个空库V1.0，只包含一些空的Table和Relation，而不包含任何数据，然后测试人员执行升级脚本，并查看日志文件里是否有报错，如果没有报错一切ok，则通过应用程序连到数据库上执行一些<a onclick="javascript:tagshow(event, '%B9%A6%C4%DC');" href="javascript:;" target=_self><u><strong><font color=#000000>功能</font></strong></u></a>测试<a onclick="javascript:tagshow(event, '%D3%C3%C0%FD');" href="javascript:;" target=_self><u><strong><font color=#000000>用例</font></strong></u></a>来确保数据的Inset或Update都是正确的。</p>
<span style="DISPLAY: none">DB,N%L9n</span><span style="DISPLAY: none">TestAge 中国软件测试时代%?!oVnd](Q</span>
<p>应用测试<span style="DISPLAY: none">TestAge 中国软件测试时代2eU_ u"l0p D</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代f;lYp2i#^MT</span>
<p>当安装测试和数据库测试都通过之后，进行应用测试，有两种方法：<span style="DISPLAY: none">TestAge 中国软件测试时代Qd)b5h(I9f$D8\@3U</span></p>
<p><span style="DISPLAY: none">2\7E'X:T9L^</span>方法一：先配一个空的数据库（即除了一些必需的初始化数据再没有其他数据），然后把应用程序升级一下，执行业务<a onclick="javascript:tagshow(event, '%C1%F7%B3%CC');" href="javascript:;" target=_self><u><strong><font color=#000000>流程</font></strong></u></a>测试看系统是否能够正常运行。</p>
<span style="DISPLAY: none">K3] H&amp;T#F|*yl7a&amp;vR</span>
<p><span style="DISPLAY: none">*Um&amp;\-r x5co</span>方法二：也是先配好数据库，但库里存有一些实际数据，然后把程序升级一下（比如从V1.0升至V1.1），运行应用程序，检查那些已有的数据在V1.1上是否也能被正确的展现和使用，最后执行业务流程测试看系统是否能够正常运行。<span style="DISPLAY: none">TestAge 中国软件测试时代&amp;Y5W(Z-E(k:Rz</span></p>
<p><span style="DISPLAY: none">6G&amp;Bi.mH[+d</span>有的时候升级完后还要手工修改库中已有的记录，比如一个网上银行的系统，它里面有很多支付或转帐的数据，在做升级测试时，就可能要修改那些在上一版本中生成的数据，因为它们可能涉及到多个表之间的数据转换或一二级约束。</p>
<span style="DISPLAY: none">j b4Hm6JYU[V</span><span style="DISPLAY: none">TestAge 中国软件测试时代$WqkW_</span>
<p>文档测试<span style="DISPLAY: none">TestAge 中国软件测试时代l3im R^Kj)c</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代^ Q6^B(gB'gP^&amp;_{Frt</span>
<p>文档测试主要是验证相关的版本说明或者安装手册等文档是否和系统升级相匹配，这点很重要，因为客户通常都是根据版本说明和安装手册进行系统的安装或升级。<span style="DISPLAY: none">TestAge 中国软件测试时代}B K(y O{!S</span></p>
<p><span style="DISPLAY: none">cFF5M ]\(n O3r</span>进行文档测试必须理解详细的升级步骤，比如文档中应建议用户升级前要备份数据库、数据文件、配置文件等，再比如升级需要复制某些文件到特定目录，应当在版本说明中有所体现，总之，升级时任何必要的说明都应当在版本说明或安装手册内阐述清楚，安装时可以做什么以及不可以做什么都应在版本发布前得到确认。</p>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/45909.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-06-20 22:09 <a href="http://www.cnitblog.com/xijia0524/archive/2008/06/20/45909.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】软件外包项目中的进度管理</title><link>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45910.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 20 Jun 2008 14:09:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45910.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/45910.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/45910.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/45910.html</trackback:ping><description><![CDATA[<p>案例<span style="DISPLAY: none">TestAge 中国软件测试时代)D ?@GvkU$Y5J r</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代Tkx DA,J-E'\E(Vn</span>
<p>&nbsp;&nbsp;&nbsp; A公司是一家美资软件公司在华办事机构，其主要的目标是开拓中国市场、服务中国客户，做一些本地化和客户化的工作。它的主要软件产品是由总部在硅谷的软件<a onclick="javascript:tagshow(event, '%BF%AA%B7%A2');" href="javascript:;" target=_self><u><strong><font color=#000000>开发</font></strong></u></a>基地完成，然后由世界各地的分公司或办事机构进行客户化定制、二次开发和<a onclick="javascript:tagshow(event, '%CF%B5%CD%B3');" href="javascript:;" target=_self><u><strong><font color=#000000>系统</font></strong></u></a>维护。这些工作除了日常销售和系统核心维护之外，都是<a onclick="javascript:tagshow(event, '%CD%E2%B0%FC');" href="javascript:;" target=_self><u><strong><font color=#000000>外包</font></strong></u></a>给本地的软件公司来做。东方公司是A公司在中国的合作伙伴，主要负责软件的本地化和测试工作。<span style="DISPLAY: none">TestAge 中国软件测试时代 q+v L4ymL.P8Fl</span></p>
<p><span style="DISPLAY: none">^^o9l EQn</span>&nbsp;&nbsp;&nbsp; Bob先生是A公司中国地区的负责人，Henry则是刚刚加入A公司的负责此外包<a onclick="javascript:tagshow(event, '%CF%EE%C4%BF');" href="javascript:;" target=_self><u><strong><font color=#000000>项目</font></strong></u></a>的项目经理。东方公司是由William负责开发和<a onclick="javascript:tagshow(event, '%B9%DC%C0%ED');" href="javascript:;" target=_self><u><strong><font color=#000000>管理</font></strong></u></a>工作，William本身是<a onclick="javascript:tagshow(event, '%BC%BC%CA%F5');" href="javascript:;" target=_self><u><strong><font color=#000000>技术</font></strong></u></a>人员，并没有项目管理的经验。<span style="DISPLAY: none">TestAge 中国软件测试时代)M a,?5oOaj,j</span><br>&nbsp;&nbsp;&nbsp; 当Henry接手这项工作后，发现东方公司的项目开发成本非常高，每人每天130美金，但客户的满意度较差，并且每次开发<a onclick="javascript:tagshow(event, '%BD%F8%B6%C8');" href="javascript:;" target=_self><u><strong><font color=#000000>进度</font></strong></u></a>都要拖后，交付使用的版本也不尽如人意。而且，东方公司和A公司硅谷开发总部缺乏必要的沟通，只能把问题反馈给Henry，由Henry再反馈给总部。但由于Henry本身并不熟悉这个软件的开发工作，也造成了很多不必要的麻烦。<span style="DISPLAY: none">TestAge 中国软件测试时代/` G-k(Fth` n3\</span></p>
<p><span style="DISPLAY: none">bwSF7kH n</span>&nbsp;&nbsp;&nbsp; 为此，Bob希望Henry和William用项目管理的方法对该项目进行管理和改进。随后，Henry和William召开了一系列的会议，提出了新的做法。<span style="DISPLAY: none">TestAge 中国软件测试时代v'gm/HX h5a</span></p>
<p><span style="DISPLAY: none">&amp;@U.[PbXp z</span>&nbsp;&nbsp;&nbsp; 首先，他们制定了详细的项目计划和进度计划；其次，成立了单独的测试小组，将软件的开发和测试分开；并且，在硅谷和东方公司之间建立了一个新的沟通渠道，一些软件问题可以与总部直接沟通；同时，还采用了里程碑管理。<span style="DISPLAY: none">TestAge 中国软件测试时代A;Hi)M9H)D</span></p>
<p><span style="DISPLAY: none">'UEpC,X"E</span>&nbsp;&nbsp;&nbsp; 六个月后，软件交付使用。但是客户对这个版本还是不满意，认为还有很多问题。为什么运用了项目管理的方法，这个项目还是没有得到改善？</p>
<span style="DISPLAY: none">|3l9C4@7ne</span><span style="DISPLAY: none">TestAge 中国软件测试时代.O(S`H6O;Y X0Y_#g</span>
<p>&nbsp;&nbsp;&nbsp; Henry和William又进行了反复探讨，发现主要有三个方面问题：<br><span style="DISPLAY: none">X4H{2b3|</span><span style="DISPLAY: none">TestAge 中国软件测试时代]j#RK G(}|,Y</span><br>&nbsp;&nbsp;&nbsp; 1、软件本地化产生的问题并不多，但A公司提供的底层软件本身存在一些问题；<br><span style="DISPLAY: none">)Q^'J~-R5gb6ov</span>&nbsp;&nbsp;&nbsp; 2、软件的界面也存在一些问题，这是由于测试的项目不够详细引起的；<span style="DISPLAY: none">TestAge 中国软件测试时代KK$B!cCwZ</span><br>&nbsp;&nbsp;&nbsp; 3、开发的周期还是太短，没有时间完成一些项目的调试，所以新版本还是有许多的问题。</p>
<span style="DISPLAY: none">m/[Mgb-`O:Wf</span>
<p><span style="DISPLAY: none">c7cjt-A/r@4e TE</span>&nbsp;&nbsp;&nbsp; 此时，Henry向Bob提出是否采用公开招标的方式，选择新的、实力更强的合作伙伴。但Bob认为，与东方公司合作时间已经很长了，如果选择新的伙伴又需要较长的适应期，而且成本可能会更高。于是，Henry向东方公司提出一些新的管理建议。首先，他们采用大量的历史<a onclick="javascript:tagshow(event, '%CA%FD%BE%DD');" href="javascript:;" target=_self><u><strong><font color=#000000>数据</font></strong></u></a>进行分析，制定出更详细的进度计划；其次，要求东方公司提供详细的开发文档和测试文档（之前William的团队做的工作没有任何文档，给其他工作带来了很多困难）；第三，重新审核开发周期，对里程碑进行细化。<span style="DISPLAY: none">TestAge 中国软件测试时代0Q3}z^3c ^</span></p>
<p><span style="DISPLAY: none">-S4c2\-y1Q+~8\,R</span>&nbsp;&nbsp;&nbsp; 又过了六个月，新的版本完成了。这一次，客户对它的评价比前两个版本高得多，基本上达到项目运行的要求。但客户还是对项目进度提出了疑问，认为实时推出换代产品不需要那么长的时间。<span style="DISPLAY: none">TestAge 中国软件测试时代*Evm2h |N4rvP</span></p>
<p><span style="DISPLAY: none">FqBP N6B QL</span>&nbsp;&nbsp;&nbsp; 软件外包是现在软件工程中较常见的做法。在软件外包工程中，保证<a onclick="javascript:tagshow(event, '%D6%CA%C1%BF');" href="javascript:;" target=_self><u><strong><font color=#000000>质量</font></strong></u></a>的进度是很难控制的。对于项目经理来说需要一整套复杂的能力，比如制定计划、确定优先顺序、干系人的沟通、评价等，每一种能力都与项目的最终结果有直接或者间接的关系。<span style="DISPLAY: none">TestAge 中国软件测试时代$t z5KS#~;w</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代 GT,WE7e,Gf6Df</span>
<p>&nbsp;&nbsp;&nbsp; 然而，国内的项目经理大多没有接受过正规训练，缺乏项目管理方面的专业知识的<a onclick="javascript:tagshow(event, '%BC%BC%C7%C9');" href="javascript:;" target=_self><u><strong><font color=#000000>技巧</font></strong></u></a>，往往只是凭借以前的少量经验盲目去做，容易出现各种问题。尤其是在管理外包项目时，缺乏足够的经验和技巧，往往造成进度不断推迟，而质量无法保证的情况。</p>
<span style="DISPLAY: none">,J\WV.T{%plk]</span>
<p><span style="DISPLAY: none">V'qN`8ij'lX K</span>&nbsp;&nbsp;&nbsp; 前文是一个比较典型的软件外包项目的案例。在这个案例中，我们可以看到现在IT业内许多外包项目的影子。<span style="DISPLAY: none">TestAge 中国软件测试时代L3F9s-a8@/R,t</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代Bg+lU/Q PTh</span>
<p>&nbsp;&nbsp;&nbsp; 在该案例中，东方公司没有专门的项目经理，是由技术人员William兼做管理。这是国内软件公司经常会出现的问题。最初，出现进度落后的问题时，A公司的Henry与东方公司的William讨论后决定采用项目管理中计划管理等手段，其中包括里程碑管理。这是控制进度的较常见做法。</p>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/45910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-06-20 22:09 <a href="http://www.cnitblog.com/xijia0524/archive/2008/06/20/45910.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】如何应对不明需求做好测试</title><link>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45908.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 20 Jun 2008 14:08:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45908.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/45908.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45908.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/45908.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/45908.html</trackback:ping><description><![CDATA[在日常<a onclick="javascript:tagshow(event, '%D0%E8%C7%F3');" href="javascript:;" target=_self><u><strong><font color=#000000>需求</font></strong></u></a>的<a onclick="javascript:tagshow(event, '%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><font color=#000000>测试</font></strong></u></a>过程中，因为时间和资源的相对紧张，往往会遇到PRD不够细致，而UC描述也过于简单的情况，这个时候会让经验不够丰富的测试人员有种无从入手的感觉。其实由于思考方式、对需求的理解程度、<a onclick="javascript:tagshow(event, '%BF%AA%B7%A2');" href="javascript:;" target=_self><u><strong><font color=#000000>开发</font></strong></u></a>和编写UC的经验、以及文字描述的习惯不同，开发人员首次提交的UC，并不一定能立即指导测试人员<a onclick="javascript:tagshow(event, '%B1%E0%D0%B4');" href="javascript:;" target=_self><u><strong><font color=#000000>编写</font></strong></u></a>出一系列相对健壮的TC。<span style="DISPLAY: none">TestAge 中国软件测试时代uiz7tA,w5iY7d#xD</span><br><span style="DISPLAY: none">TestAge 中国软件测试时代;Iz8C&amp;[*O~3LbI#M.b#D</span><br>　　虽然说测试人员有权利退回需求不明的测试任务，但是在遇到&#8220;不得已而为之&#8221;的时候(比如紧急需求)，想办法解决问题，给出需求方建议总是好过什么都不做的退出测试。<span style="DISPLAY: none">TestAge 中国软件测试时代mIvW.xw g</span><br><br><span style="DISPLAY: none">@0w8xyQ8o8W\R</span>　　因此需要在TC编写之前进行UC的评审，而UC的评审过程并不仅仅是一个需求再确认的过程，在评审之前测试人员就应该带着思考(类似于checklist)去尽可能的挖掘UC所覆盖到PRD的点以及所有自己的疑问，并且通过沟通尽早的解决疑问。<br><span style="DISPLAY: none">&amp;A&amp;t s ~ NK V7^9k</span><br><span style="DISPLAY: none">#j(avy;Q*\z</span>　　在这里，我个人想强调一下疑问，因为自己没有疑问并不代表真的没有问题，反而没有疑问才是最大的问题。谁都知道没有什么事物是绝对完美，包括开发人员编写的 UC，测试人员编写的TC，我们做测试不是要追求极致，但是至少要尽可能的降低因为遗漏问题而产生的风险，尽早的发现问题，解决问题。然而没有仔细的推敲和思考很难发现隐藏的问题，所以说没有疑问从某种程度上讲，是我们思考的还不够。举一个最为简单也是最为普遍的例子，我们一定都有过在编写TC过程中才发现有不确定的内容并向开发人员进行确认的经历，从某种角度讲，这就说明了UC的评审过程中，我们有遗漏。所以，只有充分的思考，才有可能捕获疑问，才有可能解决疑问，才有可能降低遗漏。<br><span style="DISPLAY: none">u!~-a\bl</span><br><span style="DISPLAY: none">e(g9D1xKO7SX$S</span>　　说完了疑问，在这里就不得不说一说思考，到底在UC评审之前我们应该思考些什么，或者说到底有哪些内容是我们需要去把握的，个人觉得可以从以下几点着手：<span style="DISPLAY: none">TestAge 中国软件测试时代yOZR&amp;VJ:B G C</span><br><span style="DISPLAY: none">TestAge 中国软件测试时代@*cS FL2A'b</span><br>　　1. 如果说<a onclick="javascript:tagshow(event, '%B9%A6%C4%DC');" href="javascript:;" target=_self><u><strong><font color=#000000>功能</font></strong></u></a>测试更多的是站在用户的角度进行测试，那么我们首先关注的必然是页面的展现。即页面的元素。一张好图胜似千言万语。这句话确实有其道理，所以界面原型图不仅能帮助开发人员省去很多文字上的描述，也避免了在测试过程中针对页面布局引起测试人员和开发人员争议，更能让测试人员建立一个整体的概念。因此，测试人员可以&#8220;提醒&#8221;开发人员提供demo截图，但是并不是每一份UC生成时都有充足的资源来获取demo。无论UC中是否有demo提供，我们真正应该关注的包括两点：一是页面包括哪些元素，是否覆盖了需求，有无冗余。再就是各元素的类型，比如列表、文本框，按钮等等。<span style="DISPLAY: none">TestAge 中国软件测试时代Or lVNh0~9ssf</span><br><span style="DISPLAY: none">TestAge 中国软件测试时代t/|R Dj ]}</span><br>　　2.在确定元素之后，就必须考虑元素对用户的开放性。即用户的访问、操作权限。一般而言，权限的控制往往有三种展现方式：一是通过页面元素的直接屏蔽使无权限的用户不可见，一是无操作权限用户使用时提示没有权限，还有就是对于没有权限的用户操作内容显示为不可用状态。测试人员必须确认UC中有该部分的描述，并确认具体属于哪种形式和其控制方式。否则在编写TC过程中就会出现遗漏，从而会导致bug的遗漏。<br><span style="DISPLAY: none">.N|1ns]i4eL(d6V</span><span style="DISPLAY: none">TestAge 中国软件测试时代3VIlUf3}%`L</span><br>　　3.明确入口。由于<a onclick="javascript:tagshow(event, 'web');" href="javascript:;" target=_self><u><strong><font color=#000000>web</font></strong></u></a>自身的特点，一个页面的访问往往会存在多个入口，每一个入口的前置条件都有可能不同，因此测试人员必须确认所有可到达的路径及其条件。<br><span style="DISPLAY: none">QuEti.Q9T</span><span style="DISPLAY: none">TestAge 中国软件测试时代"j`3f qRC/f</span><br>　　4. 在明确页面布局及元素、权限控制、入口后，我们就应该进一步了解一些具体的操作细节。例如结合demo图(如果有的话)，确定哪些是输入，哪些是输出。而在考虑这些输入和输出的时候我们不光要知道页面展现出来的输入、输出项，一些未展现出来的的输入、输出项，即隐藏的<a onclick="javascript:tagshow(event, '%CA%FD%BE%DD');" href="javascript:;" target=_self><u><strong><font color=#000000>数据</font></strong></u></a>也是测试人员需要了解的。如注册用户，可能我们在页面上只需输入类似用户名、id之类的输入项，当成功后<a onclick="javascript:tagshow(event, '%CF%B5%CD%B3');" href="javascript:;" target=_self><u><strong><font color=#000000>系统</font></strong></u></a>也只是提示操作成功，并返回注册的用户信息页面，而实际上，在注册成功的同时，<a onclick="javascript:tagshow(event, '%CA%FD%BE%DD%BF%E2');" href="javascript:;" target=_self><u><strong><font color=#000000>数据库</font></strong></u></a>里不仅仅只是添加了用户所输入的信息，用户ID，用户创建的时间等信息都是系统自动生成但又不展现给用户的，尽管用户并不关心此类数据，但是测试人员必须了解并且跟踪这些数据。确保数据的正确创建。因为当错误的数据被调用时，就会引发一系列未知的问题。所以测试人员必须关心数据。<span style="DISPLAY: none">TestAge 中国软件测试时代0Y}c8S E@t</span><br><span style="DISPLAY: none">TestAge 中国软件测试时代e Bao dU)A)EL</span><br>　　5.对于输入项，还应明确有无初始值、默认值设置。如果有，就应该考虑是不是需要与&#8220;重置&#8221;操作配合。此外，输入项有无输入控制，如果有，还应该确认对应的异常处理机制，包括提示信息的文案说明。<br><span style="DISPLAY: none">Y8NLhn bp</span><br><span style="DISPLAY: none">(g5g%ofk/M\5pt</span>　　6.对于输出项(返回项)，首先要明确具体有哪些输出，其次需要明确是返回当前页面的操作，还是新窗口。若为前者，就需要考虑输出后是否影响输出前的操作; 若为后者，还需考虑是否能从该页面返回原窗口等等。<br><span style="DISPLAY: none">{.KQ#ka \D'cMW'k2N8F</span><br><span style="DISPLAY: none">#G5sR h1T l m/ME*a</span>　　7.除了关注页面展现，测试人员还应该明确需求实现中涉及的所有表结构，包括表之间的关系。通过表关系，可进一步考虑本次需求可能会影响到的其它需求。并通过比对页面元素，了解页面展现和具体表结构的对应关系，从而确定是否有遗漏和冗余。<span style="DISPLAY: none">TestAge 中国软件测试时代 mwf6GtO6^7vJ8M</span><br><span style="DISPLAY: none">TestAge 中国软件测试时代9]0m zns-r.S:iB</span><br>　　当然，以上这几点可能还很不完整，仅仅是我在近期的日常需求测试过程中的一点感悟，还需要我在<a onclick="javascript:tagshow(event, '%CA%B5%BC%F9');" href="javascript:;" target=_self><u><strong><font color=#000000>实践</font></strong></u></a>的过程中去补充和修正，当然也欢迎大家一起来修正。<br><span style="DISPLAY: none">^T:p/OP</span><span style="DISPLAY: none">TestAge 中国软件测试时代4D5g2FU,T</span><br>　　其实，个人认为带着思考去评审UC或者是编写tc，绝对不止是确认需求和描述自己的操作步骤，通过在跟开发人员的沟通过程中，引导他们一起去思考和去检验自己的<a onclick="javascript:tagshow(event, '%B4%FA%C2%EB');" href="javascript:;" target=_self><u><strong><font color=#000000>代码</font></strong></u></a>，其实也是在测试，这样的行为可以说大大的提高了测试的效率，因为很多问题在测试人员开始执行测试之前都已被开发人员所修正，如此一来，在执行测试的时间里，测试人员就可以更好地聚焦于业务逻辑层的实现，使得测试更为充分。从某种角度讲这也是缺陷的预防。当然，缺陷预防的路还有很长，但是我们不用害怕和沮丧，一点点做起来，一步一个脚印的走下去，目标总会近，如果我们每个人再加把劲，多多分享和共享，那么我相信，我们的团队会走的更快、更好。 
<img src ="http://www.cnitblog.com/xijia0524/aggbug/45908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-06-20 22:08 <a href="http://www.cnitblog.com/xijia0524/archive/2008/06/20/45908.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】测试人员如何赢得开发人员的尊重</title><link>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45907.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 20 Jun 2008 14:07:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45907.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/45907.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/06/20/45907.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/45907.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/45907.html</trackback:ping><description><![CDATA[1开发人员是一个比较单纯的人员,他们衡量一个人价值的方法是你的<a onclick="javascript:tagshow(event, '%BC%BC%CA%F5');" href="javascript:;" target=_self><u><strong><font color=#000000>技术</font></strong></u></a>实力,因此好水平的<a onclick="javascript:tagshow(event, '%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><font color=#000000>测试</font></strong></u></a>人员很容易赢得<a onclick="javascript:tagshow(event, '%BF%AA%B7%A2');" href="javascript:;" target=_self><u><strong><font color=#000000>开发</font></strong></u></a>人员的<a onclick="javascript:tagshow(event, '%D7%F0%D6%D8');" href="javascript:;" target=_self><u><strong><font color=#000000>尊重</font></strong></u></a>
<p><span style="DISPLAY: none">#yNOVg,P1g</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2测试人员赢得开发人员尊重的方法首先是做好自己的工作,即掌握测试方法,并且可以发现<a onclick="javascript:tagshow(event, '%CF%B5%CD%B3');" href="javascript:;" target=_self><u><strong><font color=#000000>系统</font></strong></u></a>的问题(bug)<span style="DISPLAY: none">TestAge 中国<a onclick="javascript:tagshow(event, '%C8%ED%BC%FE');" href="javascript:;" target=_self><u><strong><font color=#000000>软件</font></strong></u></a>测试时代i _QA M7I?</span></p>
<p><span style="DISPLAY: none">YQ;w1WtW</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3测试人员赢得开发人员注重不但要能发现问题,而且可以重现问题,这是一个比较关键的问题,对于不能每次都重新的问题,也要搞清楚什么条件下问题出现的概率比较大</p>
<span style="DISPLAY: none">k9o}]-LY/@1v R</span>
<p><span style="DISPLAY: none">&amp;g"B3F4B U-GI</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4测试人员不但要能发现问题,而且要能描述问题发生时的情况,包括设备情况,系统配置,操作过程,问题出现的情况<span style="DISPLAY: none">TestAge 中国软件测试时代 c6o!wq#`@</span></p>
<p><span style="DISPLAY: none">H1n X r @MC.b}D</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5测试人员会使用<a onclick="javascript:tagshow(event, '%D7%D4%B6%AF%BB%AF');" href="javascript:;" target=_self><u><strong><font color=#000000>自动化</font></strong></u></a>测试<a onclick="javascript:tagshow(event, '%B9%A4%BE%DF');" href="javascript:;" target=_self><u><strong><font color=#000000>工具</font></strong></u></a>,提高测试覆盖率,而自动化测试工具实际是需要编程能力,如果你熟练掌握这些工具说明和开发人员已经没有本质的区别</p>
<span style="DISPLAY: none">M.Fy-U*{'brxC</span><span style="DISPLAY: none">TestAge 中国软件测试时代+X zY O [</span>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6测试人员掌握开发人员不掌握的技能,比如<a onclick="javascript:tagshow(event, '%D0%D4%C4%DC%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><font color=#000000>性能测试</font></strong></u></a>的原理\方法\工具,这些东西在<a onclick="javascript:tagshow(event, '%CF%EE%C4%BF');" href="javascript:;" target=_self><u><strong><font color=#000000>项目</font></strong></u></a>前期的技术验证都可以给开发人员提供很大的帮助,<span style="DISPLAY: none">TestAge 中国软件测试时代5W*Qh}1`h#g#m0]</span></p>
<span style="DISPLAY: none">TestAge 中国软件测试时代4N-hE3prd</span>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7测试人员要了解系统架构等开发方面的知识,这些知识不是开发人员所独有的,作为高级测试人员这些知识是必备,这些知识的掌握不但可以提高测试人员的技术水平,而且缩小了测试人员和开发人员差距<span style="DISPLAY: none">TestAge 中国软件测试时代~vj0C&amp;r%? X,\5O|Hh</span></p>
<p><span style="DISPLAY: none">c"EP ~0|%DL!T1\_n</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8测试人员要掌握软件<a onclick="javascript:tagshow(event, '%D6%CA%C1%BF');" href="javascript:;" target=_self><u><strong><font color=#000000>质量</font></strong></u></a>保证的知识,测试的高级阶段就是软件质量保证,而软件质量保证会含盖开发的全过程,掌握软件质量保证实际从项目的<a onclick="javascript:tagshow(event, '%D0%E8%C7%F3');" href="javascript:;" target=_self><u><strong><font color=#000000>需求</font></strong></u></a>阶段就可以参与开发,另外多说一句,很多公司质量保证和测试实际是不分家的<span style="DISPLAY: none">TestAge 中国软件测试时代x'P!c ^'IHv Jv</span></p>
<p><span style="DISPLAY: none">$^Q)}){` n</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9掌握开发技术,测试人员如果掌握开发技术,实际上增强了bug查找和定位能力,很多时候,有经验的测试人员可以通过bug表现形式说出问题发生的原因,这没有什么新鲜的,如果你有开发经验,这些问题估计就是你犯过的错误,或者是你长期测试积累的知识,<span style="DISPLAY: none">TestAge 中国软件测试时代T1V2A'w(_\R1M5C'O</span></p>
<p><span style="DISPLAY: none">(j,X*v$Y+C6B8h~$Z {;R#b</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 你要有了以上几点能力,还怕开发人员不尊重你这个测试人员吗?<span style="DISPLAY: none">TestAge 中国软件测试时代7up1E#nIl+J-F</span></p>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/45907.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-06-20 22:07 <a href="http://www.cnitblog.com/xijia0524/archive/2008/06/20/45907.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】 几种主流测试工具的测试流程</title><link>http://www.cnitblog.com/xijia0524/archive/2008/05/16/43814.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 16 May 2008 09:12:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/05/16/43814.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/43814.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/05/16/43814.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/43814.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/43814.html</trackback:ping><description><![CDATA[========winrunner<br>1　启动时选择要加载的插件<br>2　进行一些设置（如录制模式等）<br>3　识别应用程序的GUI，即创建map(就是<a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%D1%A7%CF%B0');"><u><strong><font color=#0000ff>学习</font></strong></u></a>被<a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, '%B2%E2%CA%D4');"><u><strong><font color=#0000ff>测试</font></strong></u></a>软件的界面）<br>4　建立测试脚本（录制及编写）<br>5　对脚本除错及调试（保证能够运行完）<br>6　插入各种检查点（图片，文字，控件等）<br>7　在新版应用程序中执行测试脚本<br>8　分析结果，回报缺陷<br>　<br>=========quicktestpro========<br>1　准备录制<br>打开你要对其进行测试的应用程序，并检查QuickTest中的各项设置是否适合当前的要求。<br>2　进行录制<br>打开QuickTest的录制功能，按测试用例中的描述，操作被测试应用程序。<br>3　编辑测试脚本<br>通过加入检测点、参数化测试，以及添加分支、循环等控制语句，来增强测试脚本的功能，使将来的回归测试真正能够自动化。<br>4　调试脚本<br>调试脚本，检查脚本是否存在错误。<br>5　在回归测试中运行测试<br>在对应用程序的回归测试中，通过QuickTest回放对应用程序的操作，检验软件正确性，实现测试的自动化进行。<br>6　分析结果，报告问题<br>查看QuickTest记录的运行结果，记录问题，报告测试结果。<br><br>＝＝＝＝TestDirect============<br>安装好后，先进入站点管理<br>1　创建域及工程<br>2　添加用户<br>3　编辑licenses及本服务器<br>4　编辑数据库<br>－－TD<br>1　选择新建的工程进行定制(列表，用户，组，版本等)<br>2　在require中增加需求<br>3　把需求转化为plan<br>4 在testlab中由计划新建测试具体用例与执行<br>5　发现bug，在defect中提交bug<br>（每一部分都可以相对独立地使用）<br>======loadrunner<br>1　制定负载测试计划<br>(分析应用程序， 确定测试目标，计划怎样执行<a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, 'LoadRunner');"><u><strong><font color=#0000ff>LoadRunner</font></strong></u></a>）<br>2　开发测试脚本<br>（录制基本的用户脚本，完善测试脚本）<br>3　创建运行场景<br>（选择场景类型为Manual Scenario，选择场景类型，理解各种类型，场景的类型转化）<br>4　运行测试<br>5　监视场景<br>（MEMORY 相关，PROCESSOR相关，网络吞量以及带宽，磁盘相关，WEB应用程序 ，IIS5.0，<a href="http://www.51testing.com/javascrīpt:;" target=_self ōnclick="javascrīpt:tagshow(event, 'SQL');"><u><strong><font color=#0000ff>SQL</font></strong></u></a> SERVER，NETWORK DELAY等)<br>6　分析测试结果<br>(分析实时监视图表,分析事务的响应时间,分解页面,确定WEBSERVER的问题,其他有用的功能)<br>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/43814.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-05-16 17:12 <a href="http://www.cnitblog.com/xijia0524/archive/2008/05/16/43814.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】 什么是大型项目经验</title><link>http://www.cnitblog.com/xijia0524/archive/2008/03/31/41733.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 31 Mar 2008 08:01:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/03/31/41733.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/41733.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/03/31/41733.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/41733.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/41733.html</trackback:ping><description><![CDATA[昨天有一个<a onclick="javascript:tagshow(event, '%BC%BC%CA%F5');" href="javascript:;" target=_self><u><strong><font color=#0000ff>技术</font></strong></u></a>人员问我，什么才算大型项目经验。因为经常看到招聘启事上要求应聘人员要&#8220;具备大型项目经验&#8221;，但怎样才算大型项目，经验主要是哪方面的内容。这个技术人员<a onclick="javascript:tagshow(event, '%B9%A4%D7%F7');" href="javascript:;" target=_self><u><strong><font color=#0000ff>工作</font></strong></u></a>时间不长，对此也没有什么感觉。<br>　　我觉得所谓&#8220;大型项目经验&#8221;也没有一个严格的范畴。首先看怎么定位大型项目。在不同的行业领域，大型项目的标准也是不一样的。在我所做过的税务信息系统项目里，目前一般情况下，如果项目成员在五十人以上，项目投资金额在七八百万的以上的信息系统工程，就算是大型项目了。但之所以单独提大型项目，并不主要在于它的规模有多大，而是因为在这样的项目中所独有的一些项目特征，一般在小项目中没有的因素，而这些因素对项目管理、技术等方面非常有价值，所以才备受重视。我觉得关注大型项目经验，主要关注以下几点特征：<br>　　1。项目组织结构。大型项目组织是讲究精细量化，职责明确的。职责组织一般分项目负责人、项目经理、系统分析师、技术经理、开发组长、开发工程师、<a onclick="javascript:tagshow(event, '%CA%FD%BE%DD%BF%E2');" href="javascript:;" target=_self><u><strong><font color=#0000ff>数据库</font></strong></u></a>工程师、<a onclick="javascript:tagshow(event, '%B2%E2%CA%D4');" href="javascript:;" target=_self><u><strong><font color=#0000ff>测试</font></strong></u></a>工程师、运维工程师等，各个角色之间责任明确，互相配合监督。不同环境下，还要包括政策组、业务组、推广实施组等职能岗位，如果有子项目外包等情况，那组织就更复杂了。参与过大项目的工程师，应当对组织结构有大致的了解和体会。<br>　　2。项目进度管理：大型项目一般都有比较明确的里程碑计划；每两个里程碑之间一般又设置若干检查点，阶段性任务比较明确；需求分析、概要设计、详细设计、编码测试、上线试运行等每个阶段都有阶段性的任务和目标；需求的变更，集成发布等事项都有严格的流程，有专门的组织或人员进行审核和执行；对于成本、质量、进度情况都有明确的量化和阶段报告。<br>　　3。项目的沟通：很多工作都涉及到跨部门或组织之间的沟通协作。大型项目组里有成熟的沟通机制，上下级之间，平级之间的沟通，虽然复杂但有效，因为这是大家都认可的一种机制。根据沟通问题的重要性，可采取会议、电话、邮件等形式，成果有会议机要，报告等内容。大型项目里的沟通机制，虽然效率不一定高，但的确能解决问题。<br>　　4。有关技术架构：架构体系是大型项目的技术特征。一个好的架构对项目成败的意义不言而喻。在成熟的架构体系上，一般的开发人员没有多少可发挥的余地。架构师是项目里的NB人物，架构甚至在某些程度上影响业务需求和操作模式，目前流行&#8220;架构为王&#8221;的说法。<br>　　5。项目文档：文档在项目中起重要作用，包括过程、成果、控制信息等，文档是将来项目验收的重要成果和依据。文档的管理在大项目中也是制关重要，一般都有VSS、CVS等文档管理工具。从技术人员的角度出发，相关的文档最起码包括总体开发计划、周计划、工作日报、周报等。当然，文档多了以后也带来很多成本等方面问题，这也是大型项目的一个特点。<br>　　另外大型项目还涉及<a onclick="javascript:tagshow(event, '%C5%E4%D6%C3%B9%DC%C0%ED');" href="javascript:;" target=_self><u><strong><font color=#0000ff>配置管理</font></strong></u></a>、风险管理等方面的内容。但作为一个最基础的技术人员，了解了以上几点，就已经不错了，为将来的个人发展打好了基础。<br>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/41733.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-03-31 16:01 <a href="http://www.cnitblog.com/xijia0524/archive/2008/03/31/41733.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《LoadRunner 没有告诉你的》之二——描述性统计与性能结果分析（续） </title><link>http://www.cnitblog.com/xijia0524/archive/2008/03/25/41459.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Tue, 25 Mar 2008 09:54:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/03/25/41459.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/41459.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/03/25/41459.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/41459.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/41459.html</trackback:ping><description><![CDATA[<span>&nbsp;
<p>&nbsp;</p>
<div>
<div>
<p><strong><span>版权声明</span></strong><span>：本文可以被转载，但是在未经本人许可前，不得用于任何商业用途或其他以盈利为目的的用途。本人保留对本文的一切权利。如需转载，请在转载是保留此版权声明，并保证本文的完整性。也请转贴者理解创作的辛劳，尊重作者的劳动成果。</span></p>
<p><span>作者：陈雷</span><span><font face=Arial> (Jackei)</font></span></p>
<p><span>邮箱：</span><span><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#106;&#97;&#99;&#107;&#101;&#105;&#99;&#104;&#97;&#110;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;"><font face=Arial>jackeichan@gmail.com</font></a></span></p>
<p><span><font face=Arial>Blog</font></span><span>：</span><span><a href="http://jackei.cnblogs.com/"><font face=Arial>http://jackei.cnblogs.com</font></a></span></p>
</div>
<p><span><font face=Arial>&nbsp;</font></span><br></p>
</div>
<p>数据统计分析的思路与分析结果的展示方式是同样重要的，有了好的分析思路，但是却不懂得如何更好的展示分析结果和数据来印证自己的分析，就像一个人满腹经纶却不知该如何一展雄才</p>
</span><span>^_^</span>
<p>&nbsp;</p>
<p><span>一图胜千言，所以这次我会用两张图表来说明&#8220;描述性统计&#8221;在性能测试结果分析中的其他应用。</span></p>
<p>&nbsp;</p>
<span>
<p><img height=506 alt="" src="http://www.cnblogs.com/images/cnblogs_com/jackei/22605/o_modified-001.jpg" width=765 border=0><br></p>
<p>在这张图中，我们继续使用了上一篇文章——<a href="http://www.cnblogs.com/jackei/archive/2006/11/11/557972.html">《描述性统计与结果分析》</a>一文中的方法，对响应时间的分布情况来进行分析。上面这张图所使用的数据是通过对</p>
</span><span>Google.com </span><span>首页进行测试得来的，在测试中分别使用</span><span>10/25/50/75/100 </span><span>几个不同级别的并发用户数量。通过这张图表，我们可以通过横向比较和纵向比较，更清晰的了解到被测应用在不同级别的负载下的响应能力。<br>
<p>&nbsp;</p>
</span>
<p>&nbsp;</p>
<p><span><img height=482 alt="" src="http://www.cnblogs.com/images/cnblogs_com/jackei/22605/o_modified-002.jpg" width=717 border=0></span></p>
<p><span>这张图所使用的数据与第一张图一样，但是我们使用了另外一个视角来对数据进行展示。表中最左侧的</span><span>2000/5000/10000/50000</span><span>的单位是毫秒，分别表示了在整个测试过程中，响应时间在</span><span>0-2000</span><span>毫秒范围内的事务数量占成功的事务总数的百分比，响应时间在</span><span>2001-5000</span><span>毫秒范围内的事务数量占成功的事务总数的百分比，响应时间在</span><span>5001-10000</span><span>毫秒范围内的事务数量占成功的事务总数的百分比，以及响应时间在</span><span>10001-50000</span><span>毫秒范围内的事务数量占成功的事务总数的百分比。</span></p>
<p><span>这几个时间范围的确定是参考了业内比较通行的&#8220;</span><span>2-5-10</span><span>原则&#8221;——当然你也可以为自己的测试制定其他标准，只要得到企业内的承认就可以。所谓的&#8220;</span><span>2-5-10</span><span>原则&#8221;，简单说，就是当用户能够在</span><span>2</span><span>秒以内得到响应时，会感觉系统的响应很快；当用户在</span><span>2-5</span><span>秒之间得到响应时，会感觉系统的响应速度还可以；当用户在</span><span>5-10</span><span>秒以内得到响应时，会感觉系统的响应速度很慢，但是还可以接受；而当用户在超过</span><span>10</span><span>秒后仍然无法得到响应时，会感觉系统糟透了，或者认为系统已经失去响应，而选择离开这个</span><span>Web</span><span>站点，或者发起第二次请求。</span></p>
<p><span>那么从上面的图表中可以看到，当并发用户数量为</span><span>10</span><span>时，超过</span><span>95</span><span>％的用户都可以在</span><span>5</span><span>秒内得到响应；当并发用户数量达到</span><span>25</span><span>时，已经有</span><span>80</span><span>％的事务的响应时间处在危险的临界值，而且有相当数量的事务的响应时间超过了用户可以容忍的限度；随着并发用户数量的进一步增加，超过用户容忍限度的事务越来越多，当并发用户数到达</span><span>75</span><span>时，系统几乎已经无法为任何用户提供响应了。</span></p>
<p><span>这张图表也同样可以用于对不同负载下事务的成功、失败比例的比较分析。</span></p>
<p>&nbsp;</p>
<p><span>Note</span><span>：上面两个图表中的数据，主要通过</span><span>Excel </span><span>中提供的</span><span>FREQUENCY</span><span>，</span><span>AVERAGE</span><span>，</span><span>MAX</span><span>，</span><span>MIN</span><span>和</span><span>PERCENTILE</span><span>几个统计函数获得，具体的使用方法请参考</span><span>Excel</span><span>帮助手册。</span></p>
<br>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/41459.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-03-25 17:54 <a href="http://www.cnitblog.com/xijia0524/archive/2008/03/25/41459.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】《LoadRunner 没有告诉你的》之三——理发店模型 </title><link>http://www.cnitblog.com/xijia0524/archive/2008/03/25/41458.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Tue, 25 Mar 2008 09:52:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2008/03/25/41458.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/41458.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2008/03/25/41458.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/41458.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/41458.html</trackback:ping><description><![CDATA[<div>
<p><strong><span>版权声明</span></strong><span>：本文可以被转载，但是在未经本人许可前，不得用于任何商业用途或其他以盈利为目的的用途。本人保留对本文的一切权利。如需转载，请在转载是保留此版权声明，并保证本文的完整性。也请转贴者理解创作的辛劳，尊重作者的劳动成果。</span></p>
<p><span>作者：陈雷</span><span><font face=Arial> (Jackei)</font></span></p>
<p><span>邮箱：</span><span><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#106;&#97;&#99;&#107;&#101;&#105;&#99;&#104;&#97;&#110;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;"><font face=Arial>jackeichan@gmail.com</font></a></span></p>
<p><span><font face=Arial>Blog</font></span><span>：</span><span><a href="http://jackei.cnblogs.com/"><font face=Arial>http://jackei.cnblogs.com</font></a></span></p>
</div>
<p><span><font face=Arial>&nbsp;<br></font></span></p>
<span><font face=Arial>
<p><span>大概在一年前的一次讨论中，我的好友陈华第一次提到了这个模型的最初版本，经过几次讨论后，我们发现经过完善和扩展的&#8220;理发店模型&#8221;可以用来帮助我们理解很多性能测试的概念和理论，以及一些测试中遇到的问题。在最近的一次讨论后，我决定撰写一篇文章来专门讲述一下这个模型，希望可以帮助大家更好的理解性能测试有关的知识。</span></p>
<p><span>不过，在这篇文章中，我将会尽量的只描述模型本身以及相关的一些扩展，而具体如何将这个模型完全同性能测试关联起来，我不会全部说破，留下足够的空间让大家继续思考和总结，最好也一起来对这个模型做进一步的完善和扩展</span><span>^_^ </span><span>我相信，当大家在思考的过程中有所收获并有所突破时，那种快感和收获的喜悦才真的是让人倍感振奋而且终生难忘的</span><span> ^_^</span></p>
<p><span>当然，我要说明的是，这个模型仅仅是</span><span>1</span><span>个模型，它与大家实际工作中遇到的各式各样的情况未必都可以一一对应，但是大的方向和趋势应该是一致的。</span></p>
<p><strong>&nbsp;</strong></p>
<p><strong><span><a href="http://www.cnblogs.com/jackei/admin/EditPosts.aspx?postid=565527#_%E7%90%86%E5%8F%91%E5%BA%97%E6%A8%A1%E5%9E%8B"><span>理发店模型</span></a></span></strong></p>
<p><strong><span><a href="http://www.cnblogs.com/jackei/admin/EditPosts.aspx?postid=565527#_%E8%BF%9B%E4%B8%80%E6%AD%A5%E7%90%86%E8%A7%A3%E2%80%9C%E6%9C%80%E4%BD%B3%E5%B9%B6%E5%8F%91%E7%94%A8%E6%88%B7%E6%95%B0%E2%80%9D%E5%92%8C%E2%80%9C%E6%9C%80%E5%A4%A7%E5%B9%B6%E5%8F%91%E7%94%A8%E6%88%B7%E6%95%B0%E2%80%9D"><span>进一步理解&#8220;最佳并发用户数&#8221;和&#8220;最大并发用户数&#8221;</span></a></span></strong></p>
<p><strong><span><a href="http://www.cnblogs.com/jackei/admin/EditPosts.aspx?postid=565527#_%E7%90%86%E5%8F%91%E5%BA%97%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%BF%9B%E4%B8%80%E6%AD%A5%E6%89%A9%E5%B1%95"><span>理发店模型的进一步扩展</span></a></span></strong></p>
<p><strong><span><a href="http://www.cnblogs.com/jackei/admin/EditPosts.aspx?postid=565527#_%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span>相关资料</span></a></span></strong></p>
<p>&nbsp;</p>
<h2><a name=_理发店模型></a>
<p><span>相信大家都进过或见过理发店，一间或大或小的铺面，</span><span>1</span><span>个或几个理发师，几张理发用的椅子和供顾客等待的长条板凳。</span></p>
<p>&nbsp;</p>
<span>
<p><img height=480 alt="" src="http://www.cnblogs.com/images/cnblogs_com/jackei/22605/o_Tom%20Quick%20barbershop.jpg" width=338 border=0></p>
<p>在我们的这个理发店中，我们事先做了如下的假设：</p>
</span>
<p>&nbsp;</p>
<p><span><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>理发店共有</span><span>3</span><span>名理发师；</span></p>
<p><span><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>每位理发师剪一个发的时间都是</span><span>1</span><span>小时；</span></p>
<p><span><span>3.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>我们顾客们都是很有时间观念的人而且非常挑剔，他们对于每次光顾理发店时所能容忍的等待时间</span><span>+</span><span>剪发时间是</span><span>3</span><span>小时，而且等待时间越长，顾客的满意度越低。如果</span><span>3</span><span>个小时还不能剪完头发，我们的顾客会立马生气的走人。</span></p>
<p>&nbsp;</p>
<p><span>通过上面的假设我们不难想象出下面的场景：</span></p>
<p><span><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>当理发店内只有</span><span>1</span><span>位顾客时，只需要有</span><span>1</span><span>名理发师为他提供服务，其他两名理发师可能继续等着，也可能会帮忙打打杂。</span><span>1</span><span>小时后，这位顾客剪完头发出门走了。那么在这</span><span>1</span><span>个小时里，整个理发店只服务了</span><span>1</span><span>位顾客，这位顾客花费在这次剪发的时间是</span><span>1</span><span>小时；</span></p>
<p><span><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>当理发店内同时有两位顾客时，就会同时有两名理发师在为顾客服务，另外</span><span>1</span><span>位发呆或者打杂帮忙。仍然是</span><span>1</span><span>小时后，两位顾客剪完头发出门。在这</span><span>1</span><span>小时里，理发店服务了两位顾客，这两位顾客花费在剪发的时间均为</span><span>1</span><span>小时；</span></p>
<p><span><span>3.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>很容易理解，当理发店内同时有三位顾客时，理发店可以在</span><span>1</span><span>小时内同时服务三位顾客，每位顾客花费在这次剪发的时间仍然是均为</span><span>1</span><span>小时；</span></p>
<p><span>从上面几个场景中我们可以发现，在理发店同时服务的顾客数量从</span><span>1</span><span>位增加到</span><span>3</span><span>位的过程中，随着顾客数量的增多，理发店的整体工作效率在提高，但是每位顾客在理发店内所呆的时间并未延长。</span></p>
<p><span>当然，我们可以假设当只有</span><span>1</span><span>位顾客和</span><span>2</span><span>位顾客时，空闲的理发师可以帮忙打杂，使得其他理发师的工作效率提高，并使每位顾客的剪发时间小于</span><span>1</span><span>小时。不过即使根据这个假设，虽然随着顾客数量的增多，每位顾客的服务时间有所延长，但是这个时间始终还被控制在顾客可接受的范围之内，并且顾客是不需要等待的。</span></p>
<p><span>不过随着理发店的生意越来越好，顾客也越来越多，新的场景出现了。假设有一次顾客</span><span>A</span><span>、</span><span>B</span><span>、</span><span>C</span><span>刚进理发店准备剪发，外面一推门又进来了顾客</span><span>D</span><span>、</span><span>E</span><span>、</span><span>F</span><span>。因为</span><span>A</span><span>、</span><span>B</span><span>、</span><span>C</span><span>三位顾客先到，所以</span><span>D</span><span>、</span><span>E</span><span>、</span><span>F</span><span>三位只好坐在长板凳上等着。</span><span>1</span><span>小时后，</span><span>A</span><span>、</span><span>B</span><span>、</span><span>C</span><span>三位剪完头发走了，他们每个人这次剪发所花费的时间均为</span><span>1</span><span>小时。可是</span><span>D</span><span>、</span><span>E</span><span>、</span><span>F</span><span>三位就没有这么好运，因为他们要先等</span><span>A</span><span>、</span><span>B</span><span>、</span><span>C</span><span>三位剪完才能剪，所以他们每个人这次剪发所花费的时间均为</span><span>2</span><span>小时——包括等待</span><span>1</span><span>小时和剪发</span><span>1</span><span>小时。</span></p>
<p><span>通过上面这个场景我们可以发现，对于理发店来说，都是每小时服务三位顾客——第</span><span>1</span><span>个小时是</span><span>A</span><span>、</span><span>B</span><span>、</span><span>C</span><span>，第二个小时是</span><span>D</span><span>、</span><span>E</span><span>、</span><span>F</span><span>；但是对于顾客</span><span>D</span><span>、</span><span>E</span><span>、</span><span>F</span><span>来说，&#8220;响应时间&#8221;延长了。如果你可以理解上面的这些场景，就可以继续往下看了。</span></p>
<p><span>在新的场景中，我们假设这次理发店里一次来了</span><span>9</span><span>位顾客，根据我们上面的场景，相信你不难推断，这</span><span>9</span><span>位顾客中有</span><span>3</span><span>位的&#8220;响应时间&#8221;为</span><span>1</span><span>小时，有</span><span>3</span><span>位的&#8220;响应时间&#8221;为</span><span>2</span><span>小时（等待</span><span>1</span><span>小时</span><span>+</span><span>剪发</span><span>1</span><span>小时），还有</span><span>3</span><span>位的&#8220;响应时间&#8221;为</span><span>3</span><span>小时（等待</span><span>2</span><span>小时</span><span>+</span><span>剪发</span><span>1</span><span>小时）——已经到达用户所能忍受的极限。假如在把这个场景中的顾客数量改为</span><span>10</span><span>，那么我们已经可以断定，一定会有</span><span>1</span><span>位顾客因为&#8220;响应时间&#8221;过长而无法忍受，最终离开理发店走了。</span></p>
<p><span>我想并不需要特别说明，大家也一定可以把上面的这些场景跟性能测试挂上钩了。如果你还是觉得比较抽象，继续看下面的这张图</span><span> ^_^<br><br></span></p>
<p>&nbsp;</p>
<p><span><img height=592 alt="" src="http://www.cnblogs.com/images/cnblogs_com/jackei/33219/o_modified-001.jpg" width=942 border=0></span></p>
<p><span>这张图中展示的是</span><span>1</span><span>个标准的软件性能模型。在图中有三条曲线，分别表示<strong>资源的利用情况</strong>（</span><strong><span>Utilization</span></strong><span>，包括硬件资源和软件资源）、<strong>吞吐量</strong>（</span><strong><span>Throughput</span></strong><span>，这里是指每秒事务数）以及<strong>响应时间</strong>（</span><strong><span>Response Time</span></strong><span>）。图中坐标轴的横轴从左到右表现了<strong>并发用户数</strong>（</span><strong><span>Number of Concurrent Users</span></strong><span>）的不断增长。</span></p>
<p><span>在这张图中我们可以看到，最开始，随着并发用户数的增长，资源占用率和吞吐量会相应的增长，但是响应时间的变化不大；不过当并发用户数增长到一定程度后，资源占用达到饱和，吞吐量增长明显放缓甚至停止增长，而响应时间却进一步延长。如果并发用户数继续增长，你会发现软硬件资源占用继续维持在饱和状态，但是吞吐量开始下降，响应时间明显的超出了用户可接受的范围，并且最终导致用户放弃了这次请求甚至离开。</span></p>
<p><span>根据这种性能表现，图中划分了三个区域，分别是</span><strong><span>Light Load</span></strong><span>（较轻的压力）、</span><strong><span>Heavy Load</span></strong><span>（较重的压力）和</span><strong><span>Buckle Zone</span></strong><span>（用户无法忍受并放弃请求）。在</span><span>Light Load</span><span>和</span><span>Heavy Load </span><span>两个区域交界处的并发用户数，我们称为&#8220;<strong>最佳并发用户数（</strong></span><strong><span>The Optimum Number of Concurrent Users</span></strong><strong><span>）</span></strong><span>&#8221;，而</span><span>Heavy Load</span><span>和</span><span>Buckle Zone</span><span>两个区域交界处的并发用户数则称为&#8220;<strong>最大并发用户数（</strong></span><strong><span>The Maximum Number of Concurrent Users</span></strong><strong><span>）</span></strong><span>&#8221;。</span></p>
<p><span>当系统的负载等于最佳并发用户数时，系统的整体效率最高，没有资源被浪费，用户也不需要等待；当系统负载处于最佳并发用户数和最大并发用户数之间时，系统可以继续工作，但是用户的等待时间延长，满意度开始降低，并且如果负载一直持续，将最终会导致有些用户无法忍受而放弃；而当系统负载大于最大并发用户数时，将注定会导致某些用户无法忍受超长的响应时间而放弃。</span></p>
<p><span>对应到我们上面理发店的例子，每小时</span><span>3</span><span>个顾客就是这个理发店的最佳并发用户数，而每小时</span><span>9</span><span>个顾客则是它的最大并发用户数。当每小时都有</span><span>3</span><span>个顾客到来时，理发店的整体工作效率最高；而当每小时都有</span><span>9</span><span>个顾客到来时，前几个小时来的顾客还可以忍受，但是随着等待的顾客人数越来越多，等待时间越来越长，最终还是会有顾客无法忍受而离开。同时，随着理发店里顾客人数的增多和理发师工作时间的延长，理发师会逐渐产生疲劳，还要多花一些时间来清理环境和维持秩序，这些因素将最终导致理发师的工作效率随着顾客人数的增多和工作的延长而逐渐的下降，到最后可能要</span><span>1.5</span><span>小时甚至</span><span>2</span><span>个小时才能剪完</span><span>1</span><span>个发了。</span></p>
<p><span>当然，如果一开始就有</span><span>10</span><span>个顾客到来，则注定有</span><span>1</span><span>位顾客剪不到头发了。</span></p>
<p>&nbsp;</p>
<h2><a name=_进一步理解&#8220;最佳并发用户数&#8221;和&#8220;最大并发用户数&#8221;></a><font size=3><span>进一步理解&#8220;最佳并发用户数&#8221;和&#8220;最大并发用户数&#8221;</span></font></h2>
<p><span>在上一节中，我们详细的描述了并发用户数同资源占用情况、吞吐量以及响应时间的关系，并且提到了两个新的概念——&#8220;<strong>最佳并发用户数（</strong></span><strong><span>The Optimum Number of Concurrent Users</span></strong><strong><span>）</span></strong><span>&#8221;和&#8220;<strong>最大并发用户数（</strong></span><strong><span>The Maximum Number of Concurrent Users</span></strong><strong><span>）</span></strong><span>&#8221;。在这一节中，我们将对&#8220;最佳并发用户数&#8221;和&#8220;最大并发用户数&#8221;的定义做更加清晰和明确的说明。</span></p>
<p><span>对于一个确定的被测系统来说，在某个具体的软硬件环境下，它的&#8220;最佳并发用户数&#8221;和&#8220;最大并发用户数&#8221;都是客观存在。以&#8220;最佳并发用户数&#8221;为例，假如一个系统的最佳并发用户数是</span><span>50</span><span>，那么一旦并发量超过这个值，系统的吞吐量和响应时间必然会</span><span> </span><span>&#8220;此消彼长&#8221;；如果系统负载长期大于这个数，必然会导致用户的满意度降低并最终达到一种无法忍受的地步。所以我们应该</span><span> </span><strong><span>保证最佳并发用户数要大于系统的平均负载</span></strong><span>。</span></p>
<p><span>要补充的一点是，当我们需要对一个系统长时间施加压力——例如连续加压</span><span>3-5</span><span>天，来验证系统的可靠性或者说稳定性时，我们所使用的并发用户数应该等于或小于&#8220;最佳并发用户数&#8221;——大家也可以结合上面的讨论想想这是为什么</span><span> ^_^</span></p>
<p><span>而对于最大并发用户数的识别，需要考虑和鉴别一下以下两种情况：</span></p>
<p><span><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>当系统的负载达到最大并发用户数后，响应时间超过了用户可以忍受的最大限度——这个限度应该来源于性能需求，例如：在某个级别的负载下，系统的响应时间应该小于</span><span>5</span><span>秒。这里容易疏忽的一点是，不要把顾客因为无法忍受而离开时店内的顾客数量作为理发店的&#8220;最大并发用户数&#8221;，因为这位顾客是在</span><span>3</span><span>小时前到达的，也就是说</span><span>3</span><span>小时前理发店内的顾客数量才是我们要找的&#8220;最大并发用户数&#8221;。而且，这位顾客的离开只是一个开始，可能有会更多的顾客随后也因为无法忍受超长的等待时间而离开；</span></p>
<p><span><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span>在响应时间还没有到达用户可忍受的最大限度前，有可能已经出现了用户请求的失败。以理发店模型为例，如果理发店只能容纳</span><span>6</span><span>位顾客，那么当</span><span>7</span><span>位顾客同时来到理发店时，虽然我们可以知道所有顾客都能在可容忍的时间内剪完头发，但是因为理发店容量有限，最终只好有一位顾客打道回府，改天再来。</span></p>
<p><span>对于一个系统来说，我们应该</span><span> </span><strong><span>确保系统的最大并发用户数要大于系统需要承受的峰值负载</span></strong><span>。</span></p>
<p><span>如果你已经理解了上面提到的全部的概念，我想你可以展开进一步的思考，回头看一下自己以往做过的性能测试，看看是否可以对以往的工作产生新的理解。也欢迎大家在这里提出自己的心得或疑惑，继续讨论下去。</span></p>
<p>&nbsp;</p>
<h2><a name=_理发店模型的进一步扩展></a><span><font size=3>理发店模型的进一步扩展</font></span></h2>
<p><span>这一节中我会提到一些对理发店模型的扩展，当然，我依然是只讲述现实中的理发店的故事，至于如何将这些扩展同性能测试以及性能解决方案等方面关联起来，就留给大家继续思考了</span><span> ^_^</span></p>
<p><strong><span>扩展场景</span></strong><strong><span>1</span></strong><span>：有些顾客已经是理发店的老顾客，他们和理发师已经非常熟悉，理发师可以不用花费太多时间沟通就知道这位顾客的想法。并且理发师对这位顾客的脑袋的形状也很熟悉，所以可以更快的完成一次理发的工作。</span></p>
<p><strong><span>扩展场景</span></strong><strong><span>2</span></strong><span>：理发店并不是只有剪发一种业务，还提供了烫发染发之类的业务，那么当顾客提出新的要求时，理发师服务一位顾客的时间可能会超过标准的</span><span>1</span><span>小时。而且这时如果要计算每位顾客的等待时间就变得复杂了很多，有些顾客的排队时间会比原来预计的延长，并最终导致他们因为无法忍受而离开。</span></p>
<p><strong><span>扩展场景</span></strong><strong><span>3</span></strong><span>：随着烫发和染发业务的增加，理发师们决定分工，两位专门剪发，一位专门负责烫发和染发。</span></p>
<p><strong><span>扩展场景</span></strong><strong><span>4</span></strong><span>：理发店的生意越来越好，理发师的数量和理发店的门面已经无法满足顾客的要求，于是理发店的老板决定在旁边再开一家店，并招聘一些工作能力更强的理发师。</span></p>
<p><strong><span>扩展场景</span></strong><strong><span>5</span></strong><span>：理发店的生意变得极为火爆了，两家店都无法满足顾客数量增长的需求，并且有些顾客开始反映到理发店的路途太远，到了以后又因为烫发和染发的人太多而等太久。可是理发店的老板也明白烫发和染发的收入要远远高于剪发阿，于是他脑筋一转，决定继续改变策略，在附近的几个大型小区租用小的铺面开设分店，专职剪发业务；再在市区的繁华路段开设旗舰店，专门为烫发、染发的顾客，以及</span><span>VIP</span><span>顾客服务。并增设</span><span>800</span><span>电话，当顾客想要剪发时，可以拨打这个电话，并由服务人员根据顾客的居住地点，将其指引到距离最近的一家分店去。</span></p>
<p>&nbsp;</p>
<p><span>这篇文章就先写到这里了，希望大家在看完之后可以继续思考一下，也写出自己的心得体会或者新的想法，记下自己的不解和疑惑，让我们在不断的交流和讨论中走的更远</span><span> ^_^</span></p>
<p>&nbsp;</p>
<h2><a name=_参考资料></a><span><font size=3>参考资料</font></span></h2>
<p><span><a href="http://www.cnblogs.com/jackei/archive/2006/10/12/527026.html"><span>性能测试相关术语的英文书写方法（不断更新ing）——</span></a>知道了这些术语在英文中的正确书写方法之后，可以通过</span><span> Google </span><span>更加高效的获取到更多有用的资料。<br></span></p>
</font></span></h2>
<img src ="http://www.cnitblog.com/xijia0524/aggbug/41458.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2008-03-25 17:52 <a href="http://www.cnitblog.com/xijia0524/archive/2008/03/25/41458.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>