<?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>DBAlife &#187; Database</title>
	<atom:link href="http://www.dbalife.com/archives/category/database/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>星光照耀前方</description>
	<lastBuildDate>Wed, 14 Jul 2010 08:13:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>禁用/启用所有外键约束</title>
		<link>http://www.dbalife.com/archives/383.html</link>
		<comments>http://www.dbalife.com/archives/383.html#comments</comments>
		<pubDate>Sat, 06 Feb 2010 16:01:14 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[fk]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[启用]]></category>
		<category><![CDATA[外键]]></category>
		<category><![CDATA[禁用]]></category>
		<category><![CDATA[约束]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=383</guid>
		<description><![CDATA[1、ORACLE数据库中的外键约束名都在表user_constraints中可以查到。其中constraint_type='R'表示是外键约束。
2、启用外键约束的命令为：alter table table_name enable constraint constraint_name
3、禁用外键约束的命令为：alter table table_name disable constraint constraint_name
4、然后再用SQL查出数据库中所以外键的约束名：
select 'alter table '&#124;&#124;table_name&#124;&#124;' enable constraint '&#124;&#124;constraint_name&#124;&#124;';' from user_constraints where constraint_type='R'
select 'alter table '&#124;&#124;table_name&#124;&#124;' disable constraint '&#124;&#124;constraint_name&#124;&#124;';' from user_constraints where constraint_type='R'


Related posts:oralce10g shrink
drop table遭遇ORA-604 / ORA-1422
Oracle9i优化器介绍（下）



Related posts:<ol><li><a href='http://www.dbalife.com/archives/286.html' rel='bookmark' title='Permanent Link: oralce10g shrink'>oralce10g shrink</a></li>
<li><a href='http://www.dbalife.com/archives/128.html' rel='bookmark' title='Permanent Link: drop table遭遇ORA-604 / ORA-1422'>drop table遭遇ORA-604 / ORA-1422</a></li>
<li><a href='http://www.dbalife.com/archives/32.html' rel='bookmark' title='Permanent Link: Oracle9i优化器介绍（下）'>Oracle9i优化器介绍（下）</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>1、ORACLE数据库中的外键约束名都在表user_constraints中可以查到。其中constraint_type='R'表示是外键约束。</p>
<p>2、启用外键约束的命令为：alter table table_name enable constraint constraint_name</p>
<p>3、禁用外键约束的命令为：alter table table_name disable constraint constraint_name</p>
<p>4、然后再用SQL查出数据库中所以外键的约束名：</p>
<p>select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'</p>
<p>select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/286.html' rel='bookmark' title='Permanent Link: oralce10g shrink'>oralce10g shrink</a></li>
<li><a href='http://www.dbalife.com/archives/128.html' rel='bookmark' title='Permanent Link: drop table遭遇ORA-604 / ORA-1422'>drop table遭遇ORA-604 / ORA-1422</a></li>
<li><a href='http://www.dbalife.com/archives/32.html' rel='bookmark' title='Permanent Link: Oracle9i优化器介绍（下）'>Oracle9i优化器介绍（下）</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/383.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用SQL处理多行汇聚问题</title>
		<link>http://www.dbalife.com/archives/379.html</link>
		<comments>http://www.dbalife.com/archives/379.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 04:50:12 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Program]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[多行]]></category>
		<category><![CDATA[汇聚]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=379</guid>
		<description><![CDATA[表结构如下：
NAME                            Null          Type
------------------------  ---------  -----
N_SEC_CODE                NOT NULL  CHAR(6)
C_RESEARCHER_CODE  NOT NULL  VARCHAR2(20)
此表保存了“股票”与“研究员”的对应关系数据，一般而言，对于同一只股票而言，可能有多个研究员对其进行跟踪研究。所以目前遇到一个要求，需查询出每只股票和对应的研究员（研究员代码间，使用逗号分隔）。
例如有如下数据：
000297                                    chenpeng      [...]


Related posts:<ol><li><a href='http://www.dbalife.com/archives/41.html' rel='bookmark' title='Permanent Link: sqlplus下如何看执行计划'>sqlplus下如何看执行计划</a></li>
<li><a href='http://www.dbalife.com/archives/39.html' rel='bookmark' title='Permanent Link: Statistics Lock导致的IMP问题'>Statistics Lock导致的IMP问题</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>表结构如下：<br />
NAME                            Null          Type<br />
------------------------  ---------  -----<br />
N_SEC_CODE                NOT NULL  CHAR(6)<br />
C_RESEARCHER_CODE  NOT NULL  VARCHAR2(20)</p>
<p>此表保存了“股票”与“研究员”的对应关系数据，一般而言，对于同一只股票而言，可能有多个研究员对其进行跟踪研究。所以目前遇到一个要求，需查询出每只股票和对应的研究员（研究员代码间，使用逗号分隔）。</p>
<p>例如有如下数据：<br />
000297                                    chenpeng           <br />
000297                                    liusu             <br />
合并处理后需显示为：<br />
000297                                    chenpeng,liusu</p>
<p>多行数据汇总聚一行，只需要把SQL中“n_sec_code”换为你的用来汇总的列，“c_researcher_code”替换为需合并文本的列，“m_researcher_stock_rel”替换为你的表名</p>
<p> SELECT n_sec_code,<br />
  TRANSLATE (LTRIM (text, '/'), '*/', '*,') researcherList<br />
   FROM<br />
  (SELECT ROW_NUMBER () OVER (PARTITION BY n_sec_code ORDER BY n_sec_code, lvl DESC) rn,<br />
    n_sec_code                                                                         ,<br />
    text<br />
     FROM<br />
    (SELECT n_sec_code,<br />
      LEVEL lvl       ,<br />
      SYS_CONNECT_BY_PATH (c_researcher_code,'/') text<br />
       FROM<br />
      (SELECT n_sec_code                      ,<br />
        c_researcher_code AS c_researcher_code,<br />
        ROW_NUMBER () OVER (PARTITION BY n_sec_code ORDER BY n_sec_code,c_researcher_code) x<br />
         FROM m_researcher_stock_rel<br />
     ORDER BY n_sec_code,<br />
        c_researcher_code<br />
      ) a CONNECT BY n_sec_code = PRIOR n_sec_code<br />
    AND x - 1                   = PRIOR x<br />
    )<br />
  )<br />
  WHERE rn = 1<br />
ORDER BY n_sec_code;</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/41.html' rel='bookmark' title='Permanent Link: sqlplus下如何看执行计划'>sqlplus下如何看执行计划</a></li>
<li><a href='http://www.dbalife.com/archives/39.html' rel='bookmark' title='Permanent Link: Statistics Lock导致的IMP问题'>Statistics Lock导致的IMP问题</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/379.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql中的STRICT_TRANS_TABLES</title>
		<link>http://www.dbalife.com/archives/339.html</link>
		<comments>http://www.dbalife.com/archives/339.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 19:39:52 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Program]]></category>
		<category><![CDATA[my.ini]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[STRICT_TRANS_TABLES]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=339</guid>
		<description><![CDATA[在调试php symfony，加载fixture数据时，遇到了错误：
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'log' for column 'tasklog_id' at row 1
这是因为mysql5.5中默认启用了STRICT_TRANS_TABLES参数。
STRICT_TRANS_TABLES的工作方式：
　　· 对于事务性存储引擎，在语句中任何地方出现的不良数据值均会导致放弃语句并执行回滚。
        · 对于非事务性存储引擎，如果错误出现在要插入或更新的第1行，将放弃语句。（在这种情况下，可以认为语句未改变表，就像事务表一样）。首行后出现的错误不会导致放弃语句。取而代之的是，将调整不良数据值，并给出告警，而不是错误。换句话讲，使用STRICT_TRANS_TABLES后，错误值会导致MySQL执行回滚操作，如果可以，所有更新到此为止。
　　要想执行更严格的检查，请启用STRICT_ALL_TABLES。除了非事务性存储引擎，它与STRICT_TRANS_TABLES等同，即使当不良数据出现在首行后的其他行，所产生的错误也会导致放弃语句。这意味着，如果错误出现在非事务性表多行插入或更新过程的中途，仅更新部分结果。前面的行将完成插入或更新，但错误出现点后面的行则不然。
因此，解决方法就是在my.ini里把STRICT_TRANS_TABLES关掉

?View Code C#Set the SQL mode to strict
#sql-mode=&#34;STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&#34;
sql-mode=&#34;NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&#34;



No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>在调试php symfony，加载fixture数据时，遇到了错误：</p>
<blockquote><p>SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'log' for column 'tasklog_id' at row 1</p></blockquote>
<p>这是因为mysql5.5中默认启用了<em>STRICT_TRANS_TABLES</em>参数。</p>
<p>STRICT_TRANS_TABLES的工作方式：<br />
　　· 对于事务性存储引擎，在语句中任何地方出现的不良数据值均会导致放弃语句并执行回滚。<br />
        · 对于非事务性存储引擎，如果错误出现在要插入或更新的第1行，将放弃语句。（在这种情况下，可以认为语句未改变表，就像事务表一样）。首行后出现的错误不会导致放弃语句。取而代之的是，将调整不良数据值，并给出告警，而不是错误。换句话讲，使用STRICT_TRANS_TABLES后，错误值会导致MySQL执行回滚操作，如果可以，所有更新到此为止。</p>
<p>　　要想执行更严格的检查，请启用STRICT_ALL_TABLES。除了非事务性存储引擎，它与STRICT_TRANS_TABLES等同，即使当不良数据出现在首行后的其他行，所产生的错误也会导致放弃语句。这意味着，如果错误出现在非事务性表多行插入或更新过程的中途，仅更新部分结果。前面的行将完成插入或更新，但错误出现点后面的行则不然。</p>
<p>因此，解决方法就是在my.ini里把STRICT_TRANS_TABLES关掉</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p339code2'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3392"><td class="code" id="p339code2"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#Set the SQL mode to strict</span>
<span style="color: #339933;">#sql-mode=&quot;STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&quot;</span>
sql<span style="color: #339933;">-</span>mode<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&quot;</span></pre></td></tr></table></div>



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/339.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise Architect 7 资源</title>
		<link>http://www.dbalife.com/archives/336.html</link>
		<comments>http://www.dbalife.com/archives/336.html#comments</comments>
		<pubDate>Mon, 04 Jan 2010 08:22:00 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Program]]></category>
		<category><![CDATA[ea]]></category>
		<category><![CDATA[Enterprise Architect]]></category>
		<category><![CDATA[汉化]]></category>
		<category><![CDATA[注册]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=336</guid>
		<description><![CDATA[Enterprise Architect 7.5 汉化版下载：
http://9.gddx3.crsky.com:808/200907/ha_EnterpriseArchitect-v7.5.843fix.zip
Enterprise Architect 7.5注册码
Name:whitehouse.net.cn
Company:eric
注册码:{67SC0O95-SZPS-LIG2-YQ8Q-8D2N-KWTD-0W6R-TWDD-KT6RB-1J}
 Enterprise Architect 7.1注册码
Name:whitehouse.net.cn
Company:whitehouse.net.cn
注册码:{GLAOMULN-N1F1-EGBC-XN52-9QC6-GJGJ-0W6R-TWDD-KT6RB-SQ}


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Enterprise Architect 7.5 汉化版下载：<br />
<a href="http://9.gddx3.crsky.com:808/200907/ha_EnterpriseArchitect-v7.5.843fix.zip">http://9.gddx3.crsky.com:808/200907/ha_EnterpriseArchitect-v7.5.843fix.zip</a></p>
<p>Enterprise Architect 7.5注册码<br />
Name:whitehouse.net.cn<br />
Company:eric<br />
注册码:{67SC0O95-SZPS-LIG2-YQ8Q-8D2N-KWTD-0W6R-TWDD-KT6RB-1J}</p>
<p> Enterprise Architect 7.1注册码<br />
Name:whitehouse.net.cn<br />
Company:whitehouse.net.cn<br />
注册码:{GLAOMULN-N1F1-EGBC-XN52-9QC6-GJGJ-0W6R-TWDD-KT6RB-SQ}</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/336.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Trace Level Event Numbers</title>
		<link>http://www.dbalife.com/archives/329.html</link>
		<comments>http://www.dbalife.com/archives/329.html#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:28:29 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[10046]]></category>
		<category><![CDATA[level]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[trace]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=329</guid>
		<description><![CDATA[Oracle Trace Level Event Numbers
相关参考信息:

Oracle Trace: The Swiss Army Knife of Diagnostic Tools
Setting Events
Trace and TKPROF



10000 control file debug event, name 'control_file'
10001 control file crash event1
10002 control file crash event2
10003 control file crash event3
10004 control file crash event4
10005 trace latch operations for debugging
10006 testing - block recovery forced
10007 log switch debug crash after new log [...]


Related posts:<ol><li><a href='http://www.dbalife.com/archives/101.html' rel='bookmark' title='Permanent Link: ORACLE STATSPACK REPORT输出结果说明'>ORACLE STATSPACK REPORT输出结果说明</a></li>
<li><a href='http://www.dbalife.com/archives/383.html' rel='bookmark' title='Permanent Link: 禁用/启用所有外键约束'>禁用/启用所有外键约束</a></li>
<li><a href='http://www.dbalife.com/archives/221.html' rel='bookmark' title='Permanent Link: 10g logmnr 无法挖掘DML的解决'>10g logmnr 无法挖掘DML的解决</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Oracle Trace Level Event Numbers</p>
<p>相关参考信息:</p>
<ul>
<li><a href="http://www.proligence.com/pr_oracle_trace.pdf"><span style="color: #0082ff;">Oracle Trace: The Swiss Army Knife of Diagnostic Tools</span></a></li>
<li><a href="http://www.ixora.com.au/q+a/events.htm"><span style="color: #0082ff;">Setting Events</span></a></li>
<li><a href="http://www.psoug.org/reference/trace_tkprof.html"><span style="color: #0082ff;">Trace and TKPROF</span></a></li>
</ul>
<div id="more-more">
<blockquote>
<pre>10000 control file debug event, name 'control_file'
10001 control file crash event1
10002 control file crash event2
10003 control file crash event3
10004 control file crash event4
10005 trace latch operations for debugging
10006 testing - block recovery forced
10007 log switch debug crash after new log select, thread %s
10008 log switch debug crash after new log header write, thread %s
10009 log switch debug crash after old log header write, thread %s
10010 Begin Transaction
10011 End Transaction
10012 Abort Transaction
10013 Instance Recovery
10014 Roll Back to Save Point
10015 Undo Segment Recovery
10016 Undo Segment extend
10017 Undo Segment Wrap
10018 Data Segment Create
10019 Data Segment Recovery
10020 partial link restored to linked list (KSG)
10021 latch cleanup for state objects (KSS)
10022 trace ktsgsp
10023 Create Save Undo Segment
10024 Write to Save Undo
10025 Extend Save Undo Segment
10026 Apply Save Undo
10027 latch cleanup for enqueue locks (KSQ)
10028 latch cleanup for enqueue resources (KSQ)
10029 session logon (KSU)
10030 session logoff (KSU)
10031 row source debug event (R*)
10032 sort end (SOR*)
10035 parse <acronym title="Structured Query Language
">SQL</acronym> statement (OPIPRS)
10036 create remote row source (QKANET)
10037 allocate remote row source (QKARWS)
10038 dump row source tree (QBADRV)
10039 type checking (OPITCA)
10040 dirty cache list
10041 dump undo records skipped
10042 trap error during undo application
10044 free list undo operations
10045 "free list update operations - ktsrsp, ktsunl"
10046 enable <acronym title="Structured Query Language
">SQL</acronym> statement timing
10047 trace switching of sessions
10048 Undo segment shrink
10049 protect library cache memory heaps
10050 sniper trace
10051 trace OPI calls
10052 don't clean up obj$
10053 <acronym title="Cost based optimer
">CBO</acronym> Enable optimizer trace
10054 trace UNDO handling in MLS
10055 trace UNDO handing
10056 dump analyze stats (kdg)
10057 suppress file names in error messages
10058 use table scan cost in tab$.spare1
10060 <acronym title="Cost based optimer
">CBO</acronym> Enable predicate dump
10061 disable SMON from cleaning temp segment
10062 disable usage of <acronym title="Operating System
">OS</acronym> Roles in osds
10063 disable usage of <acronym title="Database Administrator
">DBA</acronym> and OPER privileges in osds
10064 "thread enable debug crash level %s, thread %s"
10065 limit library cache dump information for state object dump
10066 simulate failure to verify file
10067 force redo log checksum errors - block number
10068 force redo log checksum errors - file number
10069 Trusted Oracle test event
10070 force datafile checksum errors - block number
10071 force datafile checksum errors - file number
10072 protect latch recovery memory
10073 have PMON dump info before latch cleanup
10074 default trace function mask for kst
10075 <acronym title="Cost based optimer
">CBO</acronym> Disable outer-join to regular join conversion
10076 <acronym title="Cost based optimer
">CBO</acronym> Enable cartesian product join costing
10077 <acronym title="Cost based optimer
">CBO</acronym> Disable view-merging optimization for outer-joins
10078 <acronym title="Cost based optimer
">CBO</acronym> Disable constant predicate elimination optimization
10080 dump a block on a segment list which cannot be exchanged
10081 segment High Water Mark has been advanced
10082 free list head block is the same as the last block
10083 a brand new block has been requested from space management
10084 free list becomes empty
10085 free lists have been merged
10086 <acronym title="Cost based optimer
">CBO</acronym> Enable error if kko and qka disagree on oby sort
10087 disable repair of media corrupt data blocks
10088 <acronym title="Cost based optimer
">CBO</acronym> Disable new NOT IN optimization
10089 <acronym title="Cost based optimer
">CBO</acronym> Disable index sorting
10090 invoke other events before crash recovery
10091 <acronym title="Cost based optimer
">CBO</acronym> Disable constant predicate merging
10092 <acronym title="Cost based optimer
">CBO</acronym> Disable hash join
10093 <acronym title="Cost based optimer
">CBO</acronym> Enable force hash joins
10094 before resizing a data file
10095 dump debugger commands to trace file
10096 after the cross instance call when resizing a data file
10097 after generating redo when resizing a data file
10098 after the <acronym title="Operating System
">OS</acronym> has increased the size of a data file
10099 after updating the file header with the new file size
10100 after the <acronym title="Operating System
">OS</acronym> has decreased the size of a data file
10101 atomic redo write recovery
10102 switch off anti-joins
10103 <acronym title="Cost based optimer
">CBO</acronym> Disable hash join swapping
10104 dump hash join statistics to trace file
10105 <acronym title="Cost based optimer
">CBO</acronym> Enable constant pred trans and MPs w WHERE-clause
10106 <acronym title="Cost based optimer
">CBO</acronym> Disable evaluating correlation pred last for NOT IN
10107 <acronym title="Cost based optimer
">CBO</acronym> Always use bitmap index
10108 <acronym title="Cost based optimer
">CBO</acronym> Don't use bitmap index
10109 <acronym title="Cost based optimer
">CBO</acronym> Disable move of negated predicates
10110 <acronym title="Cost based optimer
">CBO</acronym> Try index rowid range scans
10111 Bitmap index creation switch
10112 Bitmap index creation switch
10113 Bitmap index creation switch
10114 Bitmap index creation switch
10115 <acronym title="Cost based optimer
">CBO</acronym> Bitmap optimization use maximal expression
10116 <acronym title="Cost based optimer
">CBO</acronym> Bitmap optimization switch
10117 <acronym title="Cost based optimer
">CBO</acronym> Disable new parallel cost model
10118 <acronym title="Cost based optimer
">CBO</acronym> Enable hash join costing
10119 QKA Disable GBY sort elimination
10120 <acronym title="Cost based optimer
">CBO</acronym> Disable index fast full scan
10121 <acronym title="Cost based optimer
">CBO</acronym> Don't sort bitmap chains
10122 <acronym title="Cost based optimer
">CBO</acronym> disable count(col) =&gt; count(*) transformation
10123 QKA Disable Bitmap And-EQuals
10145 test auditing network errors
10146 enable Oracle TRACE collection
10200 block cleanout
10201 consistent read undo application
10202 consistent read block header
10203 consistent read buffer status
10204 signal recursive extend
10205 row cache debugging
10206 transaction table consistent read
10207 consistent read transactions' status report
10208 consistent read loop check
10209 enable simulated error on control file
10210 check data block integrity
10211 check index block integrity
10212 check cluster integrity
10213 crash after control file write
10214 simulate write errors on control file
10215 simulate read errors on control file
10216 dump control file header
10217 debug sequence numbers
10218 dump uba of applied undo
10219 monitor multi-pass row locking
10220 show updates to the transaction table
10221 show changes done with undo
10222 row cache
10223 transaction layer - turn on verification codes
10226 trace CR applications of undo for data operations
10227 verify (multi-piece) row structure
10228 trace application of redo by kcocbk
10230 check redo generation by copying before applying
10231 skip corrupted blocks on _table_scans_
10232 dump corrupted blocks symbolically when kcbgotten
10233 skip corrupted blocks on index operations
10234 trigger event after calling kcrapc to do redo N times
10235 check memory manager internal structures
10236 library cache manager
10237 simulate ^C (for testing purposes)
10238 instantiation manager
10239 multi-instance library cache manager
10240 dump dba's of blocks that we wait for
10241 dump <acronym title="Structured Query Language
">SQL</acronym> generated for remote execution (OPIX)
10243 simulated error for test %s of K2GTAB latch cleanup
10244 make tranids in error msgs print as 0.0.0 (for testing)
10245 simulate lock conflict error for testing PMON
10246 print trace of PMON actions to trace file
10247 Turn on scgcmn tracing. (<acronym title="Virtual Memory System
">VMS</acronym> ONLY)
10248 turn on tracing for dispatchers
10249 turn on tracing for multi-stated servers
10250 Trace all allocate and free calls to the topmost <acronym title="System Global Area
">SGA</acronym> heap
10251 check consistency of transaction table and undo block
10252 simulate write error to data file header
10253 simulate write error to redo log
10254 trace cross-instance calls
10256 turn off multi-threaded server load balancing
10257 trace multi-threaded server load balancing
10258 force shared servers to be chosen round-robin
10259 get error message text from remote using explicit call
10260 Trace calls to SMPRSET (<acronym title="Virtual Memory System
">VMS</acronym> ONLY)
10261 Limit the size of the <acronym title="Process Global Area
">PGA</acronym> heap
10262 Don't check for memory leaks
10263 Don't free empty <acronym title="Process Global Area
">PGA</acronym> heap extents
10264 Collect statistics on context area usage (x$ksmcx)
10265 Keep random system generated output out of error messages
10266 Trace OSD stack usage
10267 Inhibit KSEDMP for testing
10268 Don't do forward coalesce when deleting extents
10269 Don't do coalesces of free space in SMON
10270 Debug shared cursors
10271 distributed transaction after COLLECT
10272 distributed transaction before PREPARE
10273 distributed transaction after PREPARE
10274 distributed transaction before COMMIT
10275 distributed transaction after COMMIT
10276 distributed transaction before FORGET
10277 Cursor sharing (or not) related event (used for testing)
10281 maximum time to wait for process creation
10282 Inhibit signalling of other backgrounds when one dies
10286 Simulate control file open error
10287 Simulate archiver error
10288 Do not check block type in ktrget
10289 Do block dumps to trace file in hex rather than fromatted
10290 kdnchk - checkvalid event - not for general purpose use.
10291 die in dtsdrv to test controlfile undo"
10292 dump uet entries on a 1561 from dtsdrv"
10293 dump debugging information when doing block recovery"
10294 enable PERSISTENT <acronym title="distributed lock manager
">DLM</acronym> operations on non-compliant systems"
10300 disable undo compatibility check at database open
10301 Enable LCK timeout table consistency check"
10320 Enable data layer (kdtgrs) tracing of space management calls"
10352 report direct path statistics
10353 number of slots
10354 turn on direct read path for parallel query
10355 turn on direct read path for scans
10356 turn on hint usage for direct read
10357 turn on debug information for direct path
10374 parallel query server interrupt (validate lock value)
10375 turn on checks for statistics rollups
10376 turn on table queue statistics
10377 turn off load balancing
10379 direct read for rowid range scans (unimplemented)
10380 kxfp latch cleanup testing event
10381 kxfp latch cleanup testing event
10382 parallel query server interrupt (reset)
10383 auto parallelization testing event
10384 parallel dataflow scheduler tracing
10385 parallel table scan range sampling method
10386 parallel <acronym title="Structured Query Language
">SQL</acronym> hash and range statistics
10387 parallel query server interrupt (normal)
10388 parallel query server interrupt (failure)
10389 parallel query server interrupt (cleanup)
10390 Trace parallel query slave execution
10391 trace rowid range partitioning
10392 parallel query debugging bits
10393 print parallel query statistics
10394 allow parallelization of small tables
10395 adjust sample size for range table queues
10396 circumvent range table queues for queries
10397 suppress verbose parallel coordinator error reporting
10398 enable timeouts in parallel query threads
10399 use different internal maximum buffer size
10400 turn on system state dumps for shutdown debugging
10500 turn on traces for SMON
10510 turn off SMON check to offline pending offline rollbacksegment
10511 turn off SMON check to cleanup undo dictionary
10512 turn off SMON check to shrink rollback segments
10600 check cursor frame. allocation
10602 cause an access violation (for testing purposes)
10603 cause an error to occur during truncate (for testing purposes)
10604 trace parallel create index
10605 enable parallel create index by default
10606 trace parallel create index
10607 trace index rowid partition scan
10608 trace create bitmap index
10610 trace create index pseudo optimizer
10666 Do not get database enqueue name
10667 Cause sppst to check for valid process ids
10690 Set shadow process core file dump type (Unix only)
10691 Set background process core file type (Unix only)
10700 Alter access violation exception handler
10701 Dump direct loader index keys
10702 Enable histogram data generation
10703 Simulate process death during enqueue get
10704 Print out information about what enqueues are being obtained
10706 Print out information about instance lock manipulation
10707 Simulate process death for instance registration
10708 Print out Tracing information for skxf multi instance comms
10709 enable parallel instances in create index by default
10710 trace bitmap index access
10711 trace bitmap index merge
10712 trace bitmap index or
10713 trace bitmap index and
10714 trace bitmap index minus
10715 trace bitmap index conversion to rowids
10800 disable Smart Disk scan
10801 enable Smart Disk trace
10802 reserved for Smart Disk
10803 write timing statistics on OPS recovery scan
10804 reserved for ksxb
10805 reserved for row source sort
10900 extent manager fault insertion event #%s
10924 import storage parse error ignore event
10925 trace name context forever
10926 trace name context forever
10927 trace name context forever
10928 trace name context forever
10999 do not get database enqueue name</pre>
</blockquote>
</div>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/101.html' rel='bookmark' title='Permanent Link: ORACLE STATSPACK REPORT输出结果说明'>ORACLE STATSPACK REPORT输出结果说明</a></li>
<li><a href='http://www.dbalife.com/archives/383.html' rel='bookmark' title='Permanent Link: 禁用/启用所有外键约束'>禁用/启用所有外键约束</a></li>
<li><a href='http://www.dbalife.com/archives/221.html' rel='bookmark' title='Permanent Link: 10g logmnr 无法挖掘DML的解决'>10g logmnr 无法挖掘DML的解决</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/329.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vmware server 2.0 安装要点</title>
		<link>http://www.dbalife.com/archives/327.html</link>
		<comments>http://www.dbalife.com/archives/327.html#comments</comments>
		<pubDate>Sat, 10 Oct 2009 03:30:27 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[登录]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=327</guid>
		<description><![CDATA[vmware server 2.0采用web界面，初始用户和密码与宿主机器的系统用户相同，如administrator/xxxx。
但在登录时很可能遇到以下的问题：

ErrorThe VMware Infrastructure Web Service at "http://localhost:8222/sdk" is not responding (Connection Refused).
检查：vmware host agent服务是否已经启动；在hosts文件中是否包含 127.0.0.1  localhost；登录用户是否拥有Administrator权限；登录用户是否属于_vmware_user_用户组
The server was unable to process your log in request.  Please check with your server administrator.
运行net user 用户名 /active:yes



Related posts:Vmware server 1.06 虚拟机自动关机故障一例
Apache2与Resin2整合虚拟主机的配置
caucho-request的范围



Related posts:<ol><li><a href='http://www.dbalife.com/archives/157.html' rel='bookmark' title='Permanent Link: Vmware server 1.06 虚拟机自动关机故障一例'>Vmware server 1.06 虚拟机自动关机故障一例</a></li>
<li><a href='http://www.dbalife.com/archives/126.html' rel='bookmark' title='Permanent Link: Apache2与Resin2整合虚拟主机的配置'>Apache2与Resin2整合虚拟主机的配置</a></li>
<li><a href='http://www.dbalife.com/archives/200.html' rel='bookmark' title='Permanent Link: caucho-request的范围'>caucho-request的范围</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>vmware server 2.0采用web界面，初始用户和密码与宿主机器的系统用户相同，如administrator/xxxx。</p>
<p>但在登录时很可能遇到以下的问题：</p>
<ol>
<li>ErrorThe VMware Infrastructure Web Service at "<a href="http://localhost:8222/sdk">http://localhost:8222/sdk</a>" is not responding (Connection Refused).<br />
检查：vmware host agent服务是否已经启动；在hosts文件中是否包含 127.0.0.1  localhost；登录用户是否拥有Administrator权限；登录用户是否属于_vmware_user_用户组</li>
<li>The server was unable to process your log in request.  Please check with your server administrator.<br />
运行net user 用户名 /active:yes</li>
</ol>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/157.html' rel='bookmark' title='Permanent Link: Vmware server 1.06 虚拟机自动关机故障一例'>Vmware server 1.06 虚拟机自动关机故障一例</a></li>
<li><a href='http://www.dbalife.com/archives/126.html' rel='bookmark' title='Permanent Link: Apache2与Resin2整合虚拟主机的配置'>Apache2与Resin2整合虚拟主机的配置</a></li>
<li><a href='http://www.dbalife.com/archives/200.html' rel='bookmark' title='Permanent Link: caucho-request的范围'>caucho-request的范围</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/327.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sqlplus增强设置</title>
		<link>http://www.dbalife.com/archives/323.html</link>
		<comments>http://www.dbalife.com/archives/323.html#comments</comments>
		<pubDate>Thu, 24 Sep 2009 04:11:05 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[sqlplus]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=323</guid>
		<description><![CDATA[更强的编辑器
sqlplus可以与vi整合，在sqlplus中调用vi编辑器。方法是在sqlplus中执行define_editor='vi'，或将define_editor='vi'添加到/product/10.2/sqlplus/admin/glogin.sql文件中。
之后再登录sqlplus，可以输入edit命令编辑上一次执行的sql。
更人性化的提示符
在glogin.sql文件中添加：
set termout off
default gname=idle
column global_name new_value gname
SELECT lower(USER) &#124;&#124; '@' &#124;&#124;upper(instance_name)&#124;&#124;'('&#124;&#124;nvl(UTL_INADDR.GET_HOST_ADDRESS, SYS_CONTEXT('userenv', 'ip_address'))&#124;&#124;')' GLOBAL_NAME FROM v$instance;
set sqlprompt '&#38;gname&#62; '
set termout on
这样每次登录SQLPLUS提示符会自动更改为“当前用户名@实例名(IP地址)&#62; ”的形式。
10g以下版本在登录后切换用户的情况下，提示符不能自动更新。


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><strong>更强的编辑器</strong></p>
<p>sqlplus可以与vi整合，在sqlplus中调用vi编辑器。方法是在sqlplus中执行define_editor='vi'，或将define_editor='vi'添加到/product/10.2/sqlplus/admin/glogin.sql文件中。</p>
<p>之后再登录sqlplus，可以输入edit命令编辑上一次执行的sql。</p>
<p><strong>更人性化的提示符</strong></p>
<p>在glogin.sql文件中添加：</p>
<blockquote><p><span style="COLOR: green">set</span><span style="COLOR: gray"> </span><span style="COLOR: blue">termout</span><span style="COLOR: gray"> </span><span style="COLOR: green">off</span><span style="COLOR: gray"><br />
</span><span style="COLOR: green">default</span><span style="COLOR: gray"> </span><span style="COLOR: blue">gname</span><span style="COLOR: gray">=</span><span style="COLOR: blue">idle</span><span style="COLOR: gray"><br />
</span><span style="COLOR: green">column</span><span style="COLOR: gray"> </span><span style="COLOR: blue">global_name</span><span style="COLOR: gray"> </span><span style="COLOR: blue">new_value</span><span style="COLOR: gray"> </span><span style="COLOR: blue">gname</span><span style="COLOR: gray"><br />
</span><span style="COLOR: green">SELECT</span><span style="COLOR: gray"> </span><span style="COLOR: #00008b">lower</span><span style="COLOR: olive">(</span><span style="COLOR: green">USER</span><span style="COLOR: olive">)</span><span style="COLOR: gray"> || </span><span style="COLOR: #8b0000">'</span><span style="COLOR: red">@</span><span style="COLOR: #8b0000">'</span><span style="COLOR: gray"> ||</span><span style="COLOR: #00008b">upper</span><span style="COLOR: olive">(</span><span style="COLOR: blue">instance_name</span><span style="COLOR: olive">)</span><span style="COLOR: gray">||</span><span style="COLOR: #8b0000">'</span><span style="COLOR: red">(</span><span style="COLOR: #8b0000">'</span><span style="COLOR: gray">||</span><span style="COLOR: blue">nvl</span><span style="COLOR: olive">(</span><span style="COLOR: blue">UTL_INADDR</span><span style="COLOR: gray">.</span><span style="COLOR: blue">GET_HOST_ADDRESS</span><span style="COLOR: gray">, </span><span style="COLOR: blue">SYS_CONTEXT</span><span style="COLOR: olive">(</span><span style="COLOR: #8b0000">'</span><span style="COLOR: red">userenv</span><span style="COLOR: #8b0000">'</span><span style="COLOR: gray">, </span><span style="COLOR: #8b0000">'</span><span style="COLOR: red">ip_address</span><span style="COLOR: #8b0000">'</span><span style="COLOR: olive">))</span><span style="COLOR: gray">||</span><span style="COLOR: #8b0000">'</span><span style="COLOR: red">)</span><span style="COLOR: #8b0000">'</span><span style="COLOR: gray"> </span><span style="COLOR: blue">GLOBAL_NAME</span><span style="COLOR: gray"> </span><span style="COLOR: green">FROM</span><span style="COLOR: gray"> </span><span style="COLOR: blue">v</span><span style="COLOR: gray">$</span><span style="COLOR: #00008b">instance</span><span style="COLOR: gray">;<br />
</span><span style="COLOR: green">set</span><span style="COLOR: gray"> </span><span style="COLOR: blue">sqlprompt</span><span style="COLOR: gray"> </span><span style="COLOR: #8b0000">'</span><span style="COLOR: red">&amp;gname&gt; </span><span style="COLOR: #8b0000">'</span><span style="COLOR: gray"><br />
</span><span style="COLOR: green">set</span><span style="COLOR: gray"> </span><span style="COLOR: blue">termout</span><span style="COLOR: gray"> </span><span style="COLOR: green">on</span></p></blockquote>
<p>这样每次登录SQLPLUS提示符会自动更改为“当前用户名@实例名(IP地址)&gt; ”的形式。</p>
<p>10g以下版本在登录后切换用户的情况下，提示符不能自动更新。</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/323.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>利用ROWID准确定位数据所在的BLOCK</title>
		<link>http://www.dbalife.com/archives/321.html</link>
		<comments>http://www.dbalife.com/archives/321.html#comments</comments>
		<pubDate>Thu, 24 Sep 2009 01:44:59 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[dbms]]></category>
		<category><![CDATA[rowid]]></category>
		<category><![CDATA[定位]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=321</guid>
		<description><![CDATA[SQL&#62;select rowid,
  2         dbms_rowid.rowid_relative_fno(rowid) RFILE#,
  3         dbms_rowid.rowid_block_number(rowid) BLOCK#,
  4         dbms_rowid.rowid_row_number(rowid) ROW#,
  5         t.*
  6    from testabc t
  7  /
ROWID                  RFILE#     BLOCK#       ROW# BANNER
------------------ ---------- ---------- ---------- ----------------------------------------------------------------
AAADUUAAEAAAAAMAAA          4         12          0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
AAADUUAAEAAAAAMAAB          4         12          1 PL/SQL Release 10.2.0.4.0 - Production
AAADUUAAEAAAAAMAAC          4         12          2 CORE        10.2.0.4.0      Production
AAADUUAAEAAAAAMAAD          4         12          [...]


Related posts:<ol><li><a href='http://www.dbalife.com/archives/58.html' rel='bookmark' title='Permanent Link: 打包安装oracle'>打包安装oracle</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>SQL&gt;select rowid,<br />
  2         dbms_rowid.rowid_relative_fno(rowid) RFILE#,<br />
  3         dbms_rowid.rowid_block_number(rowid) BLOCK#,<br />
  4         dbms_rowid.rowid_row_number(rowid) ROW#,<br />
  5         t.*<br />
  6    from testabc t<br />
  7  /</p>
<p>ROWID                  RFILE#     BLOCK#       ROW# BANNER<br />
------------------ ---------- ---------- ---------- ----------------------------------------------------------------<br />
AAADUUAAEAAAAAMAAA          4         12          0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod<br />
AAADUUAAEAAAAAMAAB          4         12          1 PL/SQL Release 10.2.0.4.0 - Production<br />
AAADUUAAEAAAAAMAAC          4         12          2 CORE        10.2.0.4.0      Production<br />
AAADUUAAEAAAAAMAAD          4         12          3 TNS for 32-bit Windows: Version 10.2.0.4.0 - Production<br />
AAADUUAAEAAAAAMAAE          4         12          4 NLSRTL Version 10.2.0.4.0 - Production</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/58.html' rel='bookmark' title='Permanent Link: 打包安装oracle'>打包安装oracle</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/321.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle10g 后台进程列表</title>
		<link>http://www.dbalife.com/archives/317.html</link>
		<comments>http://www.dbalife.com/archives/317.html#comments</comments>
		<pubDate>Thu, 17 Sep 2009 08:17:31 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[oracle10g]]></category>
		<category><![CDATA[列表]]></category>
		<category><![CDATA[详解]]></category>
		<category><![CDATA[进程]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=317</guid>
		<description><![CDATA[oracle 10g 的后台系统进程列表，名称与作用


Related posts:<ol><li><a href='http://www.dbalife.com/archives/101.html' rel='bookmark' title='Permanent Link: ORACLE STATSPACK REPORT输出结果说明'>ORACLE STATSPACK REPORT输出结果说明</a></li>
<li><a href='http://www.dbalife.com/archives/155.html' rel='bookmark' title='Permanent Link: Oracle10g clusterware 安装中遇到的一个问题'>Oracle10g clusterware 安装中遇到的一个问题</a></li>
<li><a href='http://www.dbalife.com/archives/329.html' rel='bookmark' title='Permanent Link: Oracle Trace Level Event Numbers'>Oracle Trace Level Event Numbers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<table style="table-layout: fixed; width: 100%;" border="0">
<tbody>
<tr>
<td>$ ps -ef | grep ora_ | grep -v grep<br />
oracle   14385     1 0 Oct10 ?        00:00:01 ora_pmon_WENDING<br />
oracle   14387     1 0 Oct10 ?        00:00:00 ora_psp0_WENDING<br />
oracle   14389     1 0 Oct10 ?        00:00:00 ora_mman_WENDING<br />
oracle   14391     1 0 Oct10 ?        00:00:21 ora_dbw0_WENDING<br />
oracle   14393     1 0 Oct10 ?        00:01:01 ora_lgwr_WENDING<br />
oracle   14395     1 0 Oct10 ?        00:00:01 ora_ckpt_WENDING<br />
oracle   14397     1 0 Oct10 ?        00:01:00 ora_smon_WENDING<br />
oracle   14399     1 0 Oct10 ?        00:00:00 ora_reco_WENDING<br />
oracle   14401     1 0 Oct10 ?        00:00:26 ora_cjq0_WENDING<br />
oracle   14403     1 0 Oct10 ?        00:01:45 ora_mmon_WENDING<br />
oracle   14405     1 0 Oct10 ?        00:00:37 ora_mmnl_WENDING<br />
oracle   14409     1 0 Oct10 ?        00:00:04 ora_arc0_WENDING<br />
oracle   14411     1 0 Oct10 ?        00:00:03 ora_arc1_WENDING<br />
oracle   14415     1 0 Oct10 ?        00:00:00 ora_qmnc_WENDING<br />
oracle   14421     1 0 Oct10 ?        00:00:15 ora_q000_WENDING<br />
oracle   19027     1 0 Oct20 ?        00:00:00 ora_q002_WENDING<br />
$一、后台进程包括</p>
<p>1)Focused Background Processes<br />
2)Utility Background Processes</p>
<p>1. Focused Background Processes</p>
<p><strong>PMON(Process Monitor)<span> </span>:</strong><br />
1)connection在不正常终止时，pmon负责释放资源，rollback未提交的事务；<br />
2)监控后台进程，如果某些后台进程不正常终止，则会重启它（比如dispatcher），或者直接终止实例(比如lgmr终止时)；<br />
3)实例启动时，pmon负责注册实例到监听上，当实例启动时，pmon进程会检查默认监听器是否启动，如果使用非默认的监听器，需要设置local_listener参数。</p>
<p><strong>SMON(System Monitor:</strong><br />
1)clean up临时空间：真正的临时段不需要clean up，但某些操作，比如create index产生的临时段当create index的session不正常终止时，此时需要smon来清理。<br />
2)Coalesces free space：如果使用字典管理表空间，smon负责将连续的空闲extent合并；<br />
3)Recovers transactions active against unavailable files: 这个过程和实例启动时进行的instance crash recovery(自动前滚和回滚)相似，只不过由于实例启动时某些文件无法访问，而实例启动后的某个时间这些文件可以访问时，smon就会对其执行 recover；<br />
4)Performs instance recovery of a failed node in RAC: 当rac的某个节点失败时，某个剩余的节点会打开失败节点对应的redo log，进行recover；<br />
5)Cleans up OBJ$: obj$是个底层的数据字典，包括所有的数据库对象信息，很多时候，某些对象被删除时，由smon进程来clean up 该视图；<br />
6)Shrinks rollback segments：如果设置了optimal size参数，smon进程负责执行回滚段的自动收缩<br />
7)"Offlines" rollback segments：当用户offline某个回滚段，但此时该回滚断有active trancsaction，这是回滚段的状态其实是pending offline，而smon进程会定期的检查该回滚段的事务是否完成，完成即将其变为offline；<br />
8)还有很多其它任务。</p>
<p><strong>RECO(Recovery Background Process)</strong><br />
1)reco有个主要工作，就是recover那些两阶段提交的但由于网络或其它原因造成状态为prepared 的挂起事务。<br />
两阶段提交的概念：A 2PC is a distributed protocol that allows for a modification that affects many disparate databases to be committed automically. It attempts to close the window for distributed failure as much as possible before committing. In a 2PC between N databases， one of the databases—typically (but not always) the one the client logged into initially—will be the coordinator. This one site will ask the other N-1 sites if they are ready to commit. In effect， this one site will go to the N-1 sites and ask them to be prepared to commit. Each of the N-1 sites reports back its “prepared state” as YES or NO. If any one of the sites votes NO， the entire transaction is rolled back. If all sites vote YES，then the site coordinator broadcasts a message to make the commit permanent on each of the N-1 sites.<br />
关于2pc的中文帖子说明：http://flyhorse2k.spaces.live.com/blog/cns!9C7106D3DF7B09DE!178.entry<br />
2) 当某些节点反馈yes给事务协调器可以提交时，但事务协调器还未正式发出可以提交的最后指示时，由于网络的原因，这些节点失去了和事务协调节点的联系，此时这些事务就成为了an in-doubt distributed transaction。此时，RECO就负责定期的联系事务协调器，当联系到时，就会提交或者回滚这些事务了。<br />
3)对于某些大的事务，如果使用reco的成本比较高，可以人为的干涉来处理掉这些事务<br />
SQL&gt; select local_tran_id，global_tran_id，state from dba_2pc_pending；<br />
SQL&gt; rollback force ""；</p>
<p><strong>CKPT(Checkpoint):</strong><br />
1)CKPT 进程不是做checkpoint(A checkpoint is the writing of dirty (modified) blocks from the buffer cache to disk)的，而是在发生checkpoint时，修改数据文件头的。<br />
2)在oracle8以前，CKPT的任务可以由LGWR进程来执行，因此CKPT进程可选，但从8.0开始，CKPT进程是必须的，LGWR也减少了执行负担。</p>
<p><strong>DBWR(Database Writer):</strong><br />
1)负责将dirty buffer写入到datafile中，目的是腾出sga空间和advance checkpoint；<br />
2)Advance checkpoint后，oracle在做instance recover时，就从online redo file的新位置做为起点位置做恢复；<br />
3)当发生log switch时，会出发checkpoint；<br />
4)当online log file 需要被重用时，checkpoint还没有做完的话，警告文件里面会有checkpoint not complete的警告；<br />
5)如果dbwr的性能低下，我们会发现很多free buffer waits和write complete waits的等待；<br />
6)可以配置多个dbwr进程，比如dbw1，dbw2，...dbw9，...dbwj，最多20个，参数为db_writer_processes，这可以利用多个CPU的并行处理功能；<br />
7)如果操作系统支持AIO，dbwr就可以不用等待操作系统写完，而继续下一个dbwr请求；<br />
8)如果操作系统不支持AIO，可以利用dbwr slaves来模拟，参数为dbwr_io_slaves；</p>
<p><strong>LGWR（Log Writer）: </strong><br />
1)将redo log buffer写入到redo log file中；<br />
2)每3秒、commit、redo log buffer 1/3满时，都会触发lgwr写；<br />
3)因此redo log buffer不需要太大；<br />
4)lgwr采用sequenctial地写入，不像dbwr是scatter的写入，因此lgwr的性能要高很多；</p>
<p><strong>ASMB（Automatic Storage Manangement Background）：</strong><br />
1)ASM实例与数据库实例通信的桥梁<br />
2)与各实例更新和交换状态信息</p>
<p><strong>RBAL（Reblance）:</strong><br />
1)当使用ASM存储database file时，启用该进程；<br />
2)该进程负责当从ASM disk group中增加或减少disk时，rebalance数据。</p>
<p><strong>LMON（Lock monitor）:</strong><br />
1)RAC下的进程；<br />
2)负责监控RAC集群中的实例是否fail；<br />
3)当RAC中实例增加或减少时，负责重新配置lock和其他资源；</p>
<p><strong>LMD（Lock mananger daemon）:</strong><br />
1)RAC下的进程；<br />
2)将global cache service(keep he block buffer consistent between instances)的锁请求发送给LMSn控制的队列中；</p>
<p><strong>LMSn（Lock managerserver）：</strong><br />
1)RAC下的进程；<br />
2)主要目的是通过cache-to-cache的方式，保证gloabal cache service；<br />
3)每个Instance可以配置最多10gLMSn；</p>
<p><strong>LCK0（Lock):</strong><br />
1)RAC下的进程；<br />
2)作用和LMD类似，但它不仅处理datablock buffer的请求，也处理其它的global resource；</p>
<p><strong>DIAG（Diagnosability daemon）：</strong><br />
1)RAC下的进程；<br />
2)监控各个实例是否health，并且在发生fail时，进行capture；</p>
<p>2. Utility Background Processes</p>
<p><strong>CJQ0 and Jnnn Processes:Job Queue</strong><br />
1)当配置job_queue_processes时，会有Jnnn和CJQ0进程；<br />
2)Jnnn进程最多可有1000个；<br />
3)Jnnn进程在job之间是共享的，但同时每个Jnnn只能执行一个job，并且它使用的内存是在UGA中；<br />
4)物化试图的刷新一般要用到job；<br />
5)streams一般用到AQ；<br />
6)CJQ0，做为jnnn的coordinator，它来控制jnnn的启动和关闭；<br />
7)Jnnn进程只会在有job需要处理时才会启动；</p>
<p><strong>QMNC and Qnnn Processes:Job Queue</strong><br />
1)用于AQ功能；<br />
2)Qnnn处理每个message queue，QMNC做为Qnnn的coordinator；<br />
3)如果配置了aq_tm_processes，就会启动QMNC和Qnnn进程，不论有没有queue要处理，Qnnn都会全部启动；</p>
<p><strong>EMNn:Event Monitor Processes</strong><br />
1)用于AQ功能；<br />
2)用于监控queue，向订购者反馈消息。</p>
<p><strong>MMAN（Memory Manager）：<br />
</strong>1)当使用自动管理内存功能时，MMAN负责处理sga各组件的内存动态分配，包括有default buffer pool，shared pool，java pool，large pool。</p>
<p><strong>MMON（Memory Monitor）：<br />
</strong>1)与AWR功能配合，用于自动侦测数据库问题及调优。MMON写出AWR需要的统计信息</p>
<p><strong>MMNL（Memory Monitor Light）：<br />
</strong>1)与AWR协作，在必要时将所有统计信息buffer写入磁盘</p>
<p><strong>CTWR:Change Tracking Processes</strong><br />
1)负责维护new change tracking file。</p>
<p><strong>RVWR:Recovery Writer</strong><br />
1)负责维护flash recovery area中的before images数据。</p>
<p>还有一些其他的utility process，比如为dataguard服务的，为streams服务的，为data pump服务的等等。</p>
<p>二、从进程包括</p>
<p>1)I/O slaves<br />
2)Parallel query Slaves</p>
<p>I/O Slaves<br />
1)如果操作系统不支持AIO，可以利用io slaves模拟aio；<br />
2)backup_tape_io_slaves为rman服务，设置为true的话，rman会根据需要自动启动一些slaves来完成与tape的相关读写操作；<br />
3)dbwr_io_slaves为dbwr使用，当设置dbwr_io_slave大于0时，lgwr和arch会使用他们自己的slaves(最多4个)；<br />
4)dbwr的从进程为I1nn，lgwr的从进程为I2nn。</p>
<p>Parallel Query Slaves<br />
1)当执行某些语句时，会产生很多执行计划，这些执行其实可以并行执行，然后合并成一个输出结果；<br />
2)可以利用并行查询功能来实现并行；<br />
3)产生的并行查询进程名为Pnnn。</td>
</tr>
</tbody>
</table>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/101.html' rel='bookmark' title='Permanent Link: ORACLE STATSPACK REPORT输出结果说明'>ORACLE STATSPACK REPORT输出结果说明</a></li>
<li><a href='http://www.dbalife.com/archives/155.html' rel='bookmark' title='Permanent Link: Oracle10g clusterware 安装中遇到的一个问题'>Oracle10g clusterware 安装中遇到的一个问题</a></li>
<li><a href='http://www.dbalife.com/archives/329.html' rel='bookmark' title='Permanent Link: Oracle Trace Level Event Numbers'>Oracle Trace Level Event Numbers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/317.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>oralce10g shrink</title>
		<link>http://www.dbalife.com/archives/286.html</link>
		<comments>http://www.dbalife.com/archives/286.html#comments</comments>
		<pubDate>Wed, 22 Jul 2009 04:21:59 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[10g]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[shrink]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=286</guid>
		<description><![CDATA[1、在10G 以前收缩表空间是用：
　　1.exp/imp
　　2.alter table xxx move　
2、10G后用shrink收缩表空间
表空间中支持自动段空间管理 (ASSM), 否则会报 ORA-10635: Invalid segment or tablespace type
Shrink操作适用于
表（堆组织表或索引组织表）
分区
子分区
索引
大对象（数据或索引段）
物化视图
物化视图日志
堆组织段(heap-organized segments)必须开启行迁移功能:
alter table tbname enable row movement shrink
保持HWM
alter table tbname shrink space compact;
回缩表与HWM
alter table tbname shrink space;
回缩表与相关索引
alter table tbname shrink space cascade;
回缩索引
alter index idxname shrink space;
　　
相关限制：
1）cluster中的表。
2）有long字段的表。
3）有on_commit物化视图的表。
4）有基于rowid物化视图的表。
5）IOT映射表。
6）有基于函数索引的表


Related posts:禁用/启用所有外键约束
Oracle Trace Level Event Numbers



Related posts:<ol><li><a href='http://www.dbalife.com/archives/383.html' rel='bookmark' title='Permanent Link: 禁用/启用所有外键约束'>禁用/启用所有外键约束</a></li>
<li><a href='http://www.dbalife.com/archives/329.html' rel='bookmark' title='Permanent Link: Oracle Trace Level Event Numbers'>Oracle Trace Level Event Numbers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #000000;">1、在10G 以前收缩表空间是用：</span></strong></p>
<p>　　1.exp/imp<br />
　　2.alter table xxx move　</p>
<p><strong><span style="color: #000000;">2、10G后用shrink收缩表空间</span></strong></p>
<p>表空间中支持自动段空间管理 (ASSM), 否则会报 ORA-10635: Invalid segment or tablespace type</p>
<p>Shrink操作适用于</p>
<p style="padding-left: 30px;">表（堆组织表或索引组织表）<br />
分区<br />
子分区<br />
索引<br />
大对象（数据或索引段）<br />
物化视图<br />
物化视图日志</p>
<p>堆组织段(heap-organized segments)必须开启行迁移功能:<br />
alter table tbname enable row movement shrink</p>
<p>保持HWM<br />
alter table tbname shrink space compact;</p>
<p>回缩表与HWM<br />
alter table tbname shrink space;</p>
<p>回缩表与相关索引<br />
alter table tbname shrink space cascade;</p>
<p>回缩索引<br />
alter index idxname shrink space;<br />
　　<br />
<span style="color: #ff0000;">相关限制：<br />
1）cluster中的表。<br />
2）有long字段的表。<br />
3）有on_commit物化视图的表。<br />
4）有基于rowid物化视图的表。<br />
5）IOT映射表。<br />
6）有基于函数索引的表</span></p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/383.html' rel='bookmark' title='Permanent Link: 禁用/启用所有外键约束'>禁用/启用所有外键约束</a></li>
<li><a href='http://www.dbalife.com/archives/329.html' rel='bookmark' title='Permanent Link: Oracle Trace Level Event Numbers'>Oracle Trace Level Event Numbers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/286.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
