﻿<?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博客-桂湖山BLOG</title><link>http://www.cnitblog.com/yggl1889/</link><description /><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 06:04:15 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 06:04:15 GMT</pubDate><ttl>60</ttl><item><title>将解压后的文件中的.sh做成快捷方式放到桌面上</title><link>http://www.cnitblog.com/yggl1889/archive/2021/03/17/92424.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Wed, 17 Mar 2021 13:54:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2021/03/17/92424.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/92424.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2021/03/17/92424.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/92424.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/92424.html</trackback:ping><description><![CDATA[<ol style="margin: 0px 0px 1em 40px; padding: 0px; color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;">
     <li style="margin: 0px; padding: 0px; list-style-type: decimal;">cd /home/carry/desktop</li>
     </ol><span style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;">vi filename.desktop</span><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><span style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;">
     [Desktop Entry]</span><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Encoding</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=UTF-</span><span style="margin: 0px; padding: 0px; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">8</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> <br />
     </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Name</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=Idea <br />
     </span><span style="margin: 0px; padding: 0px; color: #008000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;"># 执行路径</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> <br />
     </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Exec</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=sh /home/carry/Idea/bin/idea.sh<br />
     </span><span style="margin: 0px; padding: 0px; color: #008000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;"># 图标<br />
     </span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Icon</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=/home/carry/Idea/bin/idea.png<br />
     </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Info</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=</span><span style="margin: 0px; padding: 0px; color: #a31515; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">"Idea"</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> <br />
     </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Terminal</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=</span><span style="margin: 0px; padding: 0px; color: #a31515; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">false</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> <br />
     </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">Type</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=Application<br />
     </span><span style="margin: 0px; padding: 0px; color: #ff0000; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">StartupNotify</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;">=</span><span style="margin: 0px; padding: 0px; color: #a31515; font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap;">true</span><span style="font-family: &quot;Courier New&quot;, sans-serif; font-size: 12px; white-space: pre-wrap; background-color: #f5f5f5;"> <br />
