<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>碧海蓝天 &#187; Oracle</title>
	<atom:link href="http://wajoynece.cn/category/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://wajoynece.cn</link>
	<description>Oracle DataBase Linux Software</description>
	<lastBuildDate>Tue, 06 Sep 2011 08:26:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HP-UX Ioctl ASYNC_CONFIG error, errno = 1</title>
		<link>http://wajoynece.cn/2010/06/hp-ux-ioctl-async_config-error-errno-1/</link>
		<comments>http://wajoynece.cn/2010/06/hp-ux-ioctl-async_config-error-errno-1/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:54:59 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[aio]]></category>
		<category><![CDATA[hp-ux]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=187</guid>
		<description><![CDATA[数据库udump目录下包含了29592个trace文件, 占用10GB多的空间: #ls &#124; wc -l 29592 #du -sk 14390876        . trace文件内容如下: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options System name:    HP-UX Release:        B.11.31 Version:        U Machine:        ia64 [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">数据库udump目录下包含了29592个trace文件, 占用10GB多的空间:</div>
<blockquote>
<div id="_mcePaste">#ls | wc -l</div>
<div id="_mcePaste">29592</div>
<div id="_mcePaste">#du -sk</div>
<div id="_mcePaste">14390876        .</div>
</blockquote>
<div id="_mcePaste">trace文件内容如下:</div>
<blockquote>
<div id="_mcePaste">Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; 64bit Production</div>
<div id="_mcePaste">With the Partitioning, OLAP, Data Mining and Real Application Testing options</div>
<div id="_mcePaste">System name:    HP-UX</div>
<div id="_mcePaste">Release:        B.11.31</div>
<div id="_mcePaste">Version:        U</div>
<div id="_mcePaste">Machine:        ia64</div>
<div id="_mcePaste">Redo thread mounted by this instance: 1</div>
<div id="_mcePaste">Oracle process number: 0</div>
<div id="_mcePaste">Ioctl ASYNC_CONFIG error, errno = 1</div>
</blockquote>
<div id="_mcePaste">这个问题来源于启用了async io的hp unix系统, dba组没有mlock权限造成的;</div>
<div id="_mcePaste">查看/etc/privgroup文件, 发现第一行有一个注释, 进一步查看当前系统没有使用/dev/async, 同时dba组也没有MLOCK权限;</div>
<blockquote>
<div id="_mcePaste">#cat /etc/privgroup</div>
<div id="_mcePaste"><strong># ORACLE async i/o</strong></div>
<div id="_mcePaste">dba MLOCK RTPRIO RTSCHED</div>
<div id="_mcePaste">#getprivgrp dba</div>
<div id="_mcePaste">dba:</div>
<div id="_mcePaste">#fuser /dev/async</div>
<div id="_mcePaste">/dev/async:</div>
</blockquote>
<div id="_mcePaste">问题其实恰恰出现在/etc/privgroup中的注释行, 在去掉注释后, /dev/async启用, udump下不再产生日志.</div>
<blockquote>
<div id="_mcePaste">#vi /etc/privgroup</div>
<div id="_mcePaste">&#8220;/etc/privgroup&#8221; 2 lines, 44 characters</div>
<div id="_mcePaste">dba MLOCK RTSCHED RTPRIO</div>
<div id="_mcePaste">#setprivgrp -f /etc/privgroup</div>
<div id="_mcePaste">#getprivgrp dba</div>
<div id="_mcePaste">dba: RTPRIO MLOCK RTSCHED</div>
<div id="_mcePaste">#fuser /dev/async</div>
<div id="_mcePaste">/dev/async:     3613o    3622o    3624o    3583o    3585o    3588o</div>
</blockquote>
<div>总结: 有些系统配置文件不要轻易加注释.</div>
<div></div>
<div id="_mcePaste">参考metalink:</div>
<div id="_mcePaste">How to Disable Asynch_io on HP to Avoid Ioctl Async_config Error Errno = 1 [ID 302801.1]</div>
<div id="_mcePaste">http://www.oracleblog.cn/working-case/how-to-open-async-io-on-hpux/</div>
<div id="_mcePaste">http://www.eygle.com/archives/2009/11/hp-ux_async_config.html</div>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2010/06/hp-ux-ioctl-async_config-error-errno-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>北京招聘中级DBA一名</title>
		<link>http://wajoynece.cn/2009/12/hollycrm-dba-hr/</link>
		<comments>http://wajoynece.cn/2009/12/hollycrm-dba-hr/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 12:39:20 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[zhaopin]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=170</guid>
		<description><![CDATA[公司：www.hollycrm.com 地点：北京 要求： 至少2年ORACLE DBA经验； 熟悉ORACLE基本概念，熟练掌握各种管理维护操作； 能独立处理数据库故障，有丰富的数据库调优经验，尤其是SQL语句的优化； 熟悉linux，unix，掌握基本操作； 正规本科学历 有钻研精神，较强的自学能力； OCP持有优先，有java开发经验优先 根据能力，待遇范围7k-9k 有意请发邮件到 wajoynece at gmail.com]]></description>
			<content:encoded><![CDATA[<p>公司：<a style="text-decoration: none; color: #000000;" href="http://www.hollycrm.com" target="_blank">www.hollycrm.com</a></p>
<p>地点：北京</p>
<p>要求：</p>
<ul type="1">
<li>至少2年ORACLE DBA经验；</li>
<li>熟悉ORACLE基本概念，熟练掌握各种管理维护操作；</li>
<li>能独立处理数据库故障，有丰富的数据库调优经验，尤其是SQL语句的优化；</li>
<li>熟悉linux，unix，掌握基本操作；</li>
<li>正规本科学历</li>
<li>有钻研精神，较强的自学能力；</li>
<li>OCP持有优先，有java开发经验优先</li>
</ul>
<p>根据能力，待遇范围7k-9k</p>
<p>有意请发邮件到<br />
wajoynece at gmail.com</p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/12/hollycrm-dba-hr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>删除表空间不释放空间</title>
		<link>http://wajoynece.cn/2009/09/droptablespaceproblem/</link>
		<comments>http://wajoynece.cn/2009/09/droptablespaceproblem/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 03:02:10 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=164</guid>
		<description><![CDATA[今天删除一个表空间 drop tablespace including contents and datafiles 执行完毕，df -h查看空间没有被释放，ls -l已经看不到被删除文件； 解决： root@lab-rd-01:/# lsof &#124; grep km_stress oracle 19436 oracle 19u REG 8,7 10737426432 244535 /var/opt/oradata/rd/km_stress_test.dbf (deleted) kill -9 19436后，空间立即得到释放。]]></description>
			<content:encoded><![CDATA[<p>今天删除一个表空间</p>
<p><span style="background-color: #ffffff;">drop tablespace including contents and datafiles</span></p>
<p><span style="background-color: #ffffff;">执行完毕，df -h查看空间没有被释放，ls -l已经看不到被删除文件；</span></p>
<p><span style="background-color: #ffffff;">解决：</span></p>
<blockquote><p><span style="background-color: #ffffff;">root@lab-rd-01:/# lsof | grep km_stress</span><br />
<span style="background-color: #ffffff;">oracle    19436     oracle   19u      REG        8,7 10737426432     244535 /var/opt/oradata/rd/km_stress_test.dbf (deleted)</span></p></blockquote>
<p><span style="background-color: #ffffff;">kill -9 19436后，空间立即得到释放。</span></p>
<p><span style="background-color: #ffffff;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/09/droptablespaceproblem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>sort~merge~join(SMJ)相关隐藏参数</title>
		<link>http://wajoynece.cn/2009/09/sortmergejoinsmj/</link>
		<comments>http://wajoynece.cn/2009/09/sortmergejoinsmj/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 09:24:47 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=161</guid>
		<description><![CDATA[_optimizer_sortmerge_join_enabled 10g以后，可以使用/*+ opt_param(&#8216;_optimizer_sortmerge_join_enabled&#8217;,'false&#8217;) */提示， 在语句级别让CBO放弃smj连接选项。]]></description>
			<content:encoded><![CDATA[<p>_optimizer_sortmerge_join_enabled</p>
<p>10g以后，可以使用<span style="background-color: #ffffff;">/*+ opt_param(&#8216;_optimizer_sortmerge_join_enabled&#8217;,'false&#8217;) */提示，</span></p>
<p><span style="background-color: #ffffff;">在语句级别让CBO放弃smj连接选项。</span></p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/09/sortmergejoinsmj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>crontab调度问题解决</title>
		<link>http://wajoynece.cn/2009/09/crontabnotworking/</link>
		<comments>http://wajoynece.cn/2009/09/crontabnotworking/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 08:18:39 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=159</guid>
		<description><![CDATA[ubuntu 8.04 64位server上，oracle用户下有一个备份的crontab任务， 任务调度异常，到时间不执行； 查看syslog发现了问题： Sep 3 15:48:01 app6G /usr/sbin/cron[30235]: (oracle) RELOAD (crontabs/oracle) Sep 3 15:48:01 app6G CRON[32285]: User account has expired 因为我在创建用户时指定了passwd -l选项锁定该用户，导致了问题； 取消了锁定，调度正常了。]]></description>
			<content:encoded><![CDATA[<p>ubuntu 8.04 64位server上，oracle用户下<span style="background-color: #ffffff;">有一个备份的crontab任务，</span></p>
<p><span style="background-color: #ffffff;">任务调度异常，到时间不执行；</span></p>
<p><span style="background-color: #ffffff;">查看syslog发现了问题：</span></p>
<blockquote><p><span style="background-color: #ffffff;">Sep  3 15:48:01 app6G /usr/sbin/cron[30235]: (oracle) RELOAD (crontabs/oracle)</span><br />
<span style="background-color: #ffffff;">Sep  3 15:48:01 app6G CRON[32285]: User account has expired</span></p></blockquote>
<p>因为我在创建用户时指定了passwd -l选项锁定该用户，导致了问题；</p>
<p>取消了锁定，调度正常了。</p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/09/crontabnotworking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>故障ORA－12516诊断</title>
		<link>http://wajoynece.cn/2009/08/12516/</link>
		<comments>http://wajoynece.cn/2009/08/12516/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 04:18:46 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=154</guid>
		<description><![CDATA[现场报告连接数据库报错：ORA-12519 TNS: no appropriate service handler found 这个错误没遇到过，登录现场环境确认报错情况属实，sqlplus / as sysdba不能登录数据库； 检查操作系统oracle进程数目，与processes=600的设定比较接近； 检查应用服务器连接池连接情况，2台weblogic连接池current都是200，加起来400，有2台tomcat，current情况未知，配置最大75； 检查listener，发现state是blocked &#8216;&#8221;DEDICATED&#8221; established:1 refused:0 state:blocked&#8217; 这里比较异常，正常情况下应该是ready，不解； 求助metalink， 240710.1 找到了原因： By way of instance registration, PMON is responsible for updating the listener with information about a particular instance such as load and dispatcher information. Maximum load for dedicated connections is determined by the [...]]]></description>
			<content:encoded><![CDATA[<p>现场报告连接数据库报错：ORA-12519 TNS: no appropriate service handler found</p>
<p>这个错误没遇到过，登录现场环境确认报错情况属实，sqlplus / as sysdba不能登录数据库；</p>
<p>检查操作系统oracle进程数目，与processes=600的设定比较接近；</p>
<p>检查应用服务器连接池连接情况，2台weblogic连接池current都是200，加起来400，有2台tomcat，current情况未知，配置最大75；</p>
<p>检查listener，发现state是blocked</p>
<blockquote><p>&#8216;&#8221;DEDICATED&#8221; established:1 refused:0 state:blocked&#8217;</p>
</blockquote>
<p>这里比较异常，正常情况下应该是ready，不解；</p>
<p>求助metalink<span style="font-family: helvetica;">，</span><span style="font-family: helvetica;"> <strong>240710.1 </strong></span><span style="font-family: helvetica;">找到了原因：</span></p>
<blockquote><p>By way of instance registration, PMON is responsible for updating the listener<br />
with information about a particular instance  such as load and dispatcher<br />
information. Maximum load for dedicated connections is determined by the<br />
PROCESSES parameter.  The frequency at which PMON provides SERVICE_UPDATE<br />
information varies according to the workload of the instance. The maximum<br />
interval between these service updates is 10 minutes.</p>
<p>The listener counts the number of connections it has established  to the instance<br />
but does not immediately get information about connections that have terminated.<br />
Only when PMON updates  the listener via SERVICE_UPDATE is the listener<br />
informed of current load. Since this can take as long as 10 minutes, there can  be<br />
a difference between the current instance load according to the listener<br />
and the actual instance load.</p>
<p>When the  listener believes the current number of connections has reached maximum<br />
load, it may set the state of the service handler for  an instance to &#8220;blocked&#8221;<br />
and begin refusing incoming client connections with either of the following<br />
errors:</p>
<p>TNS-12516 TNS:listener could not find instance with matching protocol stack</p>
</blockquote>
<p>pmon动态instance信息到listener，这其中就包括process数目的信息，当到达限制时，pmon会通知listener别再申请连接了，listener把相应的服务状态修改为：blocked，客户端再次连接就会报12516错误。</p>
<p>开始解决：两台tomcat服务器运行了归档查询业务，是最近新添加的服务，问题也就出在这里；</p>
<p>关闭tomcat服务器；过一会查看监听状态，发现已经变为ready，sqlplus / as sysdba尝试连接数据库，已经可以连接；</p>
<p>进一步查看session信息，发现tomcat服务器仍然有144个连接，说明tomcat连接有严重泄露情况；</p>
<p>最终，把processes增大，tomcat＝&gt;weblogic，期望可以解决这一问题。</p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/08/12516/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL优化之无奈</title>
		<link>http://wajoynece.cn/2009/08/sql%e4%bc%98%e5%8c%96%e4%b9%8b%e6%97%a0%e5%a5%88/</link>
		<comments>http://wajoynece.cn/2009/08/sql%e4%bc%98%e5%8c%96%e4%b9%8b%e6%97%a0%e5%a5%88/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 05:21:55 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=152</guid>
		<description><![CDATA[系统中有很多表，中间有一些blankn类似名字的字段； 这种字段用于不断变化的灵活需求； 更糟糕的是，有一些查询条件基于这些灵活的字段，并且条件都是定制的…… 我们还能作些什么呢？]]></description>
			<content:encoded><![CDATA[<p>系统中有很多表，中间有一些blankn类似名字的字段；</p>
<p>这种字段用于不断变化的灵活需求；</p>
<p>更糟糕的是，有一些查询条件基于这些灵活的字段，并且条件都是定制的……</p>
<p>我们还能作些什么呢？</p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/08/sql%e4%bc%98%e5%8c%96%e4%b9%8b%e6%97%a0%e5%a5%88/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASM之迁移到ASM</title>
		<link>http://wajoynece.cn/2009/08/asm-migrate/</link>
		<comments>http://wajoynece.cn/2009/08/asm-migrate/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 08:58:54 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[asm]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=147</guid>
		<description><![CDATA[oracle@wayne-laptop:~$ rman target / Recovery Manager: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:20:41 2009 Copyright (c) 1982, 2007, Oracle.  All rights reserved. connected to target database: ORA10G (DBID=4013050375) RMAN&#62; BACKUP AS COPY INCREMENTAL LEVEL 0  DATABASE FORMAT &#8216;+dg1&#8242;TAG &#8216;ORA_ASM_MIGRATION&#8217;; Starting backup at 11-AUG-09 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile [...]]]></description>
			<content:encoded><![CDATA[<p>oracle@wayne-laptop:~$ <strong>rman target /</strong></p>
<p>Recovery Manager: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:20:41 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>connected to target database: ORA10G (DBID=4013050375)</p>
<p>RMAN&gt; <strong>BACKUP AS COPY INCREMENTAL LEVEL 0  DATABASE FORMAT &#8216;+dg1&#8242;TAG &#8216;ORA_ASM_MIGRATION&#8217;;</strong></p>
<p>Starting backup at 11-AUG-09<br />
using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00001 name=/home/oracle/app/oradata/ora10g/system01.dbf<br />
output filename=+DG1/ora10g/datafile/system.264.694628679 tag=ORA_ASM_MIGRATION recid=7 stamp=694628715<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00002 name=/home/oracle/app/oradata/ora10g/undotbs01.dbf<br />
output filename=+DG1/ora10g/datafile/undotbs1.265.694628721 tag=ORA_ASM_MIGRATION recid=8 stamp=694628745<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00003 name=/home/oracle/app/oradata/ora10g/sysaux01.dbf<br />
output filename=+DG1/ora10g/datafile/sysaux.266.694628757 tag=ORA_ASM_MIGRATION recid=9 stamp=694628773<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00005 name=/home/oracle/app/oradata/ORA10G/datafile/o1_mf_wayne_57q7y8hp_.dbf<br />
output filename=+DG1/ora10g/datafile/wayne.268.694628781 tag=ORA_ASM_MIGRATION recid=10 stamp=694628787<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00004 name=/home/oracle/app/oradata/ora10g/users01.dbf<br />
output filename=+DG1/ora10g/datafile/users.261.694628797 tag=ORA_ASM_MIGRATION recid=11 stamp=694628796<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01<br />
channel ORA_DISK_1: starting datafile copy<br />
copying current control file<br />
output filename=+DG1/ora10g/controlfile/backup.262.694628797 tag=ORA_ASM_MIGRATION recid=12 stamp=694628799<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03<br />
channel ORA_DISK_1: starting incremental level 0 datafile backupset<br />
channel ORA_DISK_1: specifying datafile(s) in backupset<br />
including current SPFILE in backupset<br />
channel ORA_DISK_1: starting piece 1 at 11-AUG-09<br />
channel ORA_DISK_1: finished piece 1 at 11-AUG-09<br />
piece handle=+DG1/ora10g/backupset/2009_08_11/nnsnn0_ora_asm_migration_0.263.694628803 tag=ORA_ASM_MIGRATION comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02<br />
Finished backup at 11-AUG-09</p>
<p>RMAN&gt; <strong>run {<br />
2&gt; backup as backupset spfile;<br />
3&gt; restore spfile to &#8216;+dg1/spfile&#8217;;<br />
4&gt; }</strong></p>
<p>Starting backup at 11-AUG-09<br />
using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting full datafile backupset<br />
channel ORA_DISK_1: specifying datafile(s) in backupset<br />
including current SPFILE in backupset<br />
channel ORA_DISK_1: starting piece 1 at 11-AUG-09<br />
channel ORA_DISK_1: finished piece 1 at 11-AUG-09<br />
piece handle=/home/oracle/app/flash_recovery_area/ORA10G/backupset/2009_08_11/o1_mf_nnsnf_TAG20090811T162849_582by1ts_.bkp tag=TAG20090811T162849 comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01<br />
Finished backup at 11-AUG-09</p>
<p>Starting restore at 11-AUG-09<br />
using channel ORA_DISK_1</p>
<p>channel ORA_DISK_1: starting datafile backupset restore<br />
channel ORA_DISK_1: restoring SPFILE<br />
output filename=+dg1/spfile<br />
channel ORA_DISK_1: reading from backup piece /home/oracle/app/flash_recovery_area/ORA10G/backupset/2009_08_11/o1_mf_nnsnf_TAG20090811T162849_582by1ts_.bkp<br />
channel ORA_DISK_1: restored backup piece 1<br />
piece handle=/home/oracle/app/flash_recovery_area/ORA10G/backupset/2009_08_11/o1_mf_nnsnf_TAG20090811T162849_582by1ts_.bkp tag=TAG20090811T162849<br />
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02<br />
Finished restore at 11-AUG-09</p>
<p>RMAN&gt; exit</p>
<p>Recovery Manager complete.<br />
oracle@wayne-laptop:~$ sqlplus / as sysdba</p>
<p>SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:29:42 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Connected to:<br />
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
<p>SQL&gt; <strong>startup force nomount PFILE=&#8221;/tmp/pfile.ora&#8221;;</strong><br />
ORACLE instance started.</p>
<p>Total System Global Area  205520896 bytes<br />
Fixed Size            1266584 bytes<br />
Variable Size          100666472 bytes<br />
Database Buffers       96468992 bytes<br />
Redo Buffers            7118848 bytes<br />
SQL&gt; <strong>alter system set control_files=&#8217;+dg1/ct1.f&#8217;,'+fra/ct2.f&#8217; scope=spfile;</strong></p>
<p>System altered.</p>
<p>SQL&gt; <strong>alter system set DB_RECOVERY_FILE_DEST_SIZE=2g scope=spfile;</strong></p>
<p>System altered.</p>
<p>SQL&gt; <strong>alter system set DB_RECOVERY_FILE_DEST=&#8217;+fra&#8217; scope=spfile;</strong></p>
<p>System altered.</p>
<p>SQL&gt; <strong>shutdown immediate</strong><br />
ORA-01507: database not mounted</p>
<p>ORACLE instance shut down.<br />
SQL&gt;<strong> startup nomount PFILE=&#8221;/tmp/pfile.ora&#8221;;</strong><br />
ORACLE instance started.</p>
<p>Total System Global Area  205520896 bytes<br />
Fixed Size            1266584 bytes<br />
Variable Size          100666472 bytes<br />
Database Buffers       96468992 bytes<br />
Redo Buffers            7118848 bytes<br />
SQL&gt; exit<br />
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options<br />
oracle@wayne-laptop:~$ rman target /</p>
<p>Recovery Manager: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:33:18 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>connected to target database: ora10g (not mounted)</p>
<p>RMAN&gt; <strong>restore controlfile from &#8216;/home/oracle/app/oradata/ora10g/control03.ctl&#8217;;</strong></p>
<p>Starting restore at 11-AUG-09<br />
using target database control file instead of recovery catalog<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=156 devtype=DISK</p>
<p>channel ORA_DISK_1: copied control file copy<br />
output filename=+DG1/ct1.f<br />
output filename=+FRA/ct2.f<br />
Finished restore at 11-AUG-09</p>
<p>RMAN&gt; <strong>alter database mount;</strong></p>
<p>database mounted<br />
released channel: ORA_DISK_1</p>
<p>RMAN&gt; <strong>switch database to copy;</strong></p>
<p>datafile 1 switched to datafile copy &#8220;+DG1/ora10g/datafile/system.264.694628679&#8243;<br />
datafile 2 switched to datafile copy &#8220;+DG1/ora10g/datafile/undotbs1.265.694628721&#8243;<br />
datafile 3 switched to datafile copy &#8220;+DG1/ora10g/datafile/sysaux.266.694628757&#8243;<br />
datafile 4 switched to datafile copy &#8220;+DG1/ora10g/datafile/users.261.694628797&#8243;<br />
datafile 5 switched to datafile copy &#8220;+DG1/ora10g/datafile/wayne.268.694628781&#8243;</p>
<p>RMAN&gt; <strong>recover database;</strong></p>
<p>Starting recover at 11-AUG-09<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=156 devtype=DISK</p>
<p>starting media recovery<br />
media recovery complete, elapsed time: 00:00:03</p>
<p>Finished recover at 11-AUG-09</p>
<p>RMAN&gt; <strong>run {<br />
set newname for tempfile 1 to &#8216;+dg1&#8242;;<br />
switch tempfile all;<br />
}</strong><br />
2&gt; 3&gt; 4&gt;<br />
executing command: SET NEWNAME</p>
<p>renamed temporary file 1 to +dg1 in control file</p>
<p>RMAN&gt; <strong>ALTER DATABASE OPEN;<br />
</strong><br />
database opened</p>
<p>RMAN&gt; exit</p>
<p>Recovery Manager complete.</p>
<p>oracle@wayne-laptop:~$ sqlplus / as sysdba</p>
<p>SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:39:03 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Connected to:<br />
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
<p>SQL&gt;<br />
SQL&gt;<br />
<strong>declare<br />
cursor rlc is<br />
select group# grp, thread# thr, bytes/1024 bytes_k, &#8216;NO&#8217; srl<br />
from v$log<br />
union<br />
select group# grp, thread# thr, bytes/1024 bytes_k, &#8216;YES&#8217; srl<br />
from v$standby_log<br />
order by 1;<br />
stmt     varchar2(2048);<br />
swtstmt  varchar2(1024) := &#8216;alter system switch logfile&#8217;;<br />
ckpstmt  varchar2(1024) := &#8216;alter system checkpoint global&#8217;;<br />
begin<br />
for rlcRec in rlc loop<br />
if (rlcRec.srl = &#8216;YES&#8217;) then<br />
stmt := &#8216;alter database add standby logfile thread &#8216; ||<br />
rlcRec.thr || &#8216; &#8221;+DG1&#8221; size &#8216; ||<br />
rlcRec.bytes_k || &#8216;K&#8217;;<br />
execute immediate stmt;<br />
stmt := &#8216;alter database drop standby logfile group &#8216; || rlcRec.grp;<br />
execute immediate stmt;<br />
else<br />
stmt := &#8216;alter database add logfile thread &#8216; ||<br />
rlcRec.thr || &#8216; &#8221;+DG1&#8221; size &#8216; ||<br />
rlcRec.bytes_k || &#8216;K&#8217;;<br />
execute immediate stmt;<br />
begin<br />
stmt := &#8216;alter database drop logfile group &#8216; || rlcRec.grp;<br />
dbms_output.put_line(stmt);<br />
execute immediate stmt;<br />
exception<br />
when others then<br />
execute immediate swtstmt;<br />
execute immediate ckpstmt;<br />
execute immediate stmt;<br />
end;<br />
end if;<br />
end loop;<br />
38  end;<br />
39  /</strong></p>
<p>PL/SQL procedure successfully completed.</p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/08/asm-migrate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASM之建立实验环境</title>
		<link>http://wajoynece.cn/2009/08/asm-init/</link>
		<comments>http://wajoynece.cn/2009/08/asm-init/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 08:49:39 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[asm]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=142</guid>
		<description><![CDATA[准备模拟磁盘文件 root@wayne-laptop:/home/oracle/test# for i in 0 1 2 3 ;do dd if=/dev/zero of=file_disk$i bs=1024 count=524288 ; done 524288+0 records in 524288+0 records out 536870912 bytes (537 MB) copied, 14.0764 s, 38.1 MB/s 524288+0 records in 524288+0 records out 536870912 bytes (537 MB) copied, 15.2912 s, 35.1 MB/s 524288+0 records in 524288+0 records out 536870912 bytes [...]]]></description>
			<content:encoded><![CDATA[<p>准备模拟磁盘文件</p>
<blockquote><p>root@wayne-laptop:/home/oracle/test# for i in 0 1 2 3 ;do dd if=/dev/zero of=file_disk$i bs=1024 count=524288 ; done<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 14.0764 s, 38.1 MB/s<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 15.2912 s, 35.1 MB/s<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 18.8882 s, 28.4 MB/s<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 18.276 s, 29.4 MB/s<br />
root@wayne-laptop:/home/oracle/test# ls -l<br />
total 2099216<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:48 file_disk0<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:48 file_disk1<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:49 file_disk2<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:49 file_disk3</p></blockquote>
<p>创建loop设备</p>
<blockquote><p>root@wayne-laptop:/home/oracle/test# for i in 0 1 2 3 ; do losetup /dev/loop$i file_disk$i; done<br />
root@wayne-laptop:/home/oracle/test# losetup -a<br />
/dev/loop0: [0805]:1917697 (file_disk0)<br />
/dev/loop1: [0805]:1917709 (file_disk1)<br />
/dev/loop2: [0805]:1917711 (file_disk2)<br />
/dev/loop3: [0805]:1917712 (file_disk3)<br />
root@wayne-laptop:/dev# chown oracle:dba /dev/loop*</p></blockquote>
<p>配置css</p>
<blockquote><p>+++++++++++++++出现的问题以及解决++++++++++++++++++++++++++<br />
root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# localconfig add<br />
/home/oracle/app/10.2.0/db_1/bin/crsctl.bin: /usr/lib/libstdc++.so.5: version `CXXABI_1.2&#8242; not found (required by /home/oracle/app/10.2.0/db_1/bin/crsctl.bin)<br />
/home/oracle/app/10.2.0/db_1/bin/crsctl.bin: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2&#8242; not found (required by /home/oracle/app/10.2.0/db_1/bin/crsctl.bin)</p></blockquote>
<blockquote><p>root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# cd /usr/lib<br />
root@wayne-laptop:/usr/lib# ls -l | grep libstdc__<br />
root@wayne-laptop:/usr/lib# ls -l | grep libstdc++<br />
lrwxrwxrwx  1 root root       23 2009-05-12 11:16 libstdc++.so.5 -&gt; /usr/lib/libstdc++.so.6<br />
lrwxrwxrwx  1 root root       18 2009-05-11 18:32 libstdc++.so.6 -&gt; libstdc++.so.6.0.9<br />
-rw-r&#8211;r&#8211;  1 root root   970680 2009-02-19 18:42 libstdc++.so.6.0.9</p></blockquote>
<blockquote><p>root@wayne-laptop:/usr/lib# aptitude install libstdc++5<br />
root@wayne-laptop:/usr/lib# ln -sf libstdc++.so.5.0.7 libstdc++.so.5<br />
+++++++++++++++++++++++++++++++++++++++++</p></blockquote>
<blockquote><p>root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# mkdir -p /var/lock/subsys<br />
root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# localconfig reset<br />
Successfully accumulated necessary OCR keys.<br />
Creating OCR keys for user &#8216;root&#8217;, privgrp &#8216;root&#8217;..<br />
Operation successful.<br />
Configuration for local CSS has been initialized</p></blockquote>
<blockquote><p>Adding to inittab<br />
Startup will be queued to init within 30 seconds.<br />
Checking the status of new Oracle init process&#8230;<br />
Expecting the CRS daemons to be up within 600 seconds.</p></blockquote>
<blockquote><p>^c</p></blockquote>
<blockquote><p>root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# nohup /etc/init.d/init.cssd run &gt;/dev/null 2&gt;&amp;1<br />
[1] 17991</p></blockquote>
<p>创建asm实例</p>
<blockquote><p>$ dbca -silent -configureASM             \<br />
-asmSysPassword change_on_install \<br />
-diskString &#8220;/dev/loop*&#8221;          \<br />
-diskList /dev/loop1              \<br />
-diskGroupName DG1                \<br />
-redundancy EXTERNAL</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/08/asm-init/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SQL优化之checkpoint not complete</title>
		<link>http://wajoynece.cn/2009/07/checkpointnotcomplete/</link>
		<comments>http://wajoynece.cn/2009/07/checkpointnotcomplete/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 05:42:32 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=131</guid>
		<description><![CDATA[话说从前有一个从excel导入到数据库中的功能，近来该功能“超级”缓慢，严重影响生产活动。 从告警日志中，可以找到一些线索：日志切换非常频繁，出现多处checkpoint not complete。 同时，在系统中查询产生redo最多的会话，正是上面提到的那个功能，导入不到1w条数据，竟然累计产生近10G的redo！！！ 到这里，已经有理由怀疑是这个功能出现的问题，导致过多的redo，进一步产生checkpoint not complete等待； OK，10046，终于找到了问题的根源：不合理使用的物化视图 在导入功能相关的数据库表上，建有一个物化视图，我们知道物化视图刷新可以on commit,on demand，而这里使用了on commit，而且每次都是全刷新；更糟糕的是，导入功能是每条记录提交一次！ 也就是说：每导入一条数据，物化视图需要清空，重新刷新数据。 解决思路： 物化视图刷新模式修改为on demand 物化视图全刷新变为快速刷新 导入数据使用分批提交方式]]></description>
			<content:encoded><![CDATA[<p>话说从前有一个从excel导入到数据库中的功能，近来该功能“超级”缓慢，严重影响生产活动。</p>
<p>从告警日志中，可以找到一些线索：日志切换非常频繁，出现多处checkpoint not complete。</p>
<p>同时，在系统中查询产生redo最多的会话，正是上面提到的那个功能，导入不到1w条数据，竟然累计产生近10G的redo！！！</p>
<p>到这里，已经有理由怀疑是这个功能出现的问题，导致过多的redo，进一步产生checkpoint not complete等待；</p>
<p>OK，<strong>10046</strong>，终于找到了问题的根源：<strong>不合理使用的物化视图</strong></p>
<p>在导入功能相关的数据库表上，建有一个物化视图，我们知道物化视图刷新可以on commit,on demand，而这里使用了on commit，而且每次都是全刷新；更糟糕的是，导入功能是每条记录提交一次！</p>
<p>也就是说：每导入一条数据，物化视图需要清空，重新刷新数据。</p>
<p>解决思路：</p>
<ul>
<li>物化视图刷新模式修改为on demand</li>
<li>物化视图全刷新变为快速刷新</li>
<li>导入数据使用分批提交方式</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/07/checkpointnotcomplete/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

