<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>DBA之路：OoNiceDream</title>
	<atom:link href="http://www.dbaroad.me/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbaroad.me</link>
	<description></description>
	<pubDate>Fri, 21 May 2010 03:31:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>What is ORACLE_HOME_NAME</title>
		<link>http://www.dbaroad.me/archives/2010/05/oracle_home_name.html</link>
		<comments>http://www.dbaroad.me/archives/2010/05/oracle_home_name.html#comments</comments>
		<pubDate>Fri, 21 May 2010 03:31:41 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[基础知识]]></category>

		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=642</guid>
		<description><![CDATA[ORACLE_HOME_NAME 其实跟ORACLE_HOME的含义是一样的，是在oracle初始版本安装时指定的。
在最近一次升级9208时发现，指定补丁安装的目录名称时，这个ORACLE_HOME_NAME一定要跟初始安装时一样，否则就会报错，例如这里我写成了OUIHome1：


这里提示的oradb就是ORACLE_HOME_NAME，太有误导性了，搞成跟数据库名一样，半天没看明白。
要确认ORACLE_HOME_NAME，还可以通过oraInventory目录下的ContentsXML/inventory.xml文件：

# cat /etc/oraInst.loc
inventory_loc=/oradata/oraInventory
inst_group=oinstall
# cd /oradata/oraInventory
# cd ContentsXML
# cat inventory.xml
&#60; ?xml version=&#34;1.0&#34; standalone=&#34;yes&#34; ?&#62;
&#60;!-- Copyright (c) 2001 Oracle Corporation. All rights Reserved --&#62;
&#60;!-- Do not modify the contents of this file by hand. --&#62;
&#60;inventory&#62;
&#60;version_info&#62;
   &#60;saved_with&#62;2.2.0.18.0&#60;/saved_with&#62;
   &#60;minimum_ver&#62;2.1.0.6.0&#60;/minimum_ver&#62;
&#60;/version_info&#62;
&#60;home_list&#62;
&#60;home NAME=&#34;oradb&#34; LOC=&#34;/oracle/product/9.2.0.4&#34; TYPE=&#34;O&#34; IDX=&#34;1&#34;/&#62;
&#60;/home_list&#62;
&#60;/inventory&#62;

这里的HOME NAME指的就是ORACLE_HOME_NAME，而oradb就是ORACLE_HOME_NAME的value了。
&#8212; The End &#8212;
]]></description>
			<content:encoded><![CDATA[<p>ORACLE_HOME_NAME 其实跟ORACLE_HOME的含义是一样的，是在oracle初始版本安装时指定的。<br />
在最近一次升级9208时发现，指定补丁安装的目录名称时，这个ORACLE_HOME_NAME一定要跟初始安装时一样，否则就会报错，例如这里我写成了OUIHome1：<br />
<span id="more-642"></span><br />
<img src="http://www.dbaroad.me/image/archive//oracle_home_name.jpg" alt="" title="ORACLE_HOME" width="558" height="430" /></p>
<p>这里提示的oradb就是ORACLE_HOME_NAME，太有误导性了，搞成跟数据库名一样，半天没看明白。</p>
<p>要确认ORACLE_HOME_NAME，还可以通过oraInventory目录下的ContentsXML/inventory.xml文件：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p6422"><td class="code" id="p642code2"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;"># cat /etc/oraInst.loc</span>
inventory_loc<span style="color: #000000;">=/</span>oradata<span style="color: #000000;">/</span>oraInventory
inst_group<span style="color: #000000;">=</span>oinstall
<span style="color: #000000;"># cd /oradata/oraInventory</span>
<span style="color: #000000;"># cd ContentsXML</span>
<span style="color: #000000;"># cat inventory.xml</span>
<span style="color: #000000;">&lt;</span> ?xml version<span style="color: #000000;">=</span><span style="color: 000000;">&quot;1.0&quot;</span> standalone<span style="color: #000000;">=</span><span style="color: 000000;">&quot;yes&quot;</span> ?<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">&lt;</span>!<span style="color: #000000;">-- Copyright (c) 2001 Oracle Corporation. All rights Reserved --&gt;</span>
<span style="color: #000000;">&lt;</span>!<span style="color: #000000;">-- Do not modify the contents of this file by hand. --&gt;</span>
<span style="color: #000000;">&lt;</span>inventory<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">&lt;</span>version_info<span style="color: #000000;">&gt;</span>
   <span style="color: #000000;">&lt;</span>saved_with<span style="color: #000000;">&gt;</span>2<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>18<span style="color: #000000;">.</span>0<span style="color: #000000;">&lt;/</span>saved_with<span style="color: #000000;">&gt;</span>
   <span style="color: #000000;">&lt;</span>minimum_ver<span style="color: #000000;">&gt;</span>2<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>6<span style="color: #000000;">.</span>0<span style="color: #000000;">&lt;/</span>minimum_ver<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">&lt;/</span>version_info<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">&lt;</span>home_list<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">&lt;</span>home NAME<span style="color: #000000;">=</span><span style="color: 000000;">&quot;oradb&quot;</span> LOC<span style="color: #000000;">=</span><span style="color: 000000;">&quot;/oracle/product/9.2.0.4&quot;</span> TYPE<span style="color: #000000;">=</span><span style="color: 000000;">&quot;O&quot;</span> IDX<span style="color: #000000;">=</span><span style="color: 000000;">&quot;1&quot;</span><span style="color: #000000;">/&gt;</span>
<span style="color: #000000;">&lt;/</span>home_list<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">&lt;/</span>inventory<span style="color: #000000;">&gt;</span></pre></td></tr></table></div>

<p>这里的HOME NAME指的就是ORACLE_HOME_NAME，而oradb就是ORACLE_HOME_NAME的value了。</p>
<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/05/oracle_home_name.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux下OUI乱码</title>
		<link>http://www.dbaroad.me/archives/2010/05/linux_oui.html</link>
		<comments>http://www.dbaroad.me/archives/2010/05/linux_oui.html#comments</comments>
		<pubDate>Wed, 19 May 2010 01:48:20 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[Unix | Shell]]></category>

		<category><![CDATA[基础知识]]></category>

		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=640</guid>
		<description><![CDATA[在Linux下遇到OUI乱码，第一次遇到这样的情况，首先想到环境变量设置不对。
设置以下环境变量后，未再显示乱码：

export LC_ALL=en_US


后来同事也提供了一种方法：

unset LANG

查找了一些资料：点击查看相关文章
LC_ALL与LANG都是与语言相关的环境变量的统称，其它还有很多，比如：
LC _CTYPE, LC_TIME, LC_NUMERIC, LC_COLLATE
其中LC_ALL优先级最高，而LANG优先级最低。
&#8212; The End &#8212;
]]></description>
			<content:encoded><![CDATA[<p>在Linux下遇到OUI乱码，第一次遇到这样的情况，首先想到环境变量设置不对。<br />
设置以下环境变量后，未再显示乱码：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p6405"><td class="code" id="p640code5"><pre class="sql" style="font-family:monospace;">export LC_ALL<span style="color: #000000;">=</span>en_US</pre></td></tr></table></div>

<p><span id="more-640"></span><br />
后来同事也提供了一种方法：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p6406"><td class="code" id="p640code6"><pre class="sql" style="font-family:monospace;">unset LANG</pre></td></tr></table></div>

<p>查找了一些资料：<a href="http://hi.baidu.com/edeed/blog/item/2e99a14440bd8884b2b7dcb1.html" target=_blank>点击查看相关文章</a></p>
<p>LC_ALL与LANG都是与语言相关的环境变量的统称，其它还有很多，比如：</p>
<p>LC _CTYPE, LC_TIME, LC_NUMERIC, LC_COLLATE</p>
<p>其中LC_ALL优先级最高，而LANG优先级最低。</p>
<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/05/linux_oui.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>RAC环境下library cache pin/lock的处理</title>
		<link>http://www.dbaroad.me/archives/2010/05/rac_pin_lock.html</link>
		<comments>http://www.dbaroad.me/archives/2010/05/rac_pin_lock.html#comments</comments>
		<pubDate>Mon, 17 May 2010 02:50:52 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[故障案例]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=635</guid>
		<description><![CDATA[这个案例放着很久了，最近又有遇到，小结了一下。
RAC环境下，主要是不同实例上handle地址（kglpnhdl or kgllkhdl）不同，所以如果pin/lock被不同的节点持有时，处理起来就略有不同，看下面这个例子：

实例1上进行授权操作，发现会话挂起，等待事件为：library cache pin:

SQL&#62; select inst_id, sid, event, p1raw
  2    from gv$session_wait
  3   where event = 'library cache pin';
&#160;
   INST_ID        SID EVENT                P1RAW
---------- [...]]]></description>
			<content:encoded><![CDATA[<p>这个案例放着很久了，最近又有遇到，小结了一下。<br />
RAC环境下，主要是不同实例上handle地址（kglpnhdl or kgllkhdl）不同，所以如果pin/lock被不同的节点持有时，处理起来就略有不同，看下面这个例子：<br />
<span id="more-635"></span><br />
实例1上进行授权操作，发现会话挂起，等待事件为：library cache pin:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p63510"><td class="code" id="p635code10"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> inst_id<span style="color: #000000;">,</span> sid<span style="color: #000000;">,</span> event<span style="color: #000000;">,</span> p1raw
  <span style="color: 000000;">2</span>    <span style="color: #000000;">from</span> gv$session_wait
  <span style="color: 000000;">3</span>   <span style="color: #000000;">where</span> event <span style="color: #000000;">=</span> <span style="color: 000000;">'library cache pin'</span>;
&nbsp;
   INST_ID        SID EVENT                P1RAW
<span style="color: #000000;">---------- ---------- -------------------- ----------------</span>
         <span style="color: 000000;">1</span>       <span style="color: 000000;">2325</span> library cache pin    C00000087F12E1F8</pre></td></tr></table></div>

<p>实例1上，只有一个请求pin的会话，也就是当前在做授权的会话：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p63511"><td class="code" id="p635code11"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> inst_id<span style="color: #000000;">,</span> KGLPNUSE<span style="color: #000000;">,</span> KGLPNHDL<span style="color: #000000;">,</span> KGLPNMOD<span style="color: #000000;">,</span> KGLPNREQ
  <span style="color: 000000;">2</span>    <span style="color: #000000;">from</span> x$kglpn
  <span style="color: 000000;">3</span>   <span style="color: #000000;">where</span> kglpnhdl <span style="color: #000000;">=</span> <span style="color: 000000;">'C00000087F12E1F8'</span>
  <span style="color: 000000;">4</span>   <span style="color: #000000;">order</span> <span style="color: #000000;">by</span> KGLPNREQ;
&nbsp;
INST_ID KGLPNUSE         KGLPNHDL           KGLPNMOD   KGLPNREQ
<span style="color: #000000;">------- ---------------- ---------------- ---------- ----------</span>
      <span style="color: 000000;">1</span> C0000007C97625C0 C00000087F12E1F8          <span style="color: 000000;">0</span>          <span style="color: 000000;">3</span>
&nbsp;
SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> sid<span style="color: #000000;">,</span>serial<span style="color: #000000;">#,sql_hash_value,username,machine from v$session</span>
  <span style="color: 000000;">2</span>  <span style="color: #000000;">where</span> saddr<span style="color: #000000;">=</span><span style="color: 000000;">'C0000007C97625C0'</span>;
&nbsp;
   SID    SERIAL<span style="color: #000000;"># SQL_HASH_VALUE USERNAME  MACHINE</span>
<span style="color: #000000;">------ ---------- -------------- --------- -------</span>
  <span style="color: 000000;">2325</span>       <span style="color: 000000;">5103</span>     <span style="color: 000000;">3038871805</span> SYS       host1
&nbsp;
SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> kglnaown<span style="color: #000000;">,</span> kglnaobj
  <span style="color: 000000;">2</span>    <span style="color: #000000;">from</span> X$KGLOB
  <span style="color: 000000;">3</span>   <span style="color: #000000;">where</span> KGLHDADR <span style="color: #000000;">=</span> <span style="color: 000000;">'C00000087F12E1F8'</span>;
&nbsp;
KGLNAOWN   KGLNAOBJ
<span style="color: #000000;">---------- ---------------</span>
U_NAME     OBJ2CHANNEL</pre></td></tr></table></div>

<p>那么这个对象很有可能在实例2上被pin住了。<br />
每个实例都有自己的shared pool，handle地址不同也比较好理解，所以不能用handle地址去查找了。<br />
但有一点是不会变的，那就是x$kglob中显示的被pin住的对象，因此，这个handle地址就可以从x$kglob中获取了。<br />
几个视图关联下，就可以通过以下这个语句在另一个节点上来查找持有pin的会话：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p63512"><td class="code" id="p635code12"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> p<span style="color: #000000;">.</span>inst_id<span style="color: #000000;">,</span>
  <span style="color: 000000;">2</span>         s<span style="color: #000000;">.</span>sid<span style="color: #000000;">,</span>
  <span style="color: 000000;">3</span>         s<span style="color: #000000;">.</span>sql_hash_value<span style="color: #000000;">,</span>
  <span style="color: 000000;">4</span>         s<span style="color: #000000;">.</span>username<span style="color: #000000;">,</span>
  <span style="color: 000000;">5</span>         s<span style="color: #000000;">.</span>osuser<span style="color: #000000;">,</span>
  <span style="color: 000000;">6</span>         s<span style="color: #000000;">.</span>machine<span style="color: #000000;">,</span>
  <span style="color: 000000;">7</span>         p<span style="color: #000000;">.</span>KGLPNUSE<span style="color: #000000;">,</span>
  <span style="color: 000000;">8</span>         p<span style="color: #000000;">.</span>KGLPNHDL<span style="color: #000000;">,</span>
  <span style="color: 000000;">9</span>         p<span style="color: #000000;">.</span>KGLPNMOD<span style="color: #000000;">,</span>
 <span style="color: 000000;">10</span>         p<span style="color: #000000;">.</span>KGLPNREQ<span style="color: #000000;">,</span>
 <span style="color: 000000;">11</span>         o<span style="color: #000000;">.</span>kglnaobj
 <span style="color: 000000;">12</span>    <span style="color: #000000;">from</span> v$session s<span style="color: #000000;">,</span> x$kglpn p<span style="color: #000000;">,</span> x$kglob o
 <span style="color: 000000;">13</span>   <span style="color: #000000;">where</span> o<span style="color: #000000;">.</span>kglnaobj <span style="color: #000000;">=</span> <span style="color: 000000;">'OBJ2CHANNEL'</span>
 <span style="color: 000000;">14</span>     <span style="color: #000000;">and</span> p<span style="color: #000000;">.</span>kglpnhdl <span style="color: #000000;">=</span> o<span style="color: #000000;">.</span>kglhdadr
 <span style="color: 000000;">15</span>     <span style="color: #000000;">and</span> s<span style="color: #000000;">.</span>SADDR <span style="color: #000000;">=</span> p<span style="color: #000000;">.</span>kglpnuse
 <span style="color: 000000;">16</span>     <span style="color: #000000;">and</span> p<span style="color: #000000;">.</span>KGLPNMOD <span style="color: #000000;">&lt;&gt;</span> <span style="color: 000000;">0</span>;
&nbsp;
INST_ID SID SQL_HASH_VALUE USERNAME OSUSER MACHINE KGLPNUSE         KGLPNHDL         KGLPNMOD KGLPNREQ KGLNAOBJ
<span style="color: #000000;">------- --- -------------- -------- ------ ------- ---------------- ---------------- -------- -------- ---------</span>
      <span style="color: 000000;">2</span> <span style="color: 000000;">197</span>     <span style="color: 000000;">4062951240</span> U_NAME   u_name host2   C00000081E3E5C60 C000000888817D68        <span style="color: 000000;">2</span>        <span style="color: 000000;">0</span> OBJ2CHANN
      <span style="color: 000000;">2</span> <span style="color: 000000;">197</span>     <span style="color: 000000;">4062951240</span> U_NAME   u_name host2   C00000081E3E5C60 C00000088ED88980        <span style="color: 000000;">2</span>        <span style="color: 000000;">0</span> OBJ2CHANN</pre></td></tr></table></div>

<p>library cache lock处理类同，只是视图换一下（x$kgllk）。<br />
&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/05/rac_pin_lock.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>HA与RAC组件</title>
		<link>http://www.dbaroad.me/archives/2010/05/ha_rac_option.html</link>
		<comments>http://www.dbaroad.me/archives/2010/05/ha_rac_option.html#comments</comments>
		<pubDate>Sat, 15 May 2010 14:47:47 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[基础知识]]></category>

		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=633</guid>
		<description><![CDATA[最近在AIX下重新安装数据库软件时，发现在已安装HA的情况下，默认总是会安装RAC组件，执行rootpre.sh时会有如下提示：


# ./rootpre.sh
&#160;
Configuring Asynchronous I/O...
Asynchronous I/O is already defined
/bin/chgrp: unknown group: hagsuser
Unable to change the group ownership of /var/ha/soc/grpsvcsdsocket.SXCZ_cluster.
Aborting pre-installation procedure. Installations of Oracle may fail.

在rootpre.sh中，找到判断HA的这行：

isHACMP=`/bin/odmget HACMPnode 2&#62;/dev/null &#124; wc -l`

改了一下，未再要求添加hagsuser组，但安装时，仍会安装RAC组件。
根据以前的一些笔记，在这样的情况下，创建数据选择非cluster database时，会报ORA-32700错误：

$ oerr ora 32700 
32700, 00000, &#34;error occurred in DIAG Group Service&#34;
// *Cause: An unexpected error occurred while performing a DIAG Group Service
//   [...]]]></description>
			<content:encoded><![CDATA[<p>最近在AIX下重新安装数据库软件时，发现在已安装HA的情况下，默认总是会安装RAC组件，执行rootpre.sh时会有如下提示：<br />
<span id="more-633"></span></p>

<div class="wp_codebox"><table width="100%" ><tr id="p63317"><td class="code" id="p633code17"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;"># ./rootpre.sh</span>
&nbsp;
Configuring Asynchronous I<span style="color: #000000;">/</span>O<span style="color: #000000;">...</span>
Asynchronous I<span style="color: #000000;">/</span>O <span style="color: #000000;">is</span> already defined
<span style="color: #000000;">/</span>bin<span style="color: #000000;">/</span>chgrp: unknown <span style="color: #000000;">group</span>: hagsuser
Unable <span style="color: #000000;">to</span> <span style="color: #000000;">change</span> the <span style="color: #000000;">group</span> ownership of <span style="color: #000000;">/</span>var<span style="color: #000000;">/</span>ha<span style="color: #000000;">/</span>soc<span style="color: #000000;">/</span>grpsvcsdsocket<span style="color: #000000;">.</span>SXCZ_cluster<span style="color: #000000;">.</span>
Aborting pre<span style="color: #000000;">-</span>installation procedure<span style="color: #000000;">.</span> Installations of Oracle may fail<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>在rootpre.sh中，找到判断HA的这行：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p63318"><td class="code" id="p633code18"><pre class="sql" style="font-family:monospace;">isHACMP<span style="color: #000000;">=</span><span style="color: 000000;">`/bin/odmget HACMPnode 2&gt;/dev/null | wc -l`</span></pre></td></tr></table></div>

<p>改了一下，未再要求添加hagsuser组，但安装时，仍会安装RAC组件。</p>
<p>根据以前的一些笔记，在这样的情况下，创建数据选择非cluster database时，会报ORA-32700错误：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p63319"><td class="code" id="p633code19"><pre class="sql" style="font-family:monospace;">$ oerr ora <span style="color: 000000;">32700</span> 
<span style="color: 000000;">32700</span><span style="color: #000000;">,</span> 00000<span style="color: #000000;">,</span> <span style="color: 000000;">&quot;error occurred in DIAG Group Service&quot;</span>
<span style="color: #000000;">//</span> <span style="color: #000000;">*</span>Cause: An unexpected error occurred while performing a DIAG <span style="color: #000000;">Group</span> Service
<span style="color: #000000;">//</span>         operation<span style="color: #000000;">.</span>
<span style="color: #000000;">//</span> <span style="color: #000000;">*</span>Action: Verify that the DIAG process <span style="color: #000000;">is</span> still active<span style="color: #000000;">.</span> Also<span style="color: #000000;">,</span> <span style="color: #000000;">check</span> the
<span style="color: #000000;">//</span>          Oracle DIAG trace files <span style="color: #000000;">for</span> errors<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>没找到取消RAC组件的安装办法，最终还是在软件安装完成后，再卸载掉RAC组件：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p63320"><td class="code" id="p633code20"><pre class="sql" style="font-family:monospace;">make <span style="color: #000000;">-</span>f ins_rdbms<span style="color: #000000;">.</span>mk rac_off
make <span style="color: #000000;">-</span>f ins_rdbms<span style="color: #000000;">.</span>mk ioracle</pre></td></tr></table></div>

<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/05/ha_rac_option.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>西塘印象</title>
		<link>http://www.dbaroad.me/archives/2010/03/xitang.html</link>
		<comments>http://www.dbaroad.me/archives/2010/03/xitang.html#comments</comments>
		<pubDate>Tue, 30 Mar 2010 14:16:07 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[生活杂谈]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=631</guid>
		<description><![CDATA[上周六去西塘逛了一下，其实我想说的是，西塘这地方，不咋好玩。

总体印象：人多、水脏，街道窄。
估计坐下来喝杯茶，比逛来逛去，感觉要好。
晚上夜景应该会好一点，不过我们没呆太久。

&#8212; The End &#8212;
]]></description>
			<content:encoded><![CDATA[<p>上周六去西塘逛了一下，其实我想说的是，西塘这地方，不咋好玩。</p>
<p><span id="more-631"></span><br />
总体印象：人多、水脏，街道窄。</p>
<p>估计坐下来喝杯茶，比逛来逛去，感觉要好。</p>
<p>晚上夜景应该会好一点，不过我们没呆太久。</p>
<p><img src="http://www.dbaroad.me/image/archive//st_001.jpg" alt="" width="427" height="640" /></p>
<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/03/xitang.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>AIX 6.1下RAC安装问题小结</title>
		<link>http://www.dbaroad.me/archives/2010/03/aix_61_rac_install.html</link>
		<comments>http://www.dbaroad.me/archives/2010/03/aix_61_rac_install.html#comments</comments>
		<pubDate>Tue, 30 Mar 2010 06:00:00 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[技术专题]]></category>

		<category><![CDATA[本站推荐]]></category>

		<category><![CDATA[HA]]></category>

		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=628</guid>
		<description><![CDATA[最近在AIX 6.1上安装了一套RAC，实施得不多，遇到不少问题，记录一下：
OS版本：

HOST_NAM_1:/#oslevel -s
6100-04-02-1007

HA版本：

HOST_NAM_1:/#lslpp -l cluster.*
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  cluster.adt.es.client.include
     [...]]]></description>
			<content:encoded><![CDATA[<p>最近在AIX 6.1上安装了一套RAC，实施得不多，遇到不少问题，记录一下：</p>
<p>OS版本：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62848"><td class="code" id="p628code48"><pre class="sql" style="font-family:monospace;">HOST_NAM_1:<span style="color: #000000;">/</span><span style="color: #000000;">#oslevel -s</span>
<span style="color: 000000;">6100</span><span style="color: #000000;">-</span>04<span style="color: #000000;">-</span>02<span style="color: #000000;">-</span><span style="color: 000000;">1007</span></pre></td></tr></table></div>

<p>HA版本：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62849"><td class="code" id="p628code49"><pre class="sql" style="font-family:monospace;">HOST_NAM_1:<span style="color: #000000;">/</span><span style="color: #000000;">#lslpp -l cluster.*</span>
  Fileset                      Level  State      Description         
  <span style="color: #000000;">----------------------------------------------------------------------------</span>
Path: <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>lib<span style="color: #000000;">/</span>objrepos
  cluster<span style="color: #000000;">.</span>adt<span style="color: #000000;">.</span>es<span style="color: #000000;">.</span>client<span style="color: #000000;">.</span>include
                             5<span style="color: #000000;">.</span>5<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>0  COMMITTED  ES Client Include Files
  cluster<span style="color: #000000;">.</span>adt<span style="color: #000000;">.</span>es<span style="color: #000000;">.</span>client<span style="color: #000000;">.</span>samples<span style="color: #000000;">.</span>clinfo
                             5<span style="color: #000000;">.</span>5<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>0  COMMITTED  ES Client CLINFO Samples
  cluster<span style="color: #000000;">.</span>adt<span style="color: #000000;">.</span>es<span style="color: #000000;">.</span>client<span style="color: #000000;">.</span>samples<span style="color: #000000;">.</span>clstat
                             5<span style="color: #000000;">.</span>5<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>1  COMMITTED  ES Client Clstat Samples</pre></td></tr></table></div>

<p><span id="more-628"></span><br />
<strong>### RSH 报错</strong></p>

<div class="wp_codebox"><table width="100%" ><tr id="p62850"><td class="code" id="p628code50"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">#rsh HOST_NAM_2 date</span>
rshd: 0826<span style="color: #000000;">-</span><span style="color: 000000;">813</span> Permission <span style="color: #000000;">is</span> denied<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>相关文件配置：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62851"><td class="code" id="p628code51"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">#cat .rhosts</span>
HOST_NAM_1 root
HOST_NAM_2 root
HOST_NAM_1 oracle
HOST_NAM_2 oracle
&nbsp;
<span style="color: #000000;">#cat /etc/hosts.equiv</span>
HOST_NAM_1 root
HOST_NAM_2 root
HOST_NAM_1 oracle
HOST_NAM_2 oracle</pre></td></tr></table></div>

<p>其中HOST_NAM_1、HOST_NAM_2是HOSTNAME。</p>
<p>这里主要是/etc/hosts文件中，HOSTNAME不能当作别名，或者，&#8221;.rhosts&#8221;、&#8221;hosts.equiv&#8221;里不要配别名，应该是跟解析有关。</p>
<p>原HOSTS配置：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62852"><td class="code" id="p628code52"><pre class="sql" style="font-family:monospace;">175<span style="color: #000000;">.</span>16<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>11    HOST_NAM_1_boot1  HOST_NAM_1
175<span style="color: #000000;">.</span>16<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>12    HOST_NAM_2_boot1  HOST_NAM_2
&nbsp;
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>17   HOST_NAM_1_boot2
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>18   HOST_NAM_2_boot2
&nbsp;
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16   HOST_NAM_2_vip
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>15   HOST_NAM_1_vip</pre></td></tr></table></div>

<p>改为：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62853"><td class="code" id="p628code53"><pre class="sql" style="font-family:monospace;">175<span style="color: #000000;">.</span>16<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>11    HOST_NAM_1_boot1  
175<span style="color: #000000;">.</span>16<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>12    HOST_NAM_2_boot1      
&nbsp;
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>17   HOST_NAM_1  HOST_NAM_1_boot2
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>18   HOST_NAM_2  HOST_NAM_2_boot2
&nbsp;
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16   HOST_NAM_2_vip
192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>15   HOST_NAM_1_vip</pre></td></tr></table></div>

<p><strong>### rootpre.sh报错</strong></p>
<p>这个安装前在文档中有到看到，作为注意事项记录一下：<br />
The Oracle 10gR2 OUI and configuration assistant programs do not recognize AIX 6 V6.1 as a supported release.<br />
执行rootpre.sh时会报：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62854"><td class="code" id="p628code54"><pre class="sql" style="font-family:monospace;">Configuring Asynchronous I<span style="color: #000000;">/</span>O<span style="color: #000000;">....</span>
&nbsp;
Asynchronous I<span style="color: #000000;">/</span>O <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> installed <span style="color: #000000;">on</span> this system<span style="color: #000000;">.</span>
&nbsp;
You will need <span style="color: #000000;">to</span> install it<span style="color: #000000;">,</span> <span style="color: #000000;">and</span> either configure it yourself <span style="color: #000000;">using</span>
&nbsp;
<span style="color: 000000;">'smit aio'</span> <span style="color: #000000;">or</span> rerun the Oracle root installation procedure<span style="color: #000000;">.</span>
&nbsp;
&nbsp;
&nbsp;
Configuring POSIX Asynchronous I<span style="color: #000000;">/</span>O<span style="color: #000000;">....</span>
&nbsp;
Posix Asynchronous I<span style="color: #000000;">/</span>O <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> installed <span style="color: #000000;">on</span> this system<span style="color: #000000;">.</span>
&nbsp;
You will need <span style="color: #000000;">to</span> install it<span style="color: #000000;">,</span> <span style="color: #000000;">and</span> either configure it yourself <span style="color: #000000;">using</span>
&nbsp;
<span style="color: 000000;">'smit aio'</span> <span style="color: #000000;">or</span> rerun the Oracle root installation procedure<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>解决方法：下载6718715补丁，执行里面的rootpre.sh</p>
<p>参考文档：282036.1</p>
<p><strong>### VIPCA 报错</strong></p>
<p>VIPCA时，VIP起不来，日志报错信息：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62855"><td class="code" id="p628code55"><pre class="sql" style="font-family:monospace;">Interface en4 checked failed <span style="color: 000000;">&#40;</span>host<span style="color: #000000;">=</span>HOST_NAM_1<span style="color: 000000;">&#41;</span>
Invalid parameters<span style="color: #000000;">,</span> <span style="color: #000000;">or</span> failed <span style="color: #000000;">to</span> bring up VIP <span style="color: 000000;">&#40;</span>host<span style="color: #000000;">=</span>HOST_NAM_1<span style="color: 000000;">&#41;</span></pre></td></tr></table></div>

<p>原因：VIP绑定的是小机集成的网卡　Logical Host Ethernet Port (lp-hea)<br />
The entstat output for LHEA is different from a regular adapter</p>
<p>解决方法：<br />
修改racgvip脚本，找到<br />
$ENTSTAT -d $_IF　这行，修改为：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62856"><td class="code" id="p628code56"><pre class="sql" style="font-family:monospace;">$ENTSTAT <span style="color: #000000;">-</span>d $_IF <span style="color: #000000;">|</span> $GREP <span style="color: #000000;">-</span>iEq <span style="color: 000000;">'.*lan.*state.*:.*operational.*|.*link.*status.*:.*up.*|.*port.*operational.*state.*:.*up.*|.*driver.*flags.*:.*up.*'</span></pre></td></tr></table></div>

<p>参考文档：959746.1</p>
<p><strong>### ONS 起不来</strong></p>
<p>日志报错信息：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62857"><td class="code" id="p628code57"><pre class="sql" style="font-family:monospace;">Failed <span style="color: #000000;">to</span> get IP <span style="color: #000000;">for</span> localhost <span style="color: 000000;">&#40;</span><span style="color: 000000;">0</span><span style="color: 000000;">&#41;</span>
Failed <span style="color: #000000;">to</span> get IP <span style="color: #000000;">for</span> localhost <span style="color: 000000;">&#40;</span><span style="color: 000000;">0</span><span style="color: 000000;">&#41;</span>
Failed <span style="color: #000000;">to</span> get IP <span style="color: #000000;">for</span> localhost <span style="color: 000000;">&#40;</span><span style="color: 000000;">0</span><span style="color: 000000;">&#41;</span>
onsctl: ons failed <span style="color: #000000;">to</span> start</pre></td></tr></table></div>

<p>解决方法：<br />
原hosts文件中找不到localhost：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62858"><td class="code" id="p628code58"><pre class="sql" style="font-family:monospace;">127<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>1    loopback</pre></td></tr></table></div>

<p>改为：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62859"><td class="code" id="p628code59"><pre class="sql" style="font-family:monospace;">127<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>1    loopback localhost</pre></td></tr></table></div>

<p><strong>### CRS 升级10.2.0.4报错</strong></p>
<p>升级完成后执行root102.sh，报：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62860"><td class="code" id="p628code60"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;"># ./root102.sh</span>
Error : Please <span style="color: #000000;">change</span> the CRS_ORACLE_USER id oracle 
         <span style="color: #000000;">to</span> have the following OS capabilities : 
  <span style="color: #000000;">&lt;</span> CAP_PROPAGATE CAP_BYPASS_RAC_VMM CAP_NUMA_ATTACH <span style="color: #000000;">&gt;</span></pre></td></tr></table></div>

<p>解决方法：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62861"><td class="code" id="p628code61"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">#chuser capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE,CAP_NUMA_ATTACH oracle</span>
<span style="color: #000000;">#lsuser -f oracle | grep capabilities</span>
        capabilities<span style="color: #000000;">=</span>CAP_BYPASS_RAC_VMM<span style="color: #000000;">,</span>CAP_PROPAGATE<span style="color: #000000;">,</span>CAP_NUMA_ATTACH</pre></td></tr></table></div>

<p>这个报错之前遇到过，升级的文档中，也有提到。</p>
<p><strong>### CRS 升级10.2.0.4后，VIP起不来</strong></p>
<p>这次的有点难搞，日志中没有太多的信息，只有一行：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62862"><td class="code" id="p628code62"><pre class="sql" style="font-family:monospace;">Invalid parameters<span style="color: #000000;">,</span> <span style="color: #000000;">or</span> failed <span style="color: #000000;">to</span> bring up VIP <span style="color: 000000;">&#40;</span>host<span style="color: #000000;">=</span>HOST_NAM_1<span style="color: 000000;">&#41;</span></pre></td></tr></table></div>

<p>后来使用crsctl对VIP进行debug，收集更多的信息：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62863"><td class="code" id="p628code63"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">#crsctl debug log res &quot;ora.host_nam_2.vip:5&quot; </span>
<span style="color: #000000;">Set</span> Resource Debug Module: ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip  Level: <span style="color: 000000;">5</span>
<span style="color: #000000;">#srvctl start nodeapps -n host_nam_2</span>
CRS<span style="color: #000000;">-</span>0233: Resource <span style="color: #000000;">or</span> relatives are currently involved <span style="color: #000000;">with</span> another operation<span style="color: #000000;">.</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">25</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Checking interface existance
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">25</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Calling getifbyip
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">25</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> getifbyip:  started <span style="color: #000000;">for</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">26</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> getifbyip: checking <span style="color: #000000;">if</span> failover <span style="color: #000000;">is</span> happening <span style="color: 000000;">&#40;</span><span style="color: 000000;">&#41;</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">26</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> getifbyip: failover <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> happening <span style="color: 000000;">&#40;</span><span style="color: 000000;">&#41;</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">26</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Completed getifbyip
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">26</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> ping_vip 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16 started
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">26</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> About <span style="color: #000000;">to</span> execute : <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>ping  <span style="color: #000000;">-</span>c <span style="color: 000000;">1</span> <span style="color: #000000;">-</span>w <span style="color: 000000;">1</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> ping_vip: 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16 <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> pingable<span style="color: #000000;">,</span> _count <span style="color: #000000;">=</span> <span style="color: 000000;">1</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Completed <span style="color: #000000;">with</span> initial interface test
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Broadcast <span style="color: #000000;">=</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>255
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Interface tests
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> checkIf: start <span style="color: #000000;">for</span> <span style="color: #000000;">if</span><span style="color: #000000;">=</span>en4
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> IsIfAlive: start <span style="color: #000000;">for</span> <span style="color: #000000;">if</span><span style="color: #000000;">=</span>en4
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> defaultgw:  started
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> defaultgw:  completed <span style="color: #000000;">with</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>254
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">27</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> About <span style="color: #000000;">to</span> execute command: <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>ping <span style="color: #000000;">-</span>S 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>18  <span style="color: #000000;">-</span>c <span style="color: 000000;">1</span> <span style="color: #000000;">-</span>w <span style="color: 000000;">1</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>254
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">28</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> About <span style="color: #000000;">to</span> execute command: <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>ping <span style="color: #000000;">-</span>S 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>18  <span style="color: #000000;">-</span>c <span style="color: 000000;">1</span> <span style="color: #000000;">-</span>w <span style="color: 000000;">1</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>254
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">29</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> IsIfAlive: RX packets checked <span style="color: #000000;">if</span><span style="color: #000000;">=</span>en4 failed
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">29</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> Interface en4 checked failed <span style="color: 000000;">&#40;</span>host<span style="color: #000000;">=</span>HOST_NAM_2<span style="color: 000000;">&#41;</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">29</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> IsIfAlive: end <span style="color: #000000;">for</span> <span style="color: #000000;">if</span><span style="color: #000000;">=</span>en4
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">29</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">360824</span> <span style="color: 000000;">&#93;</span> checkIf: end <span style="color: #000000;">for</span> <span style="color: #000000;">if</span><span style="color: #000000;">=</span>en4
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Invalid parameters<span style="color: #000000;">,</span> <span style="color: #000000;">or</span> failed <span style="color: #000000;">to</span> bring up VIP <span style="color: 000000;">&#40;</span>host<span style="color: #000000;">=</span>HOST_NAM_2<span style="color: 000000;">&#41;</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> Checking interface existance
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> Calling getifbyip
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> getifbyip:  started <span style="color: #000000;">for</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> getifbyip: checking <span style="color: #000000;">if</span> failover <span style="color: #000000;">is</span> happening <span style="color: 000000;">&#40;</span><span style="color: 000000;">&#41;</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> getifbyip: failover <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> happening <span style="color: 000000;">&#40;</span><span style="color: 000000;">&#41;</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> Completed getifbyip
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> ping_vip 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16 started
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">30</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> About <span style="color: #000000;">to</span> execute : <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>ping  <span style="color: #000000;">-</span>c <span style="color: 000000;">1</span> <span style="color: #000000;">-</span>w <span style="color: 000000;">1</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">31</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> ping_vip: 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>16 <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> pingable<span style="color: #000000;">,</span> _count <span style="color: #000000;">=</span> <span style="color: 000000;">1</span>
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">31</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> Completed <span style="color: #000000;">with</span> initial interface test
host_nam_2:ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>vip:Thu Mar <span style="color: 000000;">25</span> <span style="color: 000000;">13</span>:<span style="color: 000000;">57</span>:<span style="color: 000000;">31</span> GMT<span style="color: #000000;">+</span>08:00 <span style="color: 000000;">2010</span> <span style="color: 000000;">&#91;</span> <span style="color: 000000;">307376</span> <span style="color: 000000;">&#93;</span> Broadcast <span style="color: #000000;">=</span> 192<span style="color: #000000;">.</span>168<span style="color: #000000;">.</span>10<span style="color: #000000;">.</span>255
CRS<span style="color: #000000;">-</span><span style="color: 000000;">1006</span>: No more members <span style="color: #000000;">to</span> consider
CRS<span style="color: #000000;">-</span>0215: Could <span style="color: #000000;">not</span> start resource <span style="color: 000000;">'ora.host_nam_2.vip'</span><span style="color: #000000;">.</span>
CRS<span style="color: #000000;">-</span>0210: Could <span style="color: #000000;">not</span> find resource ora<span style="color: #000000;">.</span>host_nam_2<span style="color: #000000;">.</span>LISTENER_HOST_NAM_2<span style="color: #000000;">.</span>lsnr<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>这才搜索到了相关信息：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62864"><td class="code" id="p628code64"><pre class="sql" style="font-family:monospace;">Bug <span style="color: 000000;">8413088</span>: VIP CANNOT START <span style="color: #000000;">ON</span> AIX <span style="color: 000000;">6.1</span> BECAUSE NETSTAT HAS A NEW <span style="color: #000000;">COLUMN</span><span style="color: #000000;">.</span>
Bug <span style="color: 000000;">9157855</span>: DURING RESTART <span style="color: #000000;">OR</span> WHEN ONE OF THE TWO NODE CLUSTER <span style="color: #000000;">IS</span> DOWN<span style="color: #000000;">,</span> VIP RESOURCE FAILS</pre></td></tr></table></div>

<p>这个问题，在打完CRS PSU后，也同样有可能存在，可以通过修改racvip脚本来解决：</p>
<p>10.2.0.4：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62865"><td class="code" id="p628code65"><pre class="sql" style="font-family:monospace;">_O1<span style="color: #000000;">=</span><span style="color: 000000;">`$NETSTAT -n -I $_IF | $AWK &quot;{ if (/^$_IF/) {print <span style="color: #000000;">\\</span>$5; exit}}&quot;`</span>
_O2<span style="color: #000000;">=</span><span style="color: 000000;">`$NETSTAT -n -I $_IF | $AWK &quot;{ if (/^$_IF/) {print <span style="color: #000000;">\\</span>$5; exit}}&quot;`</span></pre></td></tr></table></div>

<p>打完PSU后：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62866"><td class="code" id="p628code66"><pre class="sql" style="font-family:monospace;">_O1<span style="color: #000000;">=</span><span style="color: 000000;">`$NETSTAT -n -I $_IF -p tcp | $GREP -iE &quot;.*packets received$&quot; | $AWK &quot;{print <span style="color: #000000;">\\</span>$1; exit}&quot;`</span>
_O2<span style="color: #000000;">=</span><span style="color: 000000;">`$NETSTAT -n -I $_IF -p tcp | $GREP -iE &quot;.*packets received$&quot; | $AWK &quot;{print <span style="color: #000000;">\\</span>$1; exit}&quot;`</span></pre></td></tr></table></div>

<p>最终改为：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62867"><td class="code" id="p628code67"><pre class="sql" style="font-family:monospace;">_O1<span style="color: #000000;">=</span><span style="color: 000000;">`$NETSTAT -n -I $_IF -p ip | $GREP -iE &quot;.*packets received$&quot; | $AWK &quot;{print <span style="color: #000000;">\\</span>$1; exit}&quot;`</span>
_O2<span style="color: #000000;">=</span><span style="color: 000000;">`$NETSTAT -n -I $_IF -p ip | $GREP -iE &quot;.*packets received$&quot; | $AWK &quot;{print <span style="color: #000000;">\\</span>$1; exit}&quot;`</span></pre></td></tr></table></div>

<p>这个问题很杯具，花了很多时间，安装前，阅读相关文档时，我就注意到了这个BUG，两次VIP起不来，我都拿去对比，看看是不是这个BUG。结果还是没发现，一直到debug出来。</p>
<p><strong>### RDBMS升10204时，报java进程没停</strong></p>

<div class="wp_codebox"><table width="100%" ><tr id="p62868"><td class="code" id="p628code68"><pre class="sql" style="font-family:monospace;">Oracle Universal Installer has detected that
there are processes running <span style="color: #000000;">in</span> the
currently selected Oracle Home<span style="color: #000000;">.</span> The
following processes need <span style="color: #000000;">to</span> be shutdown
before continuing:
java</pre></td></tr></table></div>

<p>刚开始时，还有CRS的进程，停掉CRS后，还有一个java始终过不去，用fuser查使用$ORACLE_HOME目录进程，全kill，把ps -ef | grep java 出来的进程，除了安装的进程外都杀了，还是不行。</p>
<p>最后在Metalink上找到了解决方法，升级前：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62869"><td class="code" id="p628code69"><pre class="sql" style="font-family:monospace;">cd <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>
mv fuser fuser<span style="color: #000000;">.</span>orig
touch <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>fuser
chmod <span style="color: #000000;">+</span>x <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>fuser</pre></td></tr></table></div>

<p>升级完成后，再改回来：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62870"><td class="code" id="p628code70"><pre class="sql" style="font-family:monospace;">cd <span style="color: #000000;">/</span>usr<span style="color: #000000;">/</span>sbin<span style="color: #000000;">/</span>
cp fuser<span style="color: #000000;">.</span>orig fuser</pre></td></tr></table></div>

<p>这招很阴啊。。</p>
<p>参考文档：975597.1</p>
<p><strong>### 数据库打完PSU补丁后，启CRS报错</strong></p>
<p>在CRS、database都升级、打补丁完成后，启CRS、VIP等资源时，报错：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62871"><td class="code" id="p628code71"><pre class="sql" style="font-family:monospace;">HOST_NAM_1:<span style="color: #000000;">/</span><span style="color: #000000;">#crsctl start crs</span>
exec<span style="color: 000000;">&#40;</span><span style="color: 000000;">&#41;</span>: 0509<span style="color: #000000;">-</span>036 Cannot <span style="color: #000000;">load</span> program <span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span><span style="color: 000000;">10204</span><span style="color: #000000;">/</span>db_1<span style="color: #000000;">/</span>bin<span style="color: #000000;">/</span>crsctl<span style="color: #000000;">.</span>bin because of the following errors:
        0509<span style="color: #000000;">-</span><span style="color: 000000;">150</span>   Dependent module libhasgen10<span style="color: #000000;">.</span>a<span style="color: 000000;">&#40;</span>shr_hasgen10<span style="color: #000000;">.</span>o<span style="color: 000000;">&#41;</span> could <span style="color: #000000;">not</span> be loaded<span style="color: #000000;">.</span>
        0509<span style="color: #000000;">-</span>022 Cannot <span style="color: #000000;">load</span> module libhasgen10<span style="color: #000000;">.</span>a<span style="color: 000000;">&#40;</span>shr_hasgen10<span style="color: #000000;">.</span>o<span style="color: 000000;">&#41;</span><span style="color: #000000;">.</span>
        0509<span style="color: #000000;">-</span>026 System error: A file <span style="color: #000000;">or</span> directory <span style="color: #000000;">in</span> the path name does <span style="color: #000000;">not</span> exist<span style="color: #000000;">.</span>
&nbsp;
HOST_NAM_1:<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span><span style="color: 000000;">10204</span><span style="color: #000000;">/</span>db_1<span style="color: #000000;">/</span>bin<span style="color: #000000;">#./srvctl stop nodeapps -n host_nam_1</span>
<span style="color: #000000;">./</span>srvctl<span style="color: 000000;">&#91;</span><span style="color: 000000;">187</span><span style="color: 000000;">&#93;</span>: %s_jreLocation%<span style="color: #000000;">/</span>bin<span style="color: #000000;">/</span>java:  <span style="color: #000000;">not</span> found<span style="color: #000000;">.</span>
&nbsp;
HOST_NAM_1:<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span><span style="color: 000000;">10204</span><span style="color: #000000;">/</span>crs_1<span style="color: #000000;">/</span>lib<span style="color: #000000;">#srvctl stop nodeapps -n host_nam_1</span>
<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span><span style="color: 000000;">10204</span><span style="color: #000000;">/</span>db_1<span style="color: #000000;">/</span>bin<span style="color: #000000;">/</span>srvctl<span style="color: 000000;">&#91;</span><span style="color: 000000;">187</span><span style="color: 000000;">&#93;</span>: %s_jreLocation%<span style="color: #000000;">/</span>bin<span style="color: #000000;">/</span>java:  <span style="color: #000000;">not</span> found<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>解决方法：改变环境变量，使从crs_/bin/目录下运行这些命令。</p>
<p><strong>### DBCA时报错</strong></p>
<p>DBCA时，在创建实例这步时，报错：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62872"><td class="code" id="p628code72"><pre class="sql" style="font-family:monospace;">ORA<span style="color: #000000;">-</span><span style="color: 000000;">27504</span>: IPC error creating OSD context
ORA<span style="color: #000000;">-</span><span style="color: 000000;">27300</span>: OS system dependent operation:sendmsg failed <span style="color: #000000;">with</span> <span style="color: #000000;">status</span>: <span style="color: 000000;">59</span>
ORA<span style="color: #000000;">-</span><span style="color: 000000;">27301</span>: OS failure message: Message too long
ORA<span style="color: #000000;">-</span><span style="color: 000000;">27302</span>: failure occurred  at: sskgxpsnd1
ORA<span style="color: #000000;">-</span><span style="color: 000000;">27303</span>: additional information: MTU verification failed <span style="color: #000000;">to</span> send msg</pre></td></tr></table></div>

<p>原因：The problem was caused by incorrect UDP and TCP packet settings.</p>
<p>解决方法：修改以下参数：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62873"><td class="code" id="p628code73"><pre class="sql" style="font-family:monospace;">no <span style="color: #000000;">-</span>o tcp_sendspace<span style="color: #000000;">=</span><span style="color: 000000;">262144</span>
no <span style="color: #000000;">-</span>o tcp_recvspace<span style="color: #000000;">=</span><span style="color: 000000;">262144</span>
no <span style="color: #000000;">-</span>o udp_sendspace<span style="color: #000000;">=</span><span style="color: 000000;">65536</span>
no <span style="color: #000000;">-</span>o udp_recvspace<span style="color: #000000;">=</span><span style="color: 000000;">262144</span>
no <span style="color: #000000;">-</span>o rfc1323<span style="color: #000000;">=</span><span style="color: 000000;">1</span></pre></td></tr></table></div>

<p>之前的参数都偏小：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62874"><td class="code" id="p628code74"><pre class="sql" style="font-family:monospace;">tcp_sendspace <span style="color: 000000;">131072</span> 
tcp_recvspace <span style="color: 000000;">131072</span></pre></td></tr></table></div>

<p>使用no -a查看参数设置</p>
<p>参考文档：300956.1</p>
<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/03/aix_61_rac_install.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>SQL Profiles与语句优化</title>
		<link>http://www.dbaroad.me/archives/2010/03/sql_profiles.html</link>
		<comments>http://www.dbaroad.me/archives/2010/03/sql_profiles.html#comments</comments>
		<pubDate>Tue, 23 Mar 2010 04:50:30 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[SQL优化 | 性能优化]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=626</guid>
		<description><![CDATA[最近对10G的SQL Profiles做了一点学习。 个人理解SQL Profiles可以看作是SQL语句的统计信息。只是这个统计信息对特定SQL语句才能起作用，不对会语句的对象、其它语句产生影响。
使用SQL Profiles前要用SQL Tuning Advisor收集对语句的优化建议，再根据优化建议创建SQL Profiles。
SQL Profiles 使用也比较灵活，可以在会话级、系统级应用。
语句绑定SQL Profile后，测试了下SQL Profile与Bind Peeking的关系。测试发现，Bind Peeking的特性还是会起作用。这从另一方面说明SQL Profile与OUTLINE的不同：绑定OUTLINE后，执行计划是被固化的；绑定SQL Profile后，执行计划不是不变，而是优化器在执行该语句时，会参考SQL Profile中的信息。

SQL Profiles会收集哪些信息？这点比较悬，没找到特别好的解释，不过从DBA_SQLTUNE_STATISTICS视图中也可以看到蛛丝马迹：

CREATE OR REPLACE VIEW DBA_SQLTUNE_STATISTICS AS
SELECT TASK_ID, OBJECT_ID, PARSING_SCHEMA_ID, MODULE, ACTION, ELAPSED_TIME,
         CPU_TIME, BUFFER_GETS, DISK_READS, DIRECT_WRITES,
         ROWS_PROCESSED, FETCHES, EXECUTIONS,
    [...]]]></description>
			<content:encoded><![CDATA[<p>最近对10G的SQL Profiles做了一点学习。 个人理解SQL Profiles可以看作是SQL语句的统计信息。只是这个统计信息对特定SQL语句才能起作用，不对会语句的对象、其它语句产生影响。</p>
<p>使用SQL Profiles前要用SQL Tuning Advisor收集对语句的优化建议，再根据优化建议创建SQL Profiles。</p>
<p>SQL Profiles 使用也比较灵活，可以在会话级、系统级应用。</p>
<p>语句绑定SQL Profile后，测试了下SQL Profile与Bind Peeking的关系。测试发现，Bind Peeking的特性还是会起作用。这从另一方面说明SQL Profile与OUTLINE的不同：绑定OUTLINE后，执行计划是被固化的；绑定SQL Profile后，执行计划不是不变，而是优化器在执行该语句时，会参考SQL Profile中的信息。<br />
<span id="more-626"></span><br />
SQL Profiles会收集哪些信息？这点比较悬，没找到特别好的解释，不过从DBA_SQLTUNE_STATISTICS视图中也可以看到蛛丝马迹：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62686"><td class="code" id="p626code86"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">CREATE</span> <span style="color: #000000;">OR</span> <span style="color: #000000;">REPLACE</span> <span style="color: #000000;">VIEW</span> DBA_SQLTUNE_STATISTICS <span style="color: #000000;">AS</span>
<span style="color: #000000;">SELECT</span> TASK_ID<span style="color: #000000;">,</span> OBJECT_ID<span style="color: #000000;">,</span> PARSING_SCHEMA_ID<span style="color: #000000;">,</span> MODULE<span style="color: #000000;">,</span> ACTION<span style="color: #000000;">,</span> ELAPSED_TIME<span style="color: #000000;">,</span>
         CPU_TIME<span style="color: #000000;">,</span> BUFFER_GETS<span style="color: #000000;">,</span> DISK_READS<span style="color: #000000;">,</span> DIRECT_WRITES<span style="color: #000000;">,</span>
         ROWS_PROCESSED<span style="color: #000000;">,</span> FETCHES<span style="color: #000000;">,</span> EXECUTIONS<span style="color: #000000;">,</span>
         END_OF_FETCH_COUNT<span style="color: #000000;">,</span> OPTIMIZER_COST<span style="color: #000000;">,</span> OPTIMIZER_ENV<span style="color: #000000;">,</span> COMMAND_TYPE
  <span style="color: #000000;">FROM</span>   wri$_adv_sqlt_statistics;</pre></td></tr></table></div>

<p>以下是SQL Profiles的使用步骤，记录一下，当做速查手册：</p>
<p>1、创建优化任务：</p>
<p>&#8211;使用SQL TEXT</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62687"><td class="code" id="p626code87"><pre class="sql" style="font-family:monospace;">DECLARE
 my_task_name VARCHAR2<span style="color: 000000;">&#40;</span><span style="color: 000000;">50</span><span style="color: 000000;">&#41;</span>;
 my_sqltext   CLOB;
BEGIN
 my_sqltext :<span style="color: #000000;">=</span> <span style="color: 000000;">'select /*+ FULL(T) */ * from t where n=:A'</span>;
 my_task_name :<span style="color: #000000;">=</span> DBMS_SQLTUNE<span style="color: #000000;">.</span>CREATE_TUNING_TASK<span style="color: 000000;">&#40;</span>
         sql_text    <span style="color: #000000;">=&gt;</span> my_sqltext<span style="color: #000000;">,</span>
         user_name   <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'ROCKEY'</span><span style="color: #000000;">,</span>
         scope       <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'COMPREHENSIVE'</span><span style="color: #000000;">,</span>
         time_limit  <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">60</span><span style="color: #000000;">,</span>
         task_name   <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: #000000;">,</span>
         description <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'Task to tune a query on a sspecified table'</span><span style="color: 000000;">&#41;</span>;
END;
<span style="color: #000000;">/</span></pre></td></tr></table></div>

<p>&#8211;使用SQL ID:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62688"><td class="code" id="p626code88"><pre class="sql" style="font-family:monospace;">DECLARE
 my_task_name VARCHAR2<span style="color: 000000;">&#40;</span><span style="color: 000000;">50</span><span style="color: 000000;">&#41;</span>;
 my_sql_id   VARCHAR2<span style="color: 000000;">&#40;</span><span style="color: 000000;">64</span><span style="color: 000000;">&#41;</span>;
BEGIN
 my_sql_id :<span style="color: #000000;">=</span> <span style="color: 000000;">'gh991ctttx3k7'</span>;
 my_task_name :<span style="color: #000000;">=</span> DBMS_SQLTUNE<span style="color: #000000;">.</span>CREATE_TUNING_TASK<span style="color: 000000;">&#40;</span>
         sql_id    <span style="color: #000000;">=&gt;</span> my_sql_id<span style="color: #000000;">,</span>
         scope       <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'COMPREHENSIVE'</span><span style="color: #000000;">,</span>
         time_limit  <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">60</span><span style="color: #000000;">,</span>
         task_name   <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: #000000;">,</span>
         description <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'Task to tune a query on a specified table'</span><span style="color: 000000;">&#41;</span>;
END;
<span style="color: #000000;">/</span></pre></td></tr></table></div>

<p>2、执行优化任务：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62689"><td class="code" id="p626code89"><pre class="sql" style="font-family:monospace;">BEGIN
  DBMS_SQLTUNE<span style="color: #000000;">.</span>EXECUTE_TUNING_TASK<span style="color: 000000;">&#40;</span> task_name <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: 000000;">&#41;</span>;
end;
<span style="color: #000000;">/</span></pre></td></tr></table></div>

<p>3、查看优化建议：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62690"><td class="code" id="p626code90"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">SET</span> WRAP <span style="color: #000000;">ON</span>
<span style="color: #000000;">SET</span> LONG <span style="color: 000000;">10000</span>
<span style="color: #000000;">SET</span> LONGCHUNKSIZE <span style="color: 000000;">1000</span>
<span style="color: #000000;">SET</span> LINESIZE <span style="color: 000000;">130</span>
<span style="color: #000000;">SELECT</span> DBMS_SQLTUNE<span style="color: #000000;">.</span>REPORT_TUNING_TASK<span style="color: 000000;">&#40;</span> <span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: 000000;">&#41;</span> <span style="color: #000000;">from</span> DUAL;
或者
<span style="color: #000000;">SELECT</span> dbms_advisor<span style="color: #000000;">.</span>GET_TASK_REPORT<span style="color: 000000;">&#40;</span>task_name<span style="color: 000000;">&#41;</span>
  <span style="color: #000000;">FROM</span> dba_advisor_tasks
 <span style="color: #000000;">where</span> task_name <span style="color: #000000;">=</span> <span style="color: 000000;">'rockey_sql_tuning_task_001'</span>;</pre></td></tr></table></div>

<p>其中dbms_advisor.GET_TASK_REPORT可用于查看ADDM REPORT。</p>
<p>4、创建SQL Profile:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62691"><td class="code" id="p626code91"><pre class="sql" style="font-family:monospace;">DECLARE
 my_sqlprofile_name VARCHAR2<span style="color: 000000;">&#40;</span><span style="color: 000000;">30</span><span style="color: 000000;">&#41;</span>;
BEGIN
 my_sqlprofile_name :<span style="color: #000000;">=</span> DBMS_SQLTUNE<span style="color: #000000;">.</span>ACCEPT_SQL_PROFILE <span style="color: 000000;">&#40;</span>
    task_name <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: #000000;">,</span>
    name      <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'my_sql_profile_001'</span><span style="color: #000000;">,</span>
    category    <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'my_category'</span><span style="color: 000000;">&#41;</span>;
END;
<span style="color: #000000;">/</span></pre></td></tr></table></div>

<p>5、SQL语句绑字SQL Profile：<br />
修改sqltune_category参数，可以会话级、系统级进行更改：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62692"><td class="code" id="p626code92"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">alter</span> session <span style="color: #000000;">set</span> sqltune_category<span style="color: #000000;">=</span>MY_CATEGORY;</pre></td></tr></table></div>

<p>6、查看语句是否使用了SQL Profile：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62693"><td class="code" id="p626code93"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">select</span> sql_text<span style="color: #000000;">,</span> sql_id<span style="color: #000000;">,</span> sql_profile<span style="color: #000000;">,</span> executions<span style="color: #000000;">,</span> plan_hash_value
  <span style="color: #000000;">from</span> v$sql
 <span style="color: #000000;">where</span> sql_profile <span style="color: #000000;">is</span> <span style="color: #000000;">not</span> <span style="color: #000000;">null</span>;</pre></td></tr></table></div>

<p>7、其它常用功能：<br />
删除优化任务：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62694"><td class="code" id="p626code94"><pre class="sql" style="font-family:monospace;">begin
dbms_sqltune<span style="color: #000000;">.</span>drop_tuning_task<span style="color: 000000;">&#40;</span><span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: 000000;">&#41;</span>;
end;
<span style="color: #000000;">/</span>
&nbsp;
begin
dbms_advisor<span style="color: #000000;">.</span>delete_task<span style="color: 000000;">&#40;</span><span style="color: 000000;">'rockey_sql_tuning_task_001'</span><span style="color: 000000;">&#41;</span>;
end;
<span style="color: #000000;">/</span></pre></td></tr></table></div>

<p>删除SQL Profile：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62695"><td class="code" id="p626code95"><pre class="sql" style="font-family:monospace;">BEGIN
  DBMS_SQLTUNE<span style="color: #000000;">.</span>DROP_SQL_PROFILE<span style="color: 000000;">&#40;</span>name <span style="color: #000000;">=&gt;</span> <span style="color: 000000;">'my_sql_profile_001'</span><span style="color: 000000;">&#41;</span>;
END;
<span style="color: #000000;">/</span></pre></td></tr></table></div>

<p>与优化任务相关的常用视图：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p62696"><td class="code" id="p626code96"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">select</span> <span style="color: #000000;">*</span> <span style="color: #000000;">from</span> dba_sql_profiles;
&nbsp;
<span style="color: #000000;">select</span> <span style="color: #000000;">*</span> <span style="color: #000000;">from</span> DBA_ADVISOR_TASKS;</pre></td></tr></table></div>

<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/03/sql_profiles.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>两种锁类型：SQ、JQ</title>
		<link>http://www.dbaroad.me/archives/2010/03/sq_jq_lock.html</link>
		<comments>http://www.dbaroad.me/archives/2010/03/sq_jq_lock.html#comments</comments>
		<pubDate>Fri, 12 Mar 2010 03:31:54 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[基础知识]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=624</guid>
		<description><![CDATA[最近在一个客户的系统上有时可以观察到不少的“enq: SQ - contention”等待，以前一般都按hash_value、event来group by，再按hash_value来找到相关语句，结果相关的SQL语句中没有看到sequence的影子。查看AWR报告，也找不到sequence。最终简单地查了dba_sequences视图，把cache size为0的都调大了。

后来与老大们聊起，才发现enq: SQ - contention的P2字段就是sequence的object id。以前查enqueue光注意P1了：

SQL&#62; select name, parameter1, parameter2, parameter3
  2    from v$event_name
  3   where name = 'enq: SQ - contention';
&#160;
NAME                       [...]]]></description>
			<content:encoded><![CDATA[<p>最近在一个客户的系统上有时可以观察到不少的“enq: SQ - contention”等待，以前一般都按hash_value、event来group by，再按hash_value来找到相关语句，结果相关的SQL语句中没有看到sequence的影子。查看AWR报告，也找不到sequence。最终简单地查了dba_sequences视图，把cache size为0的都调大了。<br />
<span id="more-624"></span><br />
后来与老大们聊起，才发现enq: SQ - contention的P2字段就是sequence的object id。以前查enqueue光注意P1了：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p624100"><td class="code" id="p624code100"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> name<span style="color: #000000;">,</span> parameter1<span style="color: #000000;">,</span> parameter2<span style="color: #000000;">,</span> parameter3
  <span style="color: 000000;">2</span>    <span style="color: #000000;">from</span> v$event_name
  <span style="color: 000000;">3</span>   <span style="color: #000000;">where</span> name <span style="color: #000000;">=</span> <span style="color: 000000;">'enq: SQ - contention'</span>;
&nbsp;
NAME                           PARAMETER1      PARAMETER2      PARAMETER3
<span style="color: #000000;">------------------------------ --------------- --------------- ---------------</span>
enq: SQ <span style="color: #000000;">-</span> contention           name<span style="color: #000000;">|</span>mode       object <span style="color: #000000;">#        0</span></pre></td></tr></table></div>

<p>另外查v$lock，type为SQ，效果是一样的，ID1就是sequence的object id：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p624101"><td class="code" id="p624code101"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> <span style="color: #000000;">*</span> <span style="color: #000000;">from</span> v$lock <span style="color: #000000;">where</span> type<span style="color: #000000;">=</span><span style="color: 000000;">'SQ'</span>;
&nbsp;
ADDR             KADDR             SID TY    ID1 ID2 LMODE REQUEST CTIME BLOCK
<span style="color: #000000;">---------------- ---------------- ---- -- ------ --- ----- ------- ----- -----</span>
C000000A09AAD688 C000000A09AAD6A8  <span style="color: 000000;">972</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">2</span>     <span style="color: 000000;">0</span>
C000000A09AAD7C8 C000000A09AAD7E8 <span style="color: 000000;">1445</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>
C000000A09AAE768 C000000A09AAE788 <span style="color: 000000;">2021</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>
C000000A09AADFE8 C000000A09AAE008 <span style="color: 000000;">2236</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">1</span>     <span style="color: 000000;">0</span>
C000000A09AAE3A8 C000000A09AAE3C8 <span style="color: 000000;">2734</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>
C000000A09AAE588 C000000A09AAE5A8 <span style="color: 000000;">3681</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>
C000000A09AAEF88 C000000A09AAEFA8 <span style="color: 000000;">3748</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>
C000000A09AAE6C8 C000000A09AAE6E8 <span style="color: 000000;">3785</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>       <span style="color: 000000;">6</span>     <span style="color: 000000;">0</span>     <span style="color: 000000;">0</span>
C000000A09AB0248 C000000A09AB0268 <span style="color: 000000;">3867</span> SQ <span style="color: 000000;">371898</span>   <span style="color: 000000;">0</span>     <span style="color: 000000;">6</span>       <span style="color: 000000;">0</span>     <span style="color: 000000;">2</span>     <span style="color: 000000;">1</span>
&nbsp;
SQL<span style="color: #000000;">&gt;</span> <span style="color: #000000;">select</span> object_id<span style="color: #000000;">,</span>owner<span style="color: #000000;">,</span>object_name<span style="color: #000000;">,</span>object_type <span style="color: #000000;">from</span> dba_objects
  <span style="color: 000000;">2</span>  <span style="color: #000000;">where</span> object_id<span style="color: #000000;">=</span><span style="color: 000000;">371898</span>;
&nbsp;
 OBJECT_ID OWNER   OBJECT_NAME       OBJECT_TYPE
<span style="color: #000000;">---------- ------- ----------------- ------------</span>
    <span style="color: 000000;">371898</span> U_NAME  U_NAME_SEQUENCE_1 SEQUENCE
&nbsp;
<span style="color: 000000;">1</span> row selected<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>JQ锁，是一次在查看dba_jobs_running非常慢时，查看了下视图创建语句发现的：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p624102"><td class="code" id="p624code102"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">create</span> <span style="color: #000000;">or</span> <span style="color: #000000;">replace</span> <span style="color: #000000;">view</span> dba_jobs_running <span style="color: #000000;">as</span>
<span style="color: #000000;">select</span> v<span style="color: #000000;">.</span>SID<span style="color: #000000;">,</span> v<span style="color: #000000;">.</span>id2 JOB<span style="color: #000000;">,</span> j<span style="color: #000000;">.</span>FAILURES<span style="color: #000000;">,</span>
    LAST_DATE<span style="color: #000000;">,</span> substr<span style="color: 000000;">&#40;</span>to_char<span style="color: 000000;">&#40;</span>last_date<span style="color: #000000;">,</span><span style="color: 000000;">'HH24:MI:SS'</span><span style="color: 000000;">&#41;</span><span style="color: #000000;">,</span><span style="color: 000000;">1</span><span style="color: #000000;">,</span><span style="color: 000000;">8</span><span style="color: 000000;">&#41;</span> LAST_SEC<span style="color: #000000;">,</span>
    THIS_DATE<span style="color: #000000;">,</span> substr<span style="color: 000000;">&#40;</span>to_char<span style="color: 000000;">&#40;</span>this_date<span style="color: #000000;">,</span><span style="color: 000000;">'HH24:MI:SS'</span><span style="color: 000000;">&#41;</span><span style="color: #000000;">,</span><span style="color: 000000;">1</span><span style="color: #000000;">,</span><span style="color: 000000;">8</span><span style="color: 000000;">&#41;</span> THIS_SEC<span style="color: #000000;">,</span>
    j<span style="color: #000000;">.</span>field1 INSTANCE
  <span style="color: #000000;">from</span> sys<span style="color: #000000;">.</span>job$ j<span style="color: #000000;">,</span> v$lock v
  <span style="color: #000000;">where</span> v<span style="color: #000000;">.</span>type <span style="color: #000000;">=</span> <span style="color: 000000;">'JQ'</span> <span style="color: #000000;">and</span> j<span style="color: #000000;">.</span>job <span style="color: 000000;">&#40;</span><span style="color: #000000;">+</span><span style="color: 000000;">&#41;</span><span style="color: #000000;">=</span> v<span style="color: #000000;">.</span>id2;</pre></td></tr></table></div>

<p>这里就可以看出v$lock中，JQ锁的ID2就是JOB的number了。</p>
<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/03/sq_jq_lock.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>What is rolling patch</title>
		<link>http://www.dbaroad.me/archives/2010/03/rolling_patch.html</link>
		<comments>http://www.dbaroad.me/archives/2010/03/rolling_patch.html#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:21:02 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[基础知识]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=622</guid>
		<description><![CDATA[所谓的rolling patch，最大的特点在于，允许RAC环境下，不同实例运行在不同的数据库版本上，当然这个不同，指的是打上rolling patch后造成的版本不一致：

This patch could be applied to the boxes in a cascaded fashion and the
different instances they could be running with different versions of
the code &#40;the patch causes the code diff&#41; and this is specific for certain
patches which can be applied and would not affect the SGA structures and heaps.

比较让人容易误解的是，以为这是一种online patch，可以不用停数据库，在线打。

rolling patch 还是需要停实例打的。比如在两个节点的RAC环境中，可以按这样的步骤操作：
1、停实例1；2、打补丁；3、启实例1；
4、停实例2；5、打补丁；6、启实例2。
其中有一段时间，实例1、实例2同时启着，且数据库版本不一致，但数据库是不受影响，可以有效地减少停机时间。
如何查看patch是否为rolling patch:
在补丁目录：/etc/config下，有一个inventory文件，其中有一项：

&#60;online_rac_installable&#62;true&#60;/online_rac_installable&#62;

若为true则为rolling [...]]]></description>
			<content:encoded><![CDATA[<p>所谓的rolling patch，最大的特点在于，允许RAC环境下，不同实例运行在不同的数据库版本上，当然这个不同，指的是打上rolling patch后造成的版本不一致：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p622107"><td class="code" id="p622code107"><pre class="sql" style="font-family:monospace;">This patch could be applied <span style="color: #000000;">to</span> the boxes <span style="color: #000000;">in</span> a cascaded fashion <span style="color: #000000;">and</span> the
different instances they could be running <span style="color: #000000;">with</span> different versions of
the code <span style="color: 000000;">&#40;</span>the patch causes the code diff<span style="color: 000000;">&#41;</span> <span style="color: #000000;">and</span> this <span style="color: #000000;">is</span> specific <span style="color: #000000;">for</span> certain
patches which can be applied <span style="color: #000000;">and</span> would <span style="color: #000000;">not</span> affect the SGA structures <span style="color: #000000;">and</span> heaps<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>比较让人容易误解的是，以为这是一种online patch，可以不用停数据库，在线打。<br />
<span id="more-622"></span><br />
rolling patch 还是需要停实例打的。比如在两个节点的RAC环境中，可以按这样的步骤操作：<br />
1、停实例1；2、打补丁；3、启实例1；<br />
4、停实例2；5、打补丁；6、启实例2。</p>
<p>其中有一段时间，实例1、实例2同时启着，且数据库版本不一致，但数据库是不受影响，可以有效地减少停机时间。</p>
<p>如何查看patch是否为rolling patch:<br />
在补丁目录：/etc/config下，有一个inventory文件，其中有一项：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p622108"><td class="code" id="p622code108"><pre class="sql" style="font-family:monospace;"><span style="color: #000000;">&lt;</span>online_rac_installable<span style="color: #000000;">&gt;</span>true<span style="color: #000000;">&lt;/</span>online_rac_installable<span style="color: #000000;">&gt;</span></pre></td></tr></table></div>

<p>若为true则为rolling patch</p>
<p>还可以使用opatch query命令：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p622109"><td class="code" id="p622code109"><pre class="sql" style="font-family:monospace;"> Patch created <span style="color: #000000;">on</span> <span style="color: 000000;">18</span> Apr <span style="color: 000000;">2008</span><span style="color: #000000;">,</span> 02:<span style="color: 000000;">57</span>:01 hrs PST8PDT
 Need <span style="color: #000000;">to</span> shutdown Oracle instances: true
 Patch <span style="color: #000000;">is</span> roll<span style="color: #000000;">-</span>backable: true
 Patch <span style="color: #000000;">is</span> a <span style="color: 000000;">&quot;Patchset Update&quot;</span>: false
 Patch <span style="color: #000000;">is</span> a rolling patch: true
 Patch has sql related actions: false
 Patch <span style="color: #000000;">is</span> an online patch: false
 Patch <span style="color: #000000;">is</span> a portal patch: false
 Patch <span style="color: #000000;">is</span> an <span style="color: 000000;">&quot;auto-enabled&quot;</span> patch: false</pre></td></tr></table></div>

<p>Patch is a rolling patch 一项true则为rolling patch。</p>
<p>昨天在测试环境上打了几个rolling patch，是加&#8221;local&#8221;选项，一个节点全打完，启动，再打另一个节点。<br />
未加&#8221;local&#8221;选项时，则按提示起停实例即可，以下是网上搜到的一个打rolling patch日志，供大家参考（原链接已不能用，用Google快照打开的，不附出处了）：</p>

<div class="wp_codebox"><table width="100%" ><tr id="p622110"><td class="code" id="p622code110"><pre class="sql" style="font-family:monospace;"><span style="color: 000000;">&#91;</span>oracle@gr7251 <span style="color: 000000;">9004119</span><span style="color: 000000;">&#93;</span>$ <span style="color: #000000;">/</span>u01<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span>11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">/</span>dbhome_1<span style="color: #000000;">/</span>OPatch<span style="color: #000000;">/</span>opatch apply
Invoking OPatch 11<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>6<span style="color: #000000;">.</span>6
&nbsp;
Oracle Interim Patch Installer version 11<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>6<span style="color: #000000;">.</span>6
Copyright <span style="color: 000000;">&#40;</span>c<span style="color: 000000;">&#41;</span> <span style="color: 000000;">2009</span><span style="color: #000000;">,</span> Oracle Corporation<span style="color: #000000;">.</span> <span style="color: #000000;">All</span> rights reserved<span style="color: #000000;">.</span>
&nbsp;
Oracle Home : <span style="color: #000000;">/</span>u01<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span>11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">/</span>dbhome_1
Central Inventory : <span style="color: #000000;">/</span>u01<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oraInventory
<span style="color: #000000;">from</span> : <span style="color: #000000;">/</span>etc<span style="color: #000000;">/</span>oraInst<span style="color: #000000;">.</span>loc
OPatch version : 11<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>6<span style="color: #000000;">.</span>6
OUI version : 11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>0
OUI location : <span style="color: #000000;">/</span>u01<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span>11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">/</span>dbhome_1<span style="color: #000000;">/</span>oui
Log file location : <span style="color: #000000;">/</span>u01<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span>11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">/</span>dbhome_1<span style="color: #000000;">/</span>cfgtoollogs<span style="color: #000000;">/</span>opatch<span style="color: #000000;">/</span>opatch2010<span style="color: #000000;">-</span>02<span style="color: #000000;">-</span>04_10<span style="color: #000000;">-</span><span style="color: 000000;">22</span><span style="color: #000000;">-</span>44AM<span style="color: #000000;">.</span>log
&nbsp;
Patch history file: <span style="color: #000000;">/</span>u01<span style="color: #000000;">/</span>app<span style="color: #000000;">/</span>oracle<span style="color: #000000;">/</span>product<span style="color: #000000;">/</span>11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">/</span>dbhome_1<span style="color: #000000;">/</span>cfgtoollogs<span style="color: #000000;">/</span>opatch<span style="color: #000000;">/</span>opatch_history<span style="color: #000000;">.</span>txt
&nbsp;
ApplySession applying interim patch <span style="color: 000000;">'9004119'</span> <span style="color: #000000;">to</span> OH <span style="color: 000000;">'/u01/app/oracle/product/11.2.0/dbhome_1'</span>
&nbsp;
Running prerequisite checks<span style="color: #000000;">...</span>
&nbsp;
OPatch detected the node list <span style="color: #000000;">and</span> the <span style="color: #000000;">local</span> node <span style="color: #000000;">from</span> the inventory<span style="color: #000000;">.</span> OPatch will patch the <span style="color: #000000;">local</span> system then propagate the patch <span style="color: #000000;">to</span> the remote nodes<span style="color: #000000;">.</span>
&nbsp;
&nbsp;
This node <span style="color: #000000;">is</span> part of an Oracle Real Application Cluster<span style="color: #000000;">.</span>
Remote nodes: <span style="color: 000000;">'gr7265'</span> <span style="color: 000000;">'gr7286'</span>
<span style="color: #000000;">Local</span> node: <span style="color: 000000;">'gr7251'</span>
Please shutdown Oracle instances running out of this ORACLE_HOME <span style="color: #000000;">on</span> the <span style="color: #000000;">local</span> system<span style="color: #000000;">.</span>
<span style="color: 000000;">&#40;</span>Oracle Home <span style="color: #000000;">=</span> <span style="color: 000000;">'/u01/app/oracle/product/11.2.0/dbhome_1'</span><span style="color: 000000;">&#41;</span>
&nbsp;
<span style="color: #000000;">Is</span> the <span style="color: #000000;">local</span> system ready <span style="color: #000000;">for</span> patching? <span style="color: 000000;">&#91;</span>y<span style="color: #000000;">|</span>n<span style="color: 000000;">&#93;</span>
y
User Responded <span style="color: #000000;">with</span>: Y
Backing up files <span style="color: #000000;">and</span> inventory <span style="color: 000000;">&#40;</span><span style="color: #000000;">not</span> <span style="color: #000000;">for</span> auto<span style="color: #000000;">-</span>rollback<span style="color: 000000;">&#41;</span> <span style="color: #000000;">for</span> the Oracle Home
Backing up files affected <span style="color: #000000;">by</span> the patch <span style="color: 000000;">'9004119'</span> <span style="color: #000000;">for</span> restore<span style="color: #000000;">.</span> This might take a while<span style="color: #000000;">...</span>
Backing up files affected <span style="color: #000000;">by</span> the patch <span style="color: 000000;">'9004119'</span> <span style="color: #000000;">for</span> rollback<span style="color: #000000;">.</span> This might take a while<span style="color: #000000;">...</span>
&nbsp;
Patching component oracle<span style="color: #000000;">.</span>rdbms<span style="color: #000000;">,</span> 11<span style="color: #000000;">.</span>2<span style="color: #000000;">.</span>0<span style="color: #000000;">.</span>1<span style="color: #000000;">.</span>0<span style="color: #000000;">...</span>
Copying file <span style="color: #000000;">to</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/bin/racone2rac&quot;</span>
Copying file <span style="color: #000000;">to</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/bin/Omotion&quot;</span>
Copying file <span style="color: #000000;">to</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/bin/raconefix&quot;</span>
Copying file <span style="color: #000000;">to</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/bin/raconeinit&quot;</span>
Copying file <span style="color: #000000;">to</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/bin/raconestatus&quot;</span>
ApplySession adding interim patch <span style="color: 000000;">'9004119'</span> <span style="color: #000000;">to</span> inventory
&nbsp;
Verifying the <span style="color: #000000;">update</span><span style="color: #000000;">...</span>
Inventory <span style="color: #000000;">check</span> OK: Patch ID <span style="color: 000000;">9004119</span> <span style="color: #000000;">is</span> registered <span style="color: #000000;">in</span> Oracle Home inventory <span style="color: #000000;">with</span> proper meta<span style="color: #000000;">-</span><span style="color: #000000;">data</span><span style="color: #000000;">.</span>
Files <span style="color: #000000;">check</span> OK: Files <span style="color: #000000;">from</span> Patch ID <span style="color: 000000;">9004119</span> are present <span style="color: #000000;">in</span> Oracle Home<span style="color: #000000;">.</span>
&nbsp;
The <span style="color: #000000;">local</span> system has been patched<span style="color: #000000;">.</span> You can restart Oracle instances <span style="color: #000000;">on</span> it<span style="color: #000000;">.</span>
&nbsp;
&nbsp;
Patching <span style="color: #000000;">in</span> rolling mode<span style="color: #000000;">.</span>
&nbsp;
Remaining nodes <span style="color: #000000;">to</span> be patched:
<span style="color: 000000;">'gr7265'</span> <span style="color: 000000;">'gr7286'</span>
What <span style="color: #000000;">is</span> the next node <span style="color: #000000;">to</span> be patched?
gr7265
You have selected <span style="color: 000000;">'gr7265'</span> <span style="color: #000000;">from</span> <span style="color: 000000;">'gr7265'</span> <span style="color: 000000;">'gr7286'</span>
&nbsp;
The node <span style="color: 000000;">'gr7265'</span> will be patched next<span style="color: #000000;">.</span>
&nbsp;
Please shutdown Oracle instances running out of this ORACLE_HOME <span style="color: #000000;">on</span> <span style="color: 000000;">'gr7265'</span><span style="color: #000000;">.</span>
<span style="color: 000000;">&#40;</span>Oracle Home <span style="color: #000000;">=</span> <span style="color: 000000;">'/u01/app/oracle/product/11.2.0/dbhome_1'</span><span style="color: 000000;">&#41;</span>
&nbsp;
<span style="color: #000000;">Is</span> the node ready <span style="color: #000000;">for</span> patching? <span style="color: 000000;">&#91;</span>y<span style="color: #000000;">|</span>n<span style="color: 000000;">&#93;</span>
y
User Responded <span style="color: #000000;">with</span>: Y
Updating nodes <span style="color: 000000;">'gr7265'</span>
Apply<span style="color: #000000;">-</span>related files are:
FP <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_files.txt&quot;</span>
DP <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_dirs.txt&quot;</span>
MP <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/make_cmds.txt&quot;</span>
RC <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/remote_cmds.txt&quot;</span>
&nbsp;
Instantiating the file <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_files.txt.instantiated&quot;</span> <span style="color: #000000;">by</span> replacing $ORACLE_HOME <span style="color: #000000;">in</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_files.txt&quot;</span> <span style="color: #000000;">with</span> actual path<span style="color: #000000;">.</span>
Propagating files <span style="color: #000000;">to</span> remote nodes<span style="color: #000000;">...</span>
Instantiating the file <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_dirs.txt.instantiated&quot;</span> <span style="color: #000000;">by</span> replacing $ORACLE_HOME <span style="color: #000000;">in</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_dirs.txt&quot;</span> <span style="color: #000000;">with</span> actual path<span style="color: #000000;">.</span>
Propagating directories <span style="color: #000000;">to</span> remote nodes<span style="color: #000000;">...</span>
&nbsp;
The node <span style="color: 000000;">'gr7265'</span> has been patched<span style="color: #000000;">.</span> You can restart Oracle instances <span style="color: #000000;">on</span> it<span style="color: #000000;">.</span>
&nbsp;
&nbsp;
The node <span style="color: 000000;">'gr7286'</span> will be patched next<span style="color: #000000;">.</span>
&nbsp;
&nbsp;
Please shutdown Oracle instances running out of this ORACLE_HOME <span style="color: #000000;">on</span> <span style="color: 000000;">'gr7286'</span><span style="color: #000000;">.</span>
<span style="color: 000000;">&#40;</span>Oracle Home <span style="color: #000000;">=</span> <span style="color: 000000;">'/u01/app/oracle/product/11.2.0/dbhome_1'</span><span style="color: 000000;">&#41;</span>
&nbsp;
<span style="color: #000000;">Is</span> the node ready <span style="color: #000000;">for</span> patching? <span style="color: 000000;">&#91;</span>y<span style="color: #000000;">|</span>n<span style="color: 000000;">&#93;</span>
y
User Responded <span style="color: #000000;">with</span>: Y
Updating nodes <span style="color: 000000;">'gr7286'</span>
Apply<span style="color: #000000;">-</span>related files are:
FP <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_files.txt&quot;</span>
DP <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/copy_dirs.txt&quot;</span>
MP <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/make_cmds.txt&quot;</span>
RC <span style="color: #000000;">=</span> <span style="color: 000000;">&quot;/u01/app/oracle/product/11.2.0/dbhome_1/.patch_storage/9004119_Oct_22_2009_12_29_39/rac/remote_cmds.txt&quot;</span>
&nbsp;
Propagating files <span style="color: #000000;">to</span> remote nodes<span style="color: #000000;">...</span>
Propagating directories <span style="color: #000000;">to</span> remote nodes<span style="color: #000000;">...</span>
&nbsp;
The node <span style="color: 000000;">'gr7286'</span> has been patched<span style="color: #000000;">.</span> You can restart Oracle instances <span style="color: #000000;">on</span> it<span style="color: #000000;">.</span>
&nbsp;
&nbsp;
OPatch succeeded<span style="color: #000000;">.</span></pre></td></tr></table></div>

<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/03/rolling_patch.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>WORD文档代码高亮</title>
		<link>http://www.dbaroad.me/archives/2010/02/wrod_code_highlight.html</link>
		<comments>http://www.dbaroad.me/archives/2010/02/wrod_code_highlight.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 09:08:19 +0000</pubDate>
		<dc:creator>OoNiceDream</dc:creator>
		
		<category><![CDATA[系统及网站]]></category>

		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://www.dbaroad.me/?p=619</guid>
		<description><![CDATA[最近在写WORD文档，想给SQL代码高亮一下，找到以下方法，以WORD 2007为例：
样式 &#8211;> 新建样式，内容按以下填写：
名称：代码高亮
样式类型：段落
样式基准：无样式
后续段落样式：代码高亮
格式： 边框&#8211;>选择一个边框，切换到 底纹&#8211;>填充，选择一种颜色
OK了，来一张效果图：

跟博客的代码高亮效果差不多。
&#8212; The End &#8212;
]]></description>
			<content:encoded><![CDATA[<p>最近在写WORD文档，想给SQL代码高亮一下，找到以下方法，以WORD 2007为例：<span id="more-619"></span><br />
样式 &#8211;> 新建样式，内容按以下填写：<br />
名称：代码高亮<br />
样式类型：段落<br />
样式基准：无样式<br />
后续段落样式：代码高亮<br />
格式： 边框&#8211;>选择一个边框，切换到 底纹&#8211;>填充，选择一种颜色</p>
<p>OK了，来一张效果图：<br />
<img src="http://www.dbaroad.me/image/archive/dmgl.jpg" alt="" title="" width="568" height="191" /></p>
<p>跟博客的代码高亮效果差不多。</p>
<p>&#8212; The End &#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbaroad.me/archives/2010/02/wrod_code_highlight.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