</span><ol start="3" style="margin: 0px 0px 1em 40px; padding: 0px; color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;"><li style="margin: 0px; padding: 0px; list-style-type: decimal;">修改以后退出</li><li style="margin: 0px; padding: 0px; list-style-type: decimal;">给予可执行权限</li></ol><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><br style="color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;" /><ol style="margin: 0px 0px 1em 40px; padding: 0px; color: #555555; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 14px;">
</ol><img src ="http://www.cnitblog.com/yggl1889/aggbug/92424.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2021-03-17 21:54 <a href="http://www.cnitblog.com/yggl1889/archive/2021/03/17/92424.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux中FireWell端口开放</title><link>http://www.cnitblog.com/yggl1889/archive/2021/03/16/92421.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Tue, 16 Mar 2021 14:31:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2021/03/16/92421.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/92421.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2021/03/16/92421.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/92421.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/92421.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: tahoma, 宋体; font-size: 14px; text-align: justify; background-color: #fafafc;">我们需要在Firewall中开启8081端口，也就是将8081端口加入到zone（Firewall的新特性，简单讲它的作用就是定义了网络区域网络连接的可信等级）中。命令如下：</p><pre style="color: #333333; font-size: 14px; text-align: justify; background-color: #fafafc;"><code hljs=""  brainfuck"="">firewall-cmd --zone=public --add-port=8081/tcp --permanent</code></pre><p style="color: #333333; font-family: tahoma, 宋体; font-size: 14px; text-align: justify; background-color: #fafafc;">这样就成功的将8081端口加入了public区域中，permanent参数表示永久生效，即重启也不会失效，最后不要忘记更新防火墙规则：</p><pre style="color: #333333; font-size: 14px; text-align: justify; background-color: #fafafc;"><code hljs=""  brainfuck"="">firewall-cmd --reload</code></pre><p style="color: #333333; font-family: tahoma, 宋体; font-size: 14px; text-align: justify; background-color: #fafafc;">OK，下面看一下public区域下所有已打开的端口，命令如下：</p><pre style="color: #333333; font-size: 14px; text-align: justify; background-color: #fafafc;"><code hljs=""  lasso"="">firewall-cmd --zone=public --list-ports</code></pre><p style="color: #333333; font-family: tahoma, 宋体; font-size: 14px; text-align: justify; background-color: #fafafc;">可以看到8081端口已经成功打开：<br /><img title="" src="https://www.linuxidc.com/upload/2016_09/160927212571304.png" alt="这里写图片描述" style="border: 0px;" /><br /><br /><br />l另：<br />JAVA_OPTS="-Xms512m -Xmx1024m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=1024m"</p><pre class="prettyprint" style="color: #333333; font-size: 14px; text-align: justify; background-color: #fafafc;"><code class=" hljs bash">JAVA_OPTS=<span class="hljs-string">"-Xms512m -Xmx1024m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=1024m"</span></code></pre><img src ="http://www.cnitblog.com/yggl1889/aggbug/92421.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2021-03-16 22:31 <a href="http://www.cnitblog.com/yggl1889/archive/2021/03/16/92421.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 手动安装mysql 5.7 每次重启系统都无法直接启动</title><link>http://www.cnitblog.com/yggl1889/archive/2021/03/16/92420.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Tue, 16 Mar 2021 14:21:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2021/03/16/92420.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/92420.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2021/03/16/92420.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/92420.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/92420.html</trackback:ping><description><![CDATA[现象：<br />手动安装mysql5.7，<span style="color: #4d4d4d; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-size: 16px;">重启之后，mysql有各种报错，主要是首先没有mysqld.pid文件路径，其次就是创建路径之后没有权限。<br /><br />原因：<br /></span><span style="color: #4d4d4d; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-size: 16px; background-color: #ffffff;">首先造成这个问题的原因是因为mysql本身的问题，放在run这种内存文件夹之内导致的，首先最简单的办法就是直接将mysql的my.cnf文件中pidFile修改为非/var/run目录下去生成。<br /><br /><br /></span>解决：<br />step1:<br />&nbsp;<span style="background-color: #fafafa; color: #383a42; font-family: &quot;Source Code Pro&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Anonymous Pro&quot;, &quot;Droid Sans Mono&quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, sans-serif; white-space: pre; font-size: 14px;">[root@mysql-master01 ~]</span><span style="font-family: &quot;Source Code Pro&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Anonymous Pro&quot;, &quot;Droid Sans Mono&quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, sans-serif; white-space: pre; font-size: 14px; box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; color: #a0a1a7; font-style: italic; overflow-wrap: break-word;"># vim /etc/my.cnf</span><p style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; font-size: 16px; color: #4d4d4d; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; line-height: 26px !important;">默认的 <br />pid-file=/var/run/mysqld/mysqld.pid</p><p style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; font-size: 16px; color: #4d4d4d; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; line-height: 26px !important;">修改为&nbsp;pid-file=/var/lib/mysqld/mysqld.pid<br />step2:<br /><span style="color: #a0a1a7; font-family: &quot;Source Code Pro&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Anonymous Pro&quot;, &quot;Droid Sans Mono&quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, sans-serif; font-size: 14px; font-style: italic; white-space: pre; background-color: #fafafa;">vim /etc/init.d/mysqld<br /></span>中进行类似修改。<br /><img src="https://img-blog.csdnimg.cn/20200623103302689.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xpdV95dWxvbmc=,size_16,color_FFFFFF,t_70" alt="" /></p><div><ol style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; list-style: none; border-collapse: collapse; font-size: 16px; overflow: hidden; overflow-wrap: break-word; color: #383a42; font-family: &quot;Source Code Pro&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Ubuntu Mono&quot;, &quot;Anonymous Pro&quot;, &quot;Droid Sans Mono&quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, sans-serif; white-space: pre;"><li style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; list-style: none; overflow-wrap: break-word; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px 0px 0px 8px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word;">systemctl daemon-reload   <span style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; color: #a0a1a7; font-style: italic; overflow-wrap: break-word;">//重构进程</span></div></div></li><li style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; list-style: none; overflow-wrap: break-word; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px; width: 24px; border-right-color: #c5c5c5;"><div hljs-ln-n"="" data-line-number="2" style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px 8px 0px 0px; text-align: right; overflow-wrap: normal;"></div></div><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px 0px 0px 8px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word;"> </div></div></li><li style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; list-style: none; overflow-wrap: break-word; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px; width: 24px; border-right-color: #c5c5c5;"><div hljs-ln-n"="" data-line-number="3" style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px 8px 0px 0px; text-align: right; overflow-wrap: normal;"></div></div><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px 0px 0px 8px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word;">service mysqld start    <span style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; color: #a0a1a7; font-style: italic; overflow-wrap: break-word;">//启动mysql</span></div></div></li><li style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; list-style: none; overflow-wrap: break-word; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px; width: 24px; border-right-color: #c5c5c5;"><div hljs-ln-n"="" data-line-number="4" style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px 8px 0px 0px; text-align: right; overflow-wrap: normal;"></div></div><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px 0px 0px 8px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word;"> </div></div></li><li style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; list-style: none; overflow-wrap: break-word; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px; width: 24px; border-right-color: #c5c5c5;"><div hljs-ln-n"="" data-line-number="5" style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px 8px 0px 0px; text-align: right; overflow-wrap: normal;"></div></div><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px 0px 0px 8px; padding: 0px; overflow-wrap: break-word; font-size: 14px; float: left; height: 22px;"><div style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; overflow-wrap: break-word;">chkconfig mysqld <span style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; color: #a626a4; overflow-wrap: break-word;">on</span>    <span style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin: 0px; padding: 0px; color: #a0a1a7; font-style: italic; overflow-wrap: break-word;">//加入随系统启动启动</span></div></div></li></ol></div><p style="box-sizing: border-box; outline: 0px; --tw-shadow:0 0 #0000 ; --tw-ring-inset:var(--tw-empty, ); --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(66, 153, 225, 0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000 ; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; font-size: 16px; color: #4d4d4d; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; line-height: 26px !important;"><br />重启ok<br /></p><img src ="http://www.cnitblog.com/yggl1889/aggbug/92420.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2021-03-16 22:21 <a href="http://www.cnitblog.com/yggl1889/archive/2021/03/16/92420.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vertica单节点安装</title><link>http://www.cnitblog.com/yggl1889/archive/2021/02/26/92418.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Fri, 26 Feb 2021 08:59:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2021/02/26/92418.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/92418.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2021/02/26/92418.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/92418.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/92418.html</trackback:ping><description><![CDATA[<span style="font-size: 11px;">https://www.cnblogs.com/tomatoes-/p/10280570.html<br /></span><div style="font-size: 14.7px; font-weight: bold; margin-bottom: 10px; color: #4b4b4b; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;"><a id="cb_post_title_url"  vertical-middle"="" href="https://www.cnblogs.com/tomatoes-/p/10280570.html" style="color: #4371a6;"><span style="line-height: 22.05px; vertical-align: middle;">vertica单节点安装</span></a></div><div id="cnblogs_post_body" style="margin-bottom: 20px; word-break: break-word; color: #4b4b4b; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 13px;"><p style="margin: 10px auto;"><span style="line-height: 28px; font-family: &quot;courier new&quot;, courier; font-size: 14pt;">准备环境：</span></p><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">&nbsp;1.centos 7.0镜像</span></p><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">&nbsp;2.vertica-9.1.1-1.x86_64.RHEL6.rpm</span></p><p style="margin: 10px auto;"><span style="line-height: 28px; font-family: &quot;courier new&quot;, courier; font-size: 14pt;">安装过程：</span></p><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">1.安装CentOS 7.0</span></p><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px; background-color: #ff0000;">注意：挂载的文件系统必须是ext4，不能是默认的xfs！</span></p><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">2.关闭防火墙</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# systemctl disable firewalld <br /></span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# systemctl stop firewalld</span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">3.设置selinux为disable</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# vi <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>etc<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>selinux<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>config SELINUX<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">=</span>disabled</span></pre></div><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# setenforce <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #800000; font-weight: bold;">0</span></span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">4.安装依赖包</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# yum install gdb mcelog sysstat chrony ntp ntpdate -y</span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">5.安装必要工具：java，python，rsync，pts</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# python --version [root@localhost ~]# yum install rsync -y [root@localhost ~]# rsync --version [root@localhost ~]# ls /dev |grep pts [root@localhost ~]# yum install java-1.8.0-openjdk.x86_64 -y [root@localhost ~]# java -version</span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">6.调整参数</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# vi <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>etc<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>sysctl.conf vm.swappiness <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">=</span> <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #800000; font-weight: bold;">1</span></span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# echo <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #800000; font-weight: bold;">1</span> <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">&gt;</span> <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">proc</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>sys<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>vm<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>swappiness</span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# vi &nbsp;/etc/rc.d/rc.local&nbsp;</span><br /><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">echo deadline &gt; /sys/block/sdb/queue/scheduler </span><br /><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">echo deadline &gt; /dev/sdb</span><br /><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">/sbin/blockdev --setra 8192 /dev/sdb </span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">7.安装vertica</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# rpm <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">-</span>ivh vertica-9.1.1-1.x86_64.RHEL6.rpm<br /><br /></span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>opt<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>vertica<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>sbin<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>install_vertica <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #008080;">--</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #008080;">host 192.168.*.* --rpm vertica-9.1.1-1.x86_64.RHEL6.rpm --failure-threshold FAIL --dba-user dbadmin</span></span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">8.初始化数据库</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[root@localhost ~]# su <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">-</span> dbadmin <br /><br /></span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[dbadmin@localhost ~]$ .<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>opt<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>vertica<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>bin<span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">/</span>adminTools</span></pre></div><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(1)提示输入License File Path时，因为用的是社区版license，不用填，直接回车</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(2)Accept EULA</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(3)Configuration Menu</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(4)Create Database</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(5)输入Database Name: vertica</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(6)输入密码和确认密码</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(7)选择主机IP，因为是单节点安装，直接选择默认的那个IP</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(8)确认数据实例安装目录，看需求，或者不用改，直接用默认的，/home/dbadmin</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(9)会出现一个k-safe的提示，这是只有一个节点导致的，直接忽略，继续下一步</span><br /><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">(10)安装成功</span></p><p style="margin: 10px auto;"><span style="line-height: 24px; font-family: &quot;courier new&quot;, courier; font-size: 16px;">9.测试连接</span></p><div style="background-color: #f5f5f5; border-color: #cccccc; border-image: initial; padding: 5px; overflow: auto; margin: 5px 0px; color: #000000; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #4371a6; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 100%; height: auto; border: none !important;" /></a></span></div><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">[dbadmin@localhost bin]$</span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;">vsql -h 127.0.0.1 -d vertica -u dbadmin</span></pre><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; overflow-wrap: break-word; font-family: &quot;Courier New&quot; !important;"><span style="line-height: 1.5 !important; font-family: &quot;courier new&quot;, courier; font-size: 16px;"><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;">vsql: warning: extra command</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">-</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;">line argument "dbadmin" ignored vsql: Warning: The </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">-</span>u <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">option</span> <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">is</span> deprecated. <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">Use</span> <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">-</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;">U. </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #ff00ff;">User</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"> name: dbadmin Password: </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">******</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"> Welcome </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">to</span> vsql, the Vertica Analytic <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">Database</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"> interactive terminal.  Type: \h </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">or</span> \? <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">for</span> help <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">with</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"> vsql commands \g </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">or</span> terminate <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">with</span> semicolon <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">to</span> <span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">execute</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"> query \q </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #0000ff;">to</span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important;"> quit  vertica </span><span style="line-height: 1.5 !important; font-family: &quot;Courier New&quot; !important; font-size: 12px !important; color: #808080;">=&gt;</span></span></pre></div></div><img src ="http://www.cnitblog.com/yggl1889/aggbug/92418.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2021-02-26 16:59 <a href="http://www.cnitblog.com/yggl1889/archive/2021/02/26/92418.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Regexp_Substr()参数详解</title><link>http://www.cnitblog.com/yggl1889/archive/2021/01/23/92397.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Sat, 23 Jan 2021 14:46:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2021/01/23/92397.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/92397.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2021/01/23/92397.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/92397.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/92397.html</trackback:ping><description><![CDATA[<blockquote style="box-sizing: border-box; outline: 0px; padding: 0px; margin: 0px 0px 0px 40px; border: none; background: #eef0f4; overflow: auto; overflow-wrap: break-word; word-break: normal; color: #333333; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-size: 16px;"><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;">Regexp_Substr()参数详解</span></p><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;">Regexp_Substr(String,<span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3f3f3f;">pattern,<span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;">position,<span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;">occurrence ,<span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;">modifier&nbsp;</span></span></span></span>)一共包含了五个参数：</span></p></blockquote><blockquote style="box-sizing: border-box; outline: 0px; padding: 0px; margin: 0px 0px 0px 40px; border: none; background: #eef0f4; overflow: auto; overflow-wrap: break-word; word-break: normal; color: #333333; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif, SimHei, SimSun; font-size: 16px;"><blockquote style="box-sizing: border-box; outline: 0px; padding: 0px; margin: 0px 0px 0px 40px; border: none; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; overflow: auto; overflow-wrap: break-word; word-break: normal;"><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;">String：操作的字符串；</span><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;" /></span></p><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;">pattern：正则表达式匹配规则，匹配到则返回；</span></p><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;">position：开始匹配的位置，默认当然是1；</span></p><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3f3f3f;">occurrence：<span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;">标识第几个匹配组，默认为1</span></span><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;" /></span></p><p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; padding-top: 0px; padding-bottom: 0px; color: #4f4f4f; overflow: auto hidden; line-height: 26px; overflow-wrap: break-word;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; font-size: 14px;"><span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word; color: #3f3f3f;">modifier：模式<span style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;">（&#8216;i&#8216;不区分大小写进行检索，&#8216;c&#8216;区分大小写进行检索。默认为&#8216;c&#8216;）</span></span></span></p></blockquote></blockquote><img src ="http://www.cnitblog.com/yggl1889/aggbug/92397.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2021-01-23 22:46 <a href="http://www.cnitblog.com/yggl1889/archive/2021/01/23/92397.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>EntityManager方法简介 </title><link>http://www.cnitblog.com/yggl1889/archive/2015/08/02/90163.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Sun, 02 Aug 2015 00:31:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2015/08/02/90163.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/90163.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2015/08/02/90163.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/90163.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/90163.html</trackback:ping><description><![CDATA[from <div>http://blog.163.com/zhouhuoxiang12@126/blog/static/88776461200945112658420/</div><div><p style="text-indent: 2em">EntityManager 是用来对实体Bean  进行操作的辅助类。他可以用来产生/删除持久化的实体Bean，通过主键查找实体bean，也可以通过EJB3 QL  语言查找满足条件的实体Bean。实体Bean 被EntityManager  管理时，EntityManager跟踪他的状态改变，在任何决定更新实体Bean 的时候便会把发生改变的值同步到数据库中。当实体Bean  从EntityManager 分离后，他是不受管理的，EntityManager 无法跟踪他的任何状态改变。EntityManager  的获取前面已经介绍过，可以通过@PersistenceContext 注释由EJB 容器动态注入，例：</p> <p style="text-indent: 2em">@PersistenceContext(unitName="foshanshop")</p> <p style="text-indent: 2em">EntityManager em;</p> <p style="text-indent: 2em">EntityManager常用方法:</p> <p style="text-indent: 2em">1.Entity的获取</p> <p style="text-indent: 2em">&nbsp;&nbsp; find(*.class,ID) :若实体Bean不存在,则返回null</p> <p style="text-indent: 2em">&nbsp;&nbsp; getReference(*,class,ID)  :若实体Bean不存在,则抛出javax.persistence.EntityNotFoundException,另,不保  证&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 实体Bean 已被初始化</p> <p style="text-indent: 2em">&nbsp;&nbsp; 注意:若*.class不是Entity Bean的话,都会引发IllegalArgumentException</p> <p style="text-indent: 2em">2.persist() :添加实体Bean</p> <p style="text-indent: 2em">3.更新实体Bean :当实体正在被容器管理时，你可以调用实体的set 方法对数据进行修改，在容器决定flush 时，更新的数据才会同步到数据库。如果你希望修改后的数据实时同步到数据库，你可以执行EntityManager.flush()方法。</p> <p style="text-indent: 2em">4.merge () :是在实体Bean 已经脱离了EntityManager 的管理时使用，当容器决定flush 时，数据将会同步到数据库中,执行em.merge(Object obj)方法时，容器的工作规则：</p> <p style="text-indent: 2em">(1)．如果此时容器中已经存在一个受容器管理的具有相同ID 的Object实例，容器将会把参数obj的内容拷贝进这个受管理的实例，merge()方法返回受管理的实例，但参数obj仍然是分离的不受管理的。容器在决定Flush时把实例同步到数据库中。</p> <p style="text-indent: 2em">(2)．容器中不存在具有相同ID 的Object实例。容器根据传进的obj参数Copy  出一个受容器管理的Object实例，同时merge()方法会返回出这个受管理的实例，但参数obj仍然是分离的不受管理的。容器在决定Flush时把  实例同步到数据库中。如果传递进merge ()方法的参数不是实体Bean，会引发一个IllegalArgumentException</p> <p style="text-indent: 2em">5.Remove() :删除对象</p> <p style="text-indent: 2em">6.createQuery() 返回Query对象,以执行JPQL语句</p> <p style="text-indent: 2em">7.createNativeQuery() 返回Query对象,以执行SQL语句</p> <p style="text-indent: 2em">8.refresh() 刷新实体Bean,以得到对新对象 (幽雅的获取最新对象方法)</p> <p style="text-indent: 2em">9.contains() 检测实体当前是否被管理中</p> <p style="text-indent: 2em">&nbsp;&nbsp; 该方法使用一个实体作为参数，如果这个实体对象当前正被持久化内容管理，返回值为true，否则为false</p> <p style="text-indent: 2em">10.clear() 分离所有当前正在被管理的实体</p> <p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp; 在处理大量实体的时候，如果你不把已经处理过的实体从EntityManager 中分离出来，将会消耗你大量的内存。调用EntityManager 的clear()方法后，所有正在被管理的实体将会从持久化内容中分离出来。</p> <p style="text-indent: 2em">有一点需要说明下，在事务没有提交前（事务默认在调用堆栈的最后提交，如：方法的返回），如果调用clear()方法，之前对实体所作的任何改变将会掉失，所以建议你在调用clear()方法之前先调用flush()方法保存更改</p> <p style="text-indent: 2em">11. flush() 将实体的改变立刻刷新到数据库中</p> <p style="text-indent: 2em">当实体管理器对象在一个session bean 中使用时，它是和服务器的事务上下文绑定的。实体管理器在服务器的事务提交时提交并且同步它的内容。在一个session bean 中，服务器的事务默认地会在调用堆栈的最后提交（如：方法的返回)</p> <p style="text-indent: 2em">12.javax.persistence.FlushModeType 实体Bean管理器的Flush模式</p> <p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp; FlushModeType.COMMIT&nbsp;&nbsp; :刷新只有在事务提交时才发生，使用场合：在大量更新数据的过程中存在查询语句(除了find()和getreference()查询)的执行</p> <p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp; FlushModeType.AUTO  :(默认模式)刷新在查询语句执行前(除了find()和getreference()查询)或事务提交时才发&nbsp;&nbsp;  生，使用场合：在大量更新数据的过程中没有任何查询语句(除了find()和getreference()查询)的执行。</p> <p style="text-indent: 2em">JDBC 驱动跟数据库交互的次数。JDBC 性能最大的增进是减少JDBC  驱动与数据库之间的网络通讯FlushModeType.COMMIT 模式使更新只在一次的网络交互中完成，而FlushModeType.AUTO  模式可能需要多次交互（触发了多少次Flush 就产生了多少次网络交互）</p> <p style="text-indent: 2em">设置:entityManager.setFlushMode(FlushModeType.COMMIT);</p> <p style="text-indent: 2em">13.getDelegate( )&nbsp;&nbsp; 获取持久化实现者的引用</p> <p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp; 用过getDelegate( )方法，你可以获取EntityManager 持久化实现者的引用，如Jboss EJB3 的持久化产品采用Hibernate，可以通过getDelegate( ) 方法获取对他的访问，如:</p> <p style="text-indent: 2em">@PersistenceContext</p> <p style="text-indent: 2em">protected EntityManager em;</p> <p style="text-indent: 2em">HibernateEntityManager manager = (HibernateEntityManager)em.getDelegate();</p> <p style="text-indent: 2em">获得对Hibernate 的引用后，可以直接面对Hibernate 进行编码，不过这种方法并不可取，强烈建议不要使用.在Weblogic 中，你也可以通过此方法获取对Kodo 的访问</p> <p style="text-indent: 2em">另:映射的表名或列名与数据库保留字同名时的处理</p> <p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp; 将表名加标式符,例如:在Mysql下,用'order',或在sqlserver下用[TableName],但这样做不适合程序移植</p></div><img src ="http://www.cnitblog.com/yggl1889/aggbug/90163.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2015-08-02 08:31 <a href="http://www.cnitblog.com/yggl1889/archive/2015/08/02/90163.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ocilib的使用</title><link>http://www.cnitblog.com/yggl1889/archive/2013/11/29/88851.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Fri, 29 Nov 2013 07:57:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2013/11/29/88851.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/88851.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2013/11/29/88851.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/88851.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/88851.html</trackback:ping><description><![CDATA[&nbsp;1. include&nbsp; ocilib.h throught ocilib_demo.h<br />&nbsp;2. auto #pragma comment(lib, "ociliba.lib")&nbsp; in ocilib_demo.h<br />&nbsp;3. add in codes<br />&nbsp;4. add link path of ociliba.lib<br />&nbsp;5. copy ociliba.dll to the fitable path<br />&nbsp;the code maybe as:<br />&nbsp; OCI_StatementCreate<br />&nbsp;&nbsp; ...<br />&nbsp; <img src ="http://www.cnitblog.com/yggl1889/aggbug/88851.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2013-11-29 15:57 <a href="http://www.cnitblog.com/yggl1889/archive/2013/11/29/88851.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>阻断弹出式广告的BHO 的学习</title><link>http://www.cnitblog.com/yggl1889/archive/2011/09/07/75378.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Wed, 07 Sep 2011 10:09:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2011/09/07/75378.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/75378.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2011/09/07/75378.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/75378.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/75378.html</trackback:ping><description><![CDATA[<div><p><strong></strong></p><div><strong>注明<a href="http://delphi.sharpplus.com/">转自Delphi深度探索</a></strong></div><strong><br /></strong><p>&nbsp;</p><p><strong>介绍</strong></p>               <p style="text-indent:21.0pt">随着网络免费的大潮的 退去，网站变得越来越商业化。浏览一些常去的网站，每看一个页面都会弹出N多的广告窗口，而且都是花花绿绿的Flash和Gif小动画,浪费带宽（我在家 还是拨号上网），同时干扰了正常的阅读，非常讨厌。那么如何才能将这些广告屏蔽掉呢？答案就是Browser Helper  Object(简称BHO)。</p>               <p style="text-indent:21.0pt">BHO实际上也是一个简单的IE扩展COM组件，它和其它COM组件的区别就在于其它扩展需要一些用户的手工操作，如点击菜单，点击工具条按钮，在地址栏输入               网址等等触发动作才会被IE加载。而BHO则不同，每当IE启动时，都会自动去加载BHO而无须任何触发条件，另外BHO还可以监听IE的各类事件的通知消息，比如窗               口大小的变化，下载是否完成等事件。</p>               <p style="text-indent:21.0pt">由于BHO可以在一启动IE就被加载，并能监听各种事件，我们就可以使用BHO扩展实现限制用户浏览某些色情网站，或者搜集用户浏览喜好信息等功能。接下来，               我们就来实现一个能够阻断广告弹出的BHO扩展。</p>               <p style="text-align:left;text-autospace:none" align="left"><strong>创建</strong><strong>COM</strong><strong>组件</strong></p>               <p style="text-align:left;text-autospace:none" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 新建一个ActiveX Library，保存为IEBHO.dpr，然后新建一个名为TIEAdvBHO的COM Object，然后保存生成的文件为CIEBHO.pas，作为BHO扩展，需要实现两                 个接口IObjectWithSite和IDispatch，其中               IObjectWithSite接口同前面的工具条扩展一样可以用来获得浏览器的接口，而IDispatch接口，则被用来监听浏览器的事件。下面就是BHO扩展的类定义：</p>               <pre><code><strong>type</strong></code></pre>               <pre><code><strong>&nbsp; </strong>TTIEAdvBHO = <strong>class</strong>(TComObject, IObjectWithSite, IDispatch)</code></pre>               <pre><code>&nbsp; <strong>private</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>FIESite: IUnknown;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; FIE: IWebBrowser2;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; FCPC: IConnectionPointContainer;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; FCP: IConnectionPoint;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; FCookie: Integer;</code></pre>               <pre><code>&nbsp; <strong>protected</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong><em>//IObjectWithSite接口方法定义</em></code></pre>               <pre><code><em>&nbsp;&nbsp;&nbsp; </em><strong>function </strong>SetSite(<strong>const </strong>pUnkSite: IUnknown): HResult; <strong>stdcall</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>function </strong>GetSite(<strong>const </strong>riid: TIID; <strong>out </strong>site: IUnknown): HResult; <strong>stdcall</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <em>//IDispatch</em><em>接口方法定义</em></code></pre>               <pre><code><em>&nbsp;&nbsp;&nbsp; </em><strong>function </strong>GetTypeInfoCount(<strong>out </strong>Count: Integer): HResult; <strong>stdcall</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>function </strong>GetTypeInfo(Index, LocaleID: Integer; <strong>out </strong>TypeInfo): HResult;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>stdcall</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>function </strong>GetIDsOfNames(<strong>const </strong>IID: TGUID; Names: Pointer;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; <strong>stdcall</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>function </strong>Invoke(<strong>DispID</strong>: Integer; <strong>const </strong>IID: TGUID; LocaleID: Integer;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Flags: Word; <strong>var </strong>Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<strong>stdcall</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <em>//</em><em>阻断广告弹出事件处理过程</em></code></pre>               <pre style="text-indent:19.8pt"><code><strong>procedure </strong>DoNewWindow2(<strong>var </strong>ppDisp: IDispatch; <strong>var </strong>Cancel: WordBool);</code></pre>               <pre style="margin-left:40.0pt;text-indent:-40.0pt"><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>DoBeforeNavigate2(<strong>const </strong>pDisp: IDispatch; <strong>var </strong>URL: OleVariant; <strong>var </strong>Flags: OleVariant; <strong>var </strong>TargetFrameName: OleVariant; <br /><strong>var </strong>PostData: OleVariant;<strong>var </strong>Headers: OleVariant; <strong>var </strong>Cancel: WordBool);</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left">&nbsp;</p>               <p style="text-align:left;text-autospace:none" align="left"><strong>IObjectWithSite</strong><strong>的接口的实现</strong></p>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong></p>               <p style="text-align:left;text-autospace:none" align="left">先 看IObjectWithSite的接口的实现，当IE加载BHO扩展后，会调用BHO的扩展，把自身的IUnknown接口作为参数pUnkSite传 给扩展，BHO扩展应该从pUnkSite参数中获得浏览器接口IWebBrowser2,同时为了监听浏览器的事件，还需要获得事件链接点接口，IE的 支持的事件都定义在DWebBrowserEvents2的双接口中，使用链接点的Advise方法建立对IE事件的监听，注意Advise方法调用后               会返回一个Cookie，需要保存Cookie，后面在退出IE时，需要Cookie作为参数来断开对IE事件的监听。</p>               <pre><code><strong>function </strong>TTIEAdvBHO.SetSite(<strong>const </strong>pUnkSite: IInterface): HResult;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; </strong>Result := E_FAIL;</code></pre>               <pre><code>&nbsp; <em>//</em><em>保存接口</em></code></pre>               <pre><code><em>&nbsp; </em>FIESite := pUnkSite;</code></pre>               <pre><code>&nbsp; <strong>if not </strong>Supports(FIESite, IWebBrowser2, FIE) <strong>then</strong></code></pre>               <pre style="text-indent: 20.4pt"><code>Exit;</code></pre>               <pre><code>&nbsp; //获得事件连接点</code></pre>               <pre><code>&nbsp; <strong>if not </strong>Supports(FIE, IConnectionPointContainer, FCPC) <strong>then</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>Exit;</code></pre>               <pre><code><em>&nbsp; </em>FCPC.FindConnectionPoint(DWebBrowserEvents2, FCP);</code></pre>               <pre><code>&nbsp; <em>//</em><em>监听事件</em></code></pre>               <pre><code>&nbsp; FCP.Advise(Self, FCookie);</code></pre>               <pre><code>&nbsp; Result := S_OK;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left">后面IE有时会调用IObjectWithSite接口的GetSite方法获得需要的接口，这时可以将保存的接口返回。</p>               <pre><code><strong>function </strong>TTIEAdvBHO.GetSite(<strong>const </strong>riid: TIID;</code></pre>               <pre><code>&nbsp; <strong>out </strong>site: IInterface): HResult;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; if </strong>Supports(FIESite, riid,site) <strong>then</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>Result := S_OK</code></pre>               <pre><code>&nbsp; <strong>else</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>Result:= E_NOINTERFACE;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left">&nbsp;</p>               <p style="text-align:left;text-autospace:none" align="left"><strong>IDispatch</strong><strong>接口的实现</strong></p>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong></p>               <p style="text-align:left;text-autospace:none" align="left">前 面我们在SetSite中建立了对IE事件的监听，建立事件监听后每当IE产生了新的事件，它就会调用扩展的IDispatch接口的Invoke方法通 知扩展发生的事件类型以及事件参数，并请求扩展对事件进行处理。因此对于BHO扩展来说，IDispatch接口的Invoke方法是必须实现的，而其它 的GetTypeInfoCount，GetTypeInfo和GetIDsOfNames方法都无须实现，只要返回结果为E_NOTIMPL，表示未实 现该方法就可以了。</p>               <p style="text-align:left;text-autospace:none" align="left">&nbsp;</p>               <pre><code><strong>function </strong>TTIEAdvBHO.GetIDsOfNames(<strong>const </strong>IID: TGUID; Names: Pointer;</code></pre>               <pre><code>&nbsp; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; </strong>Result := E_NOTIMPL;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <pre><code>&nbsp;</code></pre>               <pre><code><strong>function </strong>TTIEAdvBHO.GetTypeInfo(Index, LocaleID: Integer;</code></pre>               <pre><code>&nbsp; <strong>out </strong>TypeInfo): HResult;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; </strong>Result := E_NOTIMPL;</code></pre>               <pre><code>&nbsp; pointer(TypeInfo) := <strong>nil</strong>;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <pre><code>&nbsp;</code></pre>               <pre><code><strong>function </strong>TTIEAdvBHO.GetTypeInfoCount(<strong>out </strong>Count: Integer): HResult;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; </strong>Result := E_NOTIMPL;</code></pre>               <pre><code>&nbsp; Count := 0;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left">&nbsp;</p>               <p style="text-align:left;text-autospace:none" align="left"><strong>事件的监听</strong></p>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong></p>               <p style="text-align:left;text-autospace:none" align="left">IE支持的事件都定义在DWebEvents2接口中，如下：</p>               <pre><code>&nbsp; DWebBrowserEvents2 = <strong>dispinterface</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>[<em>'{34A715A0-6587-11D0-924A-0020AFC7AC4D}'</em>]</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>StatusTextChange(<strong>const </strong>Text: WideString); <strong>dispid </strong>102;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>ProgressChange(Progress: Integer; ProgressMax: Integer); <strong>dispid </strong>108;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>CommandStateChange(Command: Integer; Enable: WordBool); <strong>dispid </strong>105;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>DownloadBegin; <strong>dispid </strong>106;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>DownloadComplete; <strong>dispid </strong>104;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>TitleChange(<strong>const </strong>Text: WideString); <strong>dispid </strong>113;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>PropertyChange(<strong>const </strong>szProperty: WideString); <strong>dispid </strong>112;</code></pre>               <pre style="text-indent:19.8pt"><code><strong>procedure </strong>BeforeNavigate2(<strong>const </strong>pDisp: IDispatch; <strong>var </strong>URL: OleVariant; <strong>var </strong>Flags:</code></pre>               <pre style="text-indent:69.8pt"><code> OleVariant; <strong>var </strong>TargetFrameName: OleVariant; <strong>var </strong>PostData: OleVariant;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </code></pre>               <pre style="text-indent:79.2pt"><code><strong>var </strong>Headers: OleVariant; <strong>var </strong>Cancel: WordBool); <strong>dispid </strong>250;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>NewWindow2(<strong>var </strong>ppDisp: IDispatch; <strong>var </strong>Cancel: WordBool); <strong>dispid </strong>251;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>NavigateComplete2(<strong>const </strong>pDisp: IDispatch; <strong>var </strong>URL: OleVariant); <strong>dispid </strong>252;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>DocumentComplete(<strong>const </strong>pDisp: IDispatch; <strong>var </strong>URL: OleVariant); <strong>dispid </strong>259;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnQuit; <strong>dispid </strong>253;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnVisible(Visible: WordBool); <strong>dispid </strong>254;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnToolBar(ToolBar: WordBool); <strong>dispid </strong>255;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnMenuBar(MenuBar: WordBool); <strong>dispid </strong>256;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnStatusBar(StatusBar: WordBool); <strong>dispid </strong>257;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnFullScreen(FullScreen: WordBool); <strong>dispid </strong>258;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>procedure </strong>OnTheaterMode(TheaterMode: WordBool); <strong>dispid </strong>260;</code></pre>               <pre><code>&nbsp; <strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong></p>               <pre>可以看到每个事件中的后面都有一个dispid关键加上数字如 258 ,260等等。Dispid的数字就是事件类型的标识符号。<br />IDispatch的Invoke方法定义如下：</pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>function </strong>Invoke(<strong>DispID</strong>: Integer; <strong>const </strong>IID: TGUID; LocaleID: Integer;</code></pre>               <p style="text-align:left;text-indent:30.0pt; text-autospace:none" align="left"><code>Flags: Word; <strong>var </strong>Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult;</code></p>               <p style="text-align:left;text-autospace:none" align="left"><code>当</code><code>IE</code><code>调用</code><code>Invoke</code><code>方法时，会设定</code><code>DispId</code><code>参数为事件的标识符号，这样我们就可以知道</code><code>IE</code><code>发生了什么事件。对于要实现               的阻断广告窗口弹出来说，我们只需关心</code><code>BeforeNavigate2</code><code>和</code><code>OnQuit</code><code>事件就可以了，因为当广告窗口弹出前，会激发               </code><code>IE</code><code>的</code><code>BeforeNavigate2</code><code>事件，而弹出式窗口一般没有工具条，所以只要</code><code>BeforeNavigate2</code><code>事件中判断当前页面是否有               工具条就可以判断是否是弹出窗口，并予以禁止。而当</code><code>IE</code><code>退出时，会激发</code><code>OnQuit</code><code>事件，在</code><code>OnQuit</code><code>事件中应该断开事件              监听，同时清理分配的资源。下面就是截获</code><code>BeforeNavigate2</code><code>和</code><code>OnQuit</code><code>事件的</code><code>Invoke</code><code>方法的实现</code><code>:</code></p>               <pre><code><strong>procedure </strong>BuildPositionalDispIds(pDispIds: PDispIdList; <strong>const </strong>dps: TDispParams);</code></pre>               <pre><code><strong>var</strong></code></pre>               <pre><code><strong>&nbsp; </strong>i: integer;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; </strong>Assert(pDispIds &lt;&gt; <strong>nil</strong>);</code></pre>               <pre><code>&nbsp; <strong>for </strong>i := 0 <strong>to </strong>dps.cArgs - 1 <strong>do</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>pDispIds^[i] := dps.cArgs - 1 - i;</code></pre>               <pre><code>&nbsp; <strong>if </strong>(dps.cNamedArgs &lt;= 0) <strong>then</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>Exit;</code></pre>               <pre><code>&nbsp; <strong>for </strong>i := 0 <strong>to </strong>dps.cNamedArgs - 1 <strong>do</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>pDispIds^[dps.rgdispidNamedArgs^[i]] := i;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left"><code>&nbsp;</code></p>               <pre><code><strong>function </strong>TTIEAdvBHO.Invoke(<strong>DispID</strong>: Integer; <strong>const </strong>IID: TGUID;</code></pre>               <pre><code>&nbsp; LocaleID: Integer; Flags: Word; <strong>var </strong>Params; VarResult, ExcepInfo,</code></pre>               <pre><code>&nbsp; ArgErr: Pointer): HResult;</code></pre>               <pre><code><strong>var</strong></code></pre>               <pre><code><strong>&nbsp; </strong>dps: TDispParams <strong>absolute </strong>Params;</code></pre>               <pre><code>&nbsp; bHasParams: boolean;</code></pre>               <pre><code>&nbsp; pDispIds: PDispIdList;</code></pre>               <pre><code>&nbsp; iDispIdsSize: integer;</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; </strong>pDispIds := <strong>nil</strong>;</code></pre>               <pre><code>&nbsp; iDispIdsSize := 0;</code></pre>               <pre><code>&nbsp; bHasParams := (dps.cArgs &gt; 0);</code></pre>               <pre><code>&nbsp; <strong>if </strong>(bHasParams) <strong>then</strong></code></pre>               <pre><code><strong>&nbsp; begin</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>iDispIdsSize := dps.cArgs * SizeOf(TDispId);</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; GetMem(pDispIds, iDispIdsSize);</code></pre>               <pre><code>&nbsp; <strong>end</strong>;</code></pre>               <pre><code>&nbsp; <strong>try</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; if </strong>(bHasParams) <strong>then</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>BuildPositionalDispIds(pDispIds, dps);</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; Result := S_OK;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>case DispId of</strong></code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 250:<em>//BeforeNaviage2</em><em>事件id</em></code></pre>               <pre><code><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </em><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>DoBeforeNavigate2(IDispatch(dps.rgvarg^[pDispIds^[0]].dispval),</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;POleVariant(dps.rgvarg^[pDispIds^[1]].pvarval)^,</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POleVariant(dps.rgvarg^[pDispIds^[2]].pvarval)^,</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POleVariant(dps.rgvarg^[pDispIds^[3]].pvarval)^,</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POleVariant(dps.rgvarg^[pDispIds^[4]].pvarval)^,</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POleVariant(dps.rgvarg^[pDispIds^[5]].pvarval)^,</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dps.rgvarg^[pDispIds^[6]].pbool^);</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>end</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 253:<em>//OnQuit</em><em>事件ID</em></code></pre>               <pre><code><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </em><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>FCP.Unadvise(FCookie);</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>end</strong>;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>else</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>Result := DISP_E_MEMBERNOTFOUND;</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <strong>end</strong>;</code></pre>               <pre><code>&nbsp; <strong>finally</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; if </strong>(bHasParams) <strong>then</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>FreeMem(pDispIds, iDispIdsSize);</code></pre>               <pre><code>&nbsp; <strong>end</strong>;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left"><code>&nbsp;</code></p>               <p style="text-align:left;text-autospace:none" align="left">在Invoke方法中，<code>Params</code><code>参数包含了被激发的事件包含的参数的数目以及参数的值，而</code><code>BuildPositionalDispIds</code><code>              则从</code><code>Params</code><code>参数中提取参数值，并放到数组中，然后在</code><code>BeforeNavigate2</code><code>事件中，调用</code><code>Do</code><code>BeforeNavigate2</code><code>过程对               事件进行处理，事件参数作为过程参数被传递过去，下面是具体禁止弹出网页的</code><code>Do</code><code>BeforeNavigate2</code><code>的处理过程：</code></p>               <pre><code><strong>procedure </strong>TTIEAdvBHO.DoBeforeNavigate2(<strong>const </strong>pDisp: IDispatch; <strong>var </strong>URL,</code></pre>               <pre><code>&nbsp; Flags, TargetFrameName, PostData, Headers: OleVariant;</code></pre>               <pre><code>&nbsp; <strong>var </strong>Cancel: WordBool);</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; if </strong>FIE.ToolBar=0 <strong>then </strong>FIE.Quit;</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong></p>               <p style="text-align:left;text-autospace:none" align="left">在过程中，首先，调用IWebBrowser2接口的Toolbar属性判断页面是否有工具条，如果没有，则调用IE的退出方法关闭弹出窗口。另外在Invoke中还在OnQuit事件激发时，调用事件连接点的UnAdvise方法，断开事件监听。</p>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong><strong>注册扩展</strong></p>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong><code>注册扩展非常简单，只要在注册表中关键字</code><code>HKEY_LOCAL_MACHINE</code><code>\</code><code>Software\Microsoft\Windows\CurrentVersion<br />               \explorer\Browser Helper Objects\</code><code>下添加值为扩展的</code><code>Guid</code><code>的字符串形式的下级关键字就可以了。</code></p>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong><code><strong>type</strong></code></p>                              <pre><code><strong>&nbsp; </strong>TIEAdvBHOFactory = <strong>class</strong>(TComObjectFactory)</code></pre>               <pre><code>&nbsp; <strong>public</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; procedure </strong>UpdateRegistry(<strong>Register</strong>: Boolean); <strong>override</strong>;</code></pre>               <pre><code>&nbsp; <strong>end</strong>;</code></pre>               <pre><code>&nbsp;</code></pre>               <pre><code><em>{ TIEAdvBHOFactory }</em></code></pre>               <pre><code><em>&nbsp;</em></code></pre>               <pre><code><strong>procedure </strong>TIEAdvBHOFactory.UpdateRegistry(<strong>Register</strong>: Boolean);</code></pre>               <pre><code><strong>begin</strong></code></pre>               <pre><code><strong>&nbsp; inherited</strong>;</code></pre>               <pre><code>&nbsp; <strong>if Register then</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>CreateRegKeyValue(HKEY_LOCAL_MACHINE, <em>'Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\' <br />                      </em>+ GuidToString(ClassID), <em>''</em>, <em>''</em>)</code></pre>               <pre><code>&nbsp; <strong>else</strong></code></pre>               <pre><code><strong>&nbsp;&nbsp;&nbsp; </strong>DeleteRegKeyValue(HKEY_LOCAL_MACHINE, <em>'Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\' <br />                      </em>+ GuidToString(ClassID), <em>''</em>);</code></pre>               <pre><code><strong>end</strong>;</code></pre>               <pre><code>&nbsp;</code></pre>               <pre><code><strong>initialization</strong></code></pre>               <pre><code><strong>&nbsp; </strong>TIEAdvBHOFactory.Create(ComServer, TTIEAdvBHO, Class_TIEAdvBHO,</code></pre>               <pre><code>&nbsp;&nbsp;&nbsp; <em>'TIEAdvBHO'</em>, <em>''</em>, ciMultiInstance, tmApartment);</code></pre>               <pre><code><strong>end</strong>.</code></pre>               <p style="text-align:left;text-autospace:none" align="left"><strong>&nbsp;</strong></p>               <p style="text-align:left;text-autospace:none" align="left">注册扩展后，打开浏览器浏览新浪网站(http://www.sina.com.cn)，你会发现平时讨厌的弹出广告窗口都消失了。</p></div><img src ="http://www.cnitblog.com/yggl1889/aggbug/75378.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2011-09-07 18:09 <a href="http://www.cnitblog.com/yggl1889/archive/2011/09/07/75378.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>宾语从句 as</title><link>http://www.cnitblog.com/yggl1889/archive/2011/03/13/73085.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Sun, 13 Mar 2011 06:34:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2011/03/13/73085.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/73085.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2011/03/13/73085.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/73085.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/73085.html</trackback:ping><description><![CDATA[<br>在非限定性定语从句中as&amp;which有什么区别 <br><br>&nbsp;http://zhidao.baidu.com/question/206158139.html<br><br><img src ="http://www.cnitblog.com/yggl1889/aggbug/73085.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2011-03-13 14:34 <a href="http://www.cnitblog.com/yggl1889/archive/2011/03/13/73085.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>获得windowxp desktop hwnd</title><link>http://www.cnitblog.com/yggl1889/archive/2011/01/21/72698.html</link><dc:creator>桂湖山</dc:creator><author>桂湖山</author><pubDate>Fri, 21 Jan 2011 08:54:00 GMT</pubDate><guid>http://www.cnitblog.com/yggl1889/archive/2011/01/21/72698.html</guid><wfw:comment>http://www.cnitblog.com/yggl1889/comments/72698.html</wfw:comment><comments>http://www.cnitblog.com/yggl1889/archive/2011/01/21/72698.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yggl1889/comments/commentRss/72698.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yggl1889/services/trackbacks/72698.html</trackback:ping><description><![CDATA[确切地讲，Desktop&nbsp;&nbsp; Window包含一个无标题的、类名为&#8220;SHELLDLL_DefView&#8221;的子窗口，这个字窗口又包含一个无标题的、类名为&#8220;SysListView32&#8221;的子窗口——这才是那个真正包含桌面图标的窗口。<img src ="http://www.cnitblog.com/yggl1889/aggbug/72698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yggl1889/" target="_blank">桂湖山</a> 2011-01-21 16:54 <a href="http://www.cnitblog.com/yggl1889/archive/2011/01/21/72698.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>