﻿<?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>OracleBlog.cn -天堂向左 DBA向右</title>
	<atom:link href="http://www.oracleblog.cn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oracleblog.cn</link>
	<description>一个dba的平凡生活</description>
	<pubDate>Tue, 31 Aug 2010 03:54:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>为AIX中配置sendmail relay到smtp server</title>
		<link>http://www.oracleblog.cn/working-case/config-relay-smtp-server/</link>
		<comments>http://www.oracleblog.cn/working-case/config-relay-smtp-server/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 16:24:46 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[Working case]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1149</guid>
		<description><![CDATA[今天写了一个数据库的监控脚本，在测试脚本能否正常告警时，发现邮件发不出去。
这个系统的环境是这样的，在整个系统中，大部分的机器放在192.168.1网段，为trust area，数据库主机也在此网... ]]></description>
			<content:encoded><![CDATA[<p>今天写了一个数据库的监控脚本，在测试脚本能否正常告警时，发现邮件发不出去。</p>
<p>这个系统的环境是这样的，在整个系统中，大部分的机器放在192.168.1网段，为trust area，数据库主机也在此网段；另外有几台机器在192.168.3网段，为DMZ area。发送邮件不能直接在数据库主机上直接发送，需要通过192.168.3网段上的一台smtp server进行relay。我们假设这台smtp server的IP为192.168.3.99，下面我们来开始配置db主机，使得db主机上用mailx命令发送的邮件能中继到smtp server上进行发送。</p>
<p>在这里，db主机的os环境是aix 5.3，需要配置的文件为/etc/sendmail.cf。我们先备份一下这个文件，然后来进行修改：<br />
在这个文件中，找到有如下相关的行（如果没有需要自行添加）：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;"># for sendmail<br />DSsmtp:[192.168.3.99]<br />DwMYDAB02<br />Cwlocalhost</span></div></div>
<p>其中DSsmtp:[192.168.3.99]表示smtp server的IP为192.168.3.99<br />
Dw后面直接跟本机的主机名<br />
Cw后面跟localhost</p>
<p>修改上面的参数后，重启sendmail服务：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">refresh -s sendmail</span></div></div>
<p>此时即可在db主机上，通过mailx命令将监控的告警邮件，relay到smtp sever，然后通过smtp sever集中发送：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">#!/usr/bin/sh<br />###################################################################<br />#&nbsp; &nbsp;This script is written by username@cn.ibm.com at 2010-08-12.<br />#&nbsp; &nbsp;Because HQ monitor can not cover all the db parameters,<br />#&nbsp; &nbsp;it need to by monitor by this script.<br />#&nbsp; &nbsp;main_normal.sh monitor the normal process and run every 2 hours<br />#&nbsp; &nbsp;main_crital.sh monitor the crital process and run every 2 mins<br />####################################################################<br />&nbsp;<br />#### PARAMETER AND WORKING PATH SETTING<br />export ORACLE_BASE=/u01/app/oracle<br />export ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1<br />export PATH=$ORACLE_HOME/bin:$PATH<br />export ORACLE_SID=MDBPRD<br />&nbsp;<br />WORKPATH=/u03/db_monitor<br />LOGPATH=${WORKPATH}/log<br />SRPTPATH=${WORKPATH}/bin<br />MAILPATH=${WORKPATH}/mailresult<br />&nbsp;<br />&nbsp;<br />CLOG=${LOGPATH}/db_monitor_${ORACLE_SID}_$(date +%Y%m%d).clog<br />NLOG=${LOGPATH}/db_monitor_${ORACLE_SID}_$(date +%Y%m%d).nlog<br />MRESULT=${MAILPATH}/mail_result_${ORACLE_SID}_$(date +%Y%m%d).mresult<br />&nbsp;<br />MAIL_TOOL=/usr/bin/mailx<br />TO_MAIL=jianminh@cn.ibm.com<br />CC_MAIL=jianminh@cn.ibm.com<br />&nbsp;<br />cd ${WORKPATH}<br />&nbsp;<br />#### CHECKING CRITAL PROCESS<br />v_lsnr=`ps&nbsp; -ef |grep tns |grep -v grep |wc -l`<br />&nbsp;<br />v_process1521=`netstat -an |grep 1521|grep -v grep |wc -l`<br />&nbsp;<br />v_crit_process=`ps&nbsp; -ef |grep ora_ |grep ${ORACLE_SID} |grep -v grep|wc -l`<br />&nbsp;<br />#### WRITE CHECKING RESULT TO LOG<br />echo &quot;#################################################&quot;&gt;&gt;$CLOG<br />echo &quot;============= CRITAL REPORT BEGIN =============&quot;&gt;&gt;$CLOG<br />date&gt;&gt;$CLOG<br />&nbsp;<br />echo &quot;====THE NUMBER OF LNSR====&quot;&gt;&gt;$CLOG<br />echo $v_lsnr&gt;&gt;$CLOG<br />echo &quot; &quot;&gt;&gt;$CLOG<br />&nbsp;<br />&nbsp;<br />echo &quot;====THE NUMBER OF PROCESS USING PORT 1521====&quot;&gt;&gt;$CLOG<br />echo $v_process1521&gt;&gt;$CLOG<br />echo &quot; &quot;&gt;&gt;$CLOG<br />&nbsp;<br />echo &quot;====THE NUMBER OF ORACLE BGPROCESS====&quot;&gt;&gt;$CLOG<br />echo $v_crit_process&gt;&gt;$CLOG<br />echo &quot; &quot;&gt;&gt;$CLOG<br />echo &quot;============== CRITAL REPORT END ==============&quot;&gt;&gt;$CLOG<br />&nbsp;<br />&nbsp;<br />if [ $v_lsnr -lt 1 ]<br />then<br />cat /dev/null &gt; $MRESULT<br />tail -12 $CLOG&gt;$MRESULT<br />$MAIL_TOOL -s &quot;IMPORTANT! MYDAB02 LSNR DOWN!&quot; -c $CC_MAIL $TO_MAIL </span><span style="color: Olive;">&lt;</span><span style="color: Gray;"> $</span><span style="color: #00008b;">MRESULT</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">else</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">ok</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">fi</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: #00008b;">if</span><span style="color: Gray;"> [ $</span><span style="color: #00008b;">v_process1521</span><span style="color: Gray;"> </span><span style="color: #00008b;">-lt</span><span style="color: Gray;"> </span><span style="color: #00008b;">10</span><span style="color: Gray;"> ]<br /></span><span style="color: #00008b;">then</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">cat</span><span style="color: Gray;"> /</span><span style="color: Green;">dev</span><span style="color: Gray;">/</span><span style="color: Green;">null</span><span style="color: Gray;"> </span><span style="color: Olive;">&gt;</span><span style="color: Gray;"> $MRESULT<br />tail -12 $CLOG&gt;$MRESULT<br />$MAIL_TOOL -s &quot;IMPORTANT! MYDAB02 PORT 1521 DOWN!&quot; -c $CC_MAIL $TO_MAIL </span><span style="color: Olive;">&lt;</span><span style="color: Gray;"> $</span><span style="color: #00008b;">MRESULT</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">else</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">ok</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">fi</span><span style="color: Gray;"><br />&nbsp;<br />&nbsp;<br /></span><span style="color: #00008b;">if</span><span style="color: Gray;"> [ $</span><span style="color: #00008b;">v_crit_process</span><span style="color: Gray;"> </span><span style="color: #00008b;">-lt</span><span style="color: Gray;"> </span><span style="color: #00008b;">5</span><span style="color: Gray;"> ]<br /></span><span style="color: #00008b;">then</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">cat</span><span style="color: Gray;"> /</span><span style="color: Green;">dev</span><span style="color: Gray;">/</span><span style="color: Green;">null</span><span style="color: Gray;"> </span><span style="color: Olive;">&gt;</span><span style="color: Gray;"> $MRESULT<br />tail -12 $CLOG&gt;$MRESULT<br />$MAIL_TOOL -s &quot;IMPORTANT! MYDAB02 ORACLE DOWN!&quot; -c $CC_MAIL $TO_MAIL </span><span style="color: Olive;">&lt;</span><span style="color: Gray;"> $</span><span style="color: #00008b;">MRESULT</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">else</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">echo</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">OK</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"><br /></span><span style="color: #00008b;">fi</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/working-case/config-relay-smtp-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OCM考试-总结和补充</title>
		<link>http://www.oracleblog.cn/study-note/ocm-exam-summary-one/</link>
		<comments>http://www.oracleblog.cn/study-note/ocm-exam-summary-one/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 15:38:44 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[Study note]]></category>

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

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1135</guid>
		<description><![CDATA[    OCM考试系列的文章写的快结束了，基本的内容都已经涉及到，在这片文章中，将对之前的OCM考试系列文章进行汇总，对一些之前没提到的知识点进行补充。
OCM考试分成8个section，时间安排为... ]]></description>
			<content:encoded><![CDATA[<p>    OCM考试系列的文章写的快结束了，基本的内容都已经涉及到，在这片文章中，将对之前的OCM考试系列文章进行汇总，对一些之前没提到的知识点进行补充。</p>
<p>OCM考试分成8个section，时间安排为：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">OCM考试一共有9个section，具体的安排如下：<br />第一天上午：<br />section 0:创建一个数据库&nbsp; &nbsp; &nbsp; &nbsp; 45分钟<br />section 1:数据库和网络配置&nbsp; &nbsp; &nbsp; 120分钟<br />第一天下午：<br />section 2:Grid control安装配置&nbsp; &nbsp;120分钟<br />section 3:数据库备份恢复&nbsp; &nbsp; &nbsp; &nbsp; 60分钟<br />section 4:数据仓库管理&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 90分钟<br />&nbsp;<br />第二天上午：<br />section 5:数据库管理&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 120分钟<br />section 6:数据库性能管理&nbsp; &nbsp; &nbsp; &nbsp; 120分钟<br />第二天下午：<br />section 7:部署Oracle RAC数据库&nbsp; 105分钟<br />sectoin 8:部署dataguard数据库&nbsp; &nbsp;60分钟</span></div></div>
<p>section 0的手工建库，相关文章见：<a href="http://www.oracleblog.cn/study-note/ocm-exam-create-the-database/">《OCM考试-create the database》</a>，注意牢记在线文档中create database的例句在administrator guide-Part I Basic Database Administration-2 creating an oracle database - Step 7: Issue the CREATE DATABASE Statement。</p>
<p>section 1：侦听部分见文章<a href="http://www.oracleblog.cn/study-note/ocm-exam-listener/">《OCM考试-listener》</a>，另外还会涉及到表空间管理，需要注意以下知识点，<br />
1、big tablespace 的建立，相关文档Administrator&#8217;s Guide-8 Managing Tablespaces-Creating Tablespaces和SQL Reference-16 SQL Statements: CREATE SYNONYM to CREATE TRIGGER-CREATE TABLESPACE 。<br />
例子：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">bigfile</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">big_tbs</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\o</span><span style="color: Red;">racle</span><span style="color: Navy;">\p</span><span style="color: Red;">roduct</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\o</span><span style="color: Red;">radata</span><span style="color: Navy;">\o</span><span style="color: Red;">ralocal</span><span style="color: Navy;">\b</span><span style="color: Red;">ig_tbs1.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">200</span><span style="color: #00008b;">m</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">default</span><span style="color: Gray;"> </span><span style="color: Blue;">storage</span><span style="color: Olive;">(</span><span style="color: Blue;">initial</span><span style="color: Gray;"> </span><span style="color: Maroon;">1</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Green;">next</span><span style="color: Gray;"> </span><span style="color: Maroon;">1</span><span style="color: #00008b;">m</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br />表空间已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>2、tablespace group的建立，相关文档也可以在Administrator&#8217;s Guide和SQL Reference里面找。<br />
例子 ：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">temporary</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">temp1</span><span style="color: Gray;"> </span><span style="color: Blue;">tempfile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\o</span><span style="color: Red;">racle</span><span style="color: Navy;">\p</span><span style="color: Red;">roduct</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\o</span><span style="color: Red;">radata</span><span style="color: Navy;">\o</span><span style="color: Red;">ralocal</span><span style="color: Navy;">\t</span><span style="color: Red;">emp1.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">5</span><span style="color: #00008b;">m</span><span style="color: Gray;">;<br />&nbsp;<br />表空间已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">temporary</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">temp2</span><span style="color: Gray;"> </span><span style="color: Blue;">tempfile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\o</span><span style="color: Red;">racle</span><span style="color: Navy;">\p</span><span style="color: Red;">roduct</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\o</span><span style="color: Red;">radata</span><span style="color: Navy;">\o</span><span style="color: Red;">ralocal</span><span style="color: Navy;">\t</span><span style="color: Red;">emp2.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">5</span><span style="color: #00008b;">m</span><span style="color: Gray;">;<br />&nbsp;<br />表空间已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">temp1</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: Blue;">tmp_grp</span><span style="color: Gray;">;<br />&nbsp;<br />表空间已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">temp2</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: Blue;">tmp_grp</span><span style="color: Gray;">;<br />&nbsp;<br />表空间已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> * </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_tablespace_groups</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">GROUP_NAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">TABLESPACE_NAME</span><span style="color: Gray;"><br />----------------------------</span><span style="color: #ffa500;">-- ------------------------------</span><span style="color: Gray;"><br /></span><span style="color: Blue;">TMP_GRP</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">TEMP1</span><span style="color: Gray;"><br /></span><span style="color: Blue;">TMP_GRP</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">TEMP2</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">database</span><span style="color: Gray;"> </span><span style="color: Green;">default</span><span style="color: Gray;"> </span><span style="color: Green;">temporary</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">tmp_grp</span><span style="color: Gray;">;<br />&nbsp;<br />数据库已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: #00008b;">name</span><span style="color: Gray;">,</span><span style="color: Green;">value</span><span style="color: Gray;">$ </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">props</span><span style="color: Gray;">$ </span><span style="color: Green;">where</span><span style="color: Gray;"> </span><span style="color: #00008b;">name</span><span style="color: Gray;"> </span><span style="color: Green;">like</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">%TEMP%</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: #00008b;">NAME</span><span style="color: Gray;"><br />----------------------------</span><span style="color: #ffa500;">--<br />VALUE$</span><span style="color: Gray;"><br />------------------------------------------------------------------------------</span><span style="color: #ffa500;">--<br />DEFAULT_TEMP_TABLESPACE</span><span style="color: Gray;"><br /></span><span style="color: Blue;">TMP_GRP</span><span style="color: Gray;"><br />&nbsp;<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">temp1</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: #8b0000;">''</span><span style="color: Gray;">;<br />&nbsp;<br />表空间已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> * </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_tablespace_groups</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">GROUP_NAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">TABLESPACE_NAME</span><span style="color: Gray;"><br />----------------------------</span><span style="color: #ffa500;">-- ------------------------------</span><span style="color: Gray;"><br /></span><span style="color: Blue;">TMP_GRP</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">TEMP2</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>3、冗余logifle，相关文档见SQL Reference-10 SQL Statements: ALTER CLUSTER to ALTER JAVA-ALTER DATABASE -logfile_clauses 。<br />
例子：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</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: Blue;">logfile</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">GROUP</span><span style="color: #ffa500;"># STATUS&nbsp; TYPE&nbsp; &nbsp; MEMBER&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IS_</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">-- ------- ------- ------------------------------------------------------------ ---</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO01</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO02</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO03</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">database</span><span style="color: Gray;"> </span><span style="color: Green;">add</span><span style="color: Gray;"> </span><span style="color: Blue;">logfile</span><span style="color: Gray;"> </span><span style="color: Blue;">member</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO11.LOG</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">to</span><span style="color: Gray;"> </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: Maroon;">1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; /<br />&nbsp;<br />数据库已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">database</span><span style="color: Gray;"> </span><span style="color: Green;">add</span><span style="color: Gray;"> </span><span style="color: Blue;">logfile</span><span style="color: Gray;"> </span><span style="color: Blue;">member</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO12.LOG</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">to</span><span style="color: Gray;"> </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: Maroon;">2</span><span style="color: Gray;">;<br />&nbsp;<br />数据库已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">database</span><span style="color: Gray;"> </span><span style="color: Green;">add</span><span style="color: Gray;"> </span><span style="color: Blue;">logfile</span><span style="color: Gray;"> </span><span style="color: Blue;">member</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO13.LOG</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">to</span><span style="color: Gray;"> </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: Maroon;">3</span><span style="color: Gray;">;<br />&nbsp;<br />数据库已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</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: Blue;">logfile</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">GROUP</span><span style="color: #ffa500;"># STATUS&nbsp; TYPE&nbsp; &nbsp; MEMBER&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IS_</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">-- ------- ------- ------------------------------------------------------------ ---</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO01</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO02</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO03</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;"> </span><span style="color: Blue;">INVALID</span><span style="color: Gray;"> </span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO11</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;"> </span><span style="color: Blue;">INVALID</span><span style="color: Gray;"> </span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO12</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;"> </span><span style="color: Blue;">INVALID</span><span style="color: Gray;"> </span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO13</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;<br />已选择</span><span style="color: Maroon;">6</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">database</span><span style="color: Gray;"> </span><span style="color: Green;">add</span><span style="color: Gray;"> </span><span style="color: Blue;">logfile</span><span style="color: Gray;"> </span><span style="color: Green;">GROUP</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO04.LOG</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO14.LOG</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">SIZE</span><span style="color: Gray;"> </span><span style="color: Maroon;">50</span><span style="color: #00008b;">M</span><span style="color: Gray;">;<br />&nbsp;<br />数据库已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">ALTER</span><span style="color: Gray;"> </span><span style="color: Blue;">DATABASE</span><span style="color: Gray;"> </span><span style="color: Green;">ADD</span><span style="color: Gray;"> </span><span style="color: Blue;">LOGFILE</span><span style="color: Gray;"> </span><span style="color: Green;">GROUP</span><span style="color: Gray;"> </span><span style="color: Maroon;">5</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO05.LOG</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\O</span><span style="color: Red;">RACLE</span><span style="color: Navy;">\P</span><span style="color: Red;">RODUCT</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\O</span><span style="color: Red;">RADATA</span><span style="color: Navy;">\O</span><span style="color: Red;">RALOCAL</span><span style="color: Navy;">\R</span><span style="color: Red;">EDO15.LOG</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">SIZE</span><span style="color: Gray;"> </span><span style="color: Maroon;">50</span><span style="color: #00008b;">M</span><span style="color: Gray;">;<br />&nbsp;<br />数据库已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">ALTER</span><span style="color: Gray;"> </span><span style="color: #00008b;">SYSTEM</span><span style="color: Gray;"> </span><span style="color: Blue;">SWITCH</span><span style="color: Gray;"> </span><span style="color: Blue;">LOGFILE</span><span style="color: Gray;">;<br />&nbsp;<br />系统已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />系统已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />系统已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />系统已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />系统已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">SELECT</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: Blue;">LOGFILE</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">GROUP</span><span style="color: #ffa500;"># STATUS&nbsp; TYPE&nbsp; &nbsp; MEMBER&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IS_</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">-- ------- ------- ------------------------------------------------------------ ---</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO01</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO02</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO03</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO11</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO12</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO13</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO04</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO14</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO05</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO15</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;<br />已选择</span><span style="color: Maroon;">10</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">SELECT</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: Blue;">LOGFILE</span><span style="color: Gray;"> </span><span style="color: Green;">ORDER</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: Maroon;">1</span><span style="color: Gray;">,</span><span style="color: Maroon;">4</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Green;">GROUP</span><span style="color: #ffa500;"># STATUS&nbsp; TYPE&nbsp; &nbsp; MEMBER&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IS_</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">-- ------- ------- ------------------------------------------------------------ ---</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO01</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO11</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO02</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO12</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO03</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO13</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO04</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO14</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO05</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">ONLINE</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">ORACLE</span><span style="color: Gray;">\</span><span style="color: Blue;">PRODUCT</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">ORADATA</span><span style="color: Gray;">\</span><span style="color: Blue;">ORALOCAL</span><span style="color: Gray;">\</span><span style="color: Blue;">REDO15</span><span style="color: Gray;">.</span><span style="color: Blue;">LOG</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NO</span><span style="color: Gray;"><br />&nbsp;<br />已选择</span><span style="color: Maroon;">10</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>4、resource manager的配置：<br />
4.1、配置一个用户，拥有resource manager的administration权限：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage2.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage2.jpg" alt="" title="spximage2" width="500" height="285" class="aligncenter size-full wp-image-1111" /></a><br />
或者直接用语句：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">CREATE</span><span style="color: Gray;"> </span><span style="color: Green;">USER</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">SH</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">PROFILE</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">DEFAULT</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">IDENTIFIED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">SH</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"> </span><span style="color: Blue;">TABLESPACE</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">TBS_TEST</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Green;">TEMPORARY</span><span style="color: Gray;"> </span><span style="color: Blue;">TABLESPACE</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">TEMP</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: Blue;">ACCOUNT</span><span style="color: Gray;"> </span><span style="color: Blue;">UNLOCK</span><span style="color: Gray;"><br /></span><span style="color: Green;">BEGIN</span><span style="color: Gray;"> <br /></span><span style="color: Blue;">dbms_resource_manager_privs</span><span style="color: Gray;">.</span><span style="color: Blue;">grant_system_privilege</span><span style="color: Olive;">(</span><span style="color: Blue;">privilege_name</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">ADMINISTER_RESOURCE_MANAGER</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: Blue;">grantee_name</span><span style="color: Gray;">=&gt;</span><span style="color: #8b0000;">'</span><span style="color: Red;">SH</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: Blue;">admin_option</span><span style="color: Gray;">=&gt;</span><span style="color: Green;">FALSE</span><span style="color: Olive;">)</span><span style="color: Gray;">; <br /></span><span style="color: Green;">END</span><span style="color: Gray;">;</span></div></div>
<p>注意这里的ADMINISTER_RESOURCE_MANAGER system privilege。</p>
<p>4.2、创建2个consumer groups，分别为OLTP和DSS：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage5.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage5.jpg" alt="" title="spximage5" width="500" height="284" class="aligncenter size-full wp-image-1112" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage7.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage7.jpg" alt="" title="spximage7" width="500" height="278" class="aligncenter size-full wp-image-1113" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage9.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage9.jpg" alt="" title="spximage9" width="500" height="241" class="aligncenter size-full wp-image-1114" /></a></p>
<p>4.3、创建一个名为WEEKDAYS的resource plan：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage20.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage20.jpg" alt="" title="spximage20" width="500" height="294" class="aligncenter size-full wp-image-1115" /></a></p>
<p>该resource plan的相关设置：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage10.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage10.jpg" alt="" title="spximage10" width="499" height="262" class="aligncenter size-full wp-image-1116" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage15.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage15.jpg" alt="" title="spximage15" width="500" height="289" class="aligncenter size-full wp-image-1117" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage14.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage14.jpg" alt="" title="spximage14" width="500" height="288" class="aligncenter size-full wp-image-1118" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage17.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage17.jpg" alt="" title="spximage17" width="500" height="286" class="aligncenter size-full wp-image-1119" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage11.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage11.jpg" alt="" title="spximage11" width="500" height="288" class="aligncenter size-full wp-image-1120" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage12.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage12.jpg" alt="" title="spximage12" width="500" height="287" class="aligncenter size-full wp-image-1121" /></a></p>
<p>4.4、将OLTP_USER的默认资源组分配成OLTP，注意转到user界面<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage18.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage18.jpg" alt="" title="spximage18" width="500" height="289" class="aligncenter size-full wp-image-1122" /></a></p>
<p>4.5、将SH的默认资源组分配成DSS：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage19.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage19.jpg" alt="" title="spximage19" width="500" height="271" class="aligncenter size-full wp-image-1123" /></a></p>
<p>4.6、将instance的默认资源计划定位WEEKDAYS：<br />
点Activate this plan<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage22.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/08/spximage22.jpg" alt="" title="spximage22" width="500" height="279" class="aligncenter size-full wp-image-1124" /></a></p>
<p>section2的gc安装配置见<a href="http://www.oracleblog.cn/study-note/install-gc/">《OCM考试-安装grid control》</a></p>
<p>section 3：备份和恢复会用到之前的文件存储路径的冗余，还有之前的rman备份。</p>
<p>section 4：数据仓库管理，主要是物化视图和sqlldr以及external table。<br />
1、建立一个能快速刷新的物化视图，且能去除表中的重复行：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: Blue;">username</span><span style="color: Gray;">,</span><span style="color: Blue;">user_id</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_users</span><span style="color: Gray;">;<br />&nbsp;<br />表已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">insert</span><span style="color: Gray;"> </span><span style="color: Green;">into</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;"> </span><span style="color: Green;">select</span><span style="color: Gray;"> * </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;">;<br />&nbsp;<br />已创建</span><span style="color: Maroon;">18</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />已创建</span><span style="color: Maroon;">36</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />已创建</span><span style="color: Maroon;">72</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">commit</span><span style="color: Gray;">;<br />&nbsp;<br />提交完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">materialized</span><span style="color: Gray;"> </span><span style="color: Green;">view</span><span style="color: Gray;"> </span><span style="color: Blue;">log</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">with</span><span style="color: Gray;"> </span><span style="color: Blue;">rowid</span><span style="color: Gray;">,</span><span style="color: Green;">sequence</span><span style="color: Olive;">(</span><span style="color: Blue;">username</span><span style="color: Gray;">,</span><span style="color: Blue;">user_id</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">including</span><span style="color: Gray;"> </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Green;">values</span><span style="color: Gray;">;<br />&nbsp;<br />实体化视图日志已创建。<br />&nbsp;<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">materialized</span><span style="color: Gray;"> </span><span style="color: Green;">view</span><span style="color: Gray;"> </span><span style="color: Blue;">mv_t1</span><span style="color: Gray;"> </span><span style="color: Blue;">refresh</span><span style="color: Gray;"> </span><span style="color: Blue;">fast</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Green;">commit</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">as</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: Blue;">username</span><span style="color: Gray;">,</span><span style="color: Blue;">user_id</span><span style="color: Gray;">,</span><span style="color: #00008b;">count</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">group</span><span style="color: Gray;"> </span><span style="color: Green;">by</span><span style="color: Gray;"> </span><span style="color: Blue;">username</span><span style="color: Gray;">,</span><span style="color: Blue;">user_id</span><span style="color: Gray;">;<br />&nbsp;<br />实体化视图已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: #00008b;">count</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp; </span><span style="color: #00008b;">COUNT</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">--<br />&nbsp;&nbsp; &nbsp; &nbsp; 144</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: #00008b;">count</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">mv_1</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp; </span><span style="color: #00008b;">COUNT</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">--<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;18</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">user</span><span style="color: Gray;"> </span><span style="color: Blue;">test1</span><span style="color: Gray;"> </span><span style="color: Blue;">identified</span><span style="color: Gray;"> </span><span style="color: Green;">by</span><span style="color: Gray;"> </span><span style="color: Blue;">test1</span><span style="color: Gray;">;<br />&nbsp;<br />用户已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">insert</span><span style="color: Gray;"> </span><span style="color: Green;">into</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;"> </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: Blue;">username</span><span style="color: Gray;">,</span><span style="color: Blue;">user_id</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_users</span><span style="color: Gray;">;<br />&nbsp;<br />已创建</span><span style="color: Maroon;">19</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">commit</span><span style="color: Gray;">;<br />&nbsp;<br />提交完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: #00008b;">count</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp; </span><span style="color: #00008b;">COUNT</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">--<br />&nbsp;&nbsp; &nbsp; &nbsp; 163</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: #00008b;">count</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">mv_1</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp; </span><span style="color: #00008b;">COUNT</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">--<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;19</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>2、建立一个外部表，类型是datapump<br />
（相关知识：Utilities-Part III External Tables）</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Maroon;">2.1</span><span style="color: Gray;">、已经存在了</span><span style="color: Blue;">dmp</span><span style="color: Gray;">文件：</span><span style="color: Blue;">test1</span><span style="color: Gray;">.</span><span style="color: Blue;">t2</span><span style="color: Gray;">.</span><span style="color: Blue;">dmp</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">directory</span><span style="color: Gray;"> </span><span style="color: Blue;">mydir</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">D:</span><span style="color: Navy;">\o</span><span style="color: Red;">racle</span><span style="color: Navy;">\p</span><span style="color: Red;">roduct</span><span style="color: Navy;">\1</span><span style="color: Red;">0.2.0</span><span style="color: Navy;">\d</span><span style="color: Red;">umpdir</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br />&nbsp;<br />目录已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">grant</span><span style="color: Gray;"> </span><span style="color: Green;">read</span><span style="color: Gray;">,</span><span style="color: Green;">write</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">directory</span><span style="color: Gray;"> </span><span style="color: Blue;">mydir</span><span style="color: Gray;"> </span><span style="color: Green;">to</span><span style="color: Gray;"> </span><span style="color: Blue;">test1</span><span style="color: Gray;">;<br />&nbsp;<br />授权成功。<br />&nbsp;<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">x_2</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">USERNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">USER_ID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">PASSWORD</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">ACCOUNT_STATUS</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">32</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">6</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">LOCK_DATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">7</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">EXPIRY_DATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">8</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">DEFAULT_TABLESPACE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp; </span><span style="color: Maroon;">9</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">TEMPORARY_TABLESPACE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">CREATED</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,<br />&nbsp;</span><span style="color: Maroon;">11</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">PROFILE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp;</span><span style="color: Maroon;">12</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">INITIAL_RSRC_CONSUMER_GROUP</span><span style="color: Gray;">&nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp;,<br />&nbsp;</span><span style="color: Maroon;">13</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">EXTERNAL_NAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">4000</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">14</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">15</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">organization</span><span style="color: Gray;"> </span><span style="color: Green;">external</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">16</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: #00008b;">type</span><span style="color: Gray;"> </span><span style="color: Blue;">oracle_datapump</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">17</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">default</span><span style="color: Gray;"> </span><span style="color: Blue;">directory</span><span style="color: Gray;"> </span><span style="color: Blue;">mydir</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">18</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">location</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">test1.t2.dmp</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">19</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br />表已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br /></span><span style="color: Maroon;">2.2</span><span style="color: Gray;">、将</span><span style="color: Green;">select</span><span style="color: Gray;">出来的内容转储到</span><span style="color: Blue;">test1</span><span style="color: Gray;">.</span><span style="color: Blue;">t1</span><span style="color: Gray;">.</span><span style="color: Blue;">dmp</span><span style="color: Gray;">中:<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">x_1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">organization</span><span style="color: Gray;"> </span><span style="color: Green;">external</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: #00008b;">type</span><span style="color: Gray;"> </span><span style="color: Blue;">oracle_datapump</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">default</span><span style="color: Gray;"> </span><span style="color: Blue;">directory</span><span style="color: Gray;"> </span><span style="color: Blue;">mydir</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">location</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">test1.t1.dmp</span><span style="color: #8b0000;">'</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">6</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">7</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">as</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">8</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">select</span><span style="color: Gray;"> * </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">test1</span><span style="color: Gray;">.</span><span style="color: Blue;">t1</span><span style="color: Gray;">;<br />&nbsp;<br />表已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>3、sqlldr的使用（相关知识：Utilities-Part II SQL*Loader）：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Blue;">sqlldr_file</span><span style="color: Gray;">.</span><span style="color: Blue;">dat</span><span style="color: Gray;">的内容：<br /></span><span style="color: Blue;">P</span><span style="color: Gray;">,</span><span style="color: Blue;">James</span><span style="color: Gray;">,</span><span style="color: Maroon;">31</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">P</span><span style="color: Gray;">,</span><span style="color: Blue;">Thomas</span><span style="color: Gray;">,</span><span style="color: Maroon;">22</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">E</span><span style="color: Gray;">,</span><span style="color: Blue;">Pat</span><span style="color: Gray;">,</span><span style="color: Maroon;">38</span><span style="color: Gray;">,</span><span style="color: Maroon;">93645</span><span style="color: Gray;">,</span><span style="color: Maroon;">1122</span><span style="color: Gray;">,</span><span style="color: Blue;">Engineering</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">P</span><span style="color: Gray;">,</span><span style="color: Blue;">Bill</span><span style="color: Gray;">,</span><span style="color: Maroon;">19</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">P</span><span style="color: Gray;">,</span><span style="color: Blue;">Scott</span><span style="color: Gray;">,</span><span style="color: Maroon;">55</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">S</span><span style="color: Gray;">,</span><span style="color: Blue;">Judy</span><span style="color: Gray;">,</span><span style="color: Maroon;">45</span><span style="color: Gray;">,</span><span style="color: Maroon;">27316</span><span style="color: Gray;">,</span><span style="color: Blue;">English</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">S</span><span style="color: Gray;">,</span><span style="color: Blue;">Karen</span><span style="color: Gray;">,</span><span style="color: Maroon;">34</span><span style="color: Gray;">,</span><span style="color: Maroon;">80356</span><span style="color: Gray;">,</span><span style="color: Blue;">History</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">E</span><span style="color: Gray;">,</span><span style="color: Blue;">Karen</span><span style="color: Gray;">,</span><span style="color: Maroon;">61</span><span style="color: Gray;">,</span><span style="color: Maroon;">90056</span><span style="color: Gray;">,</span><span style="color: Maroon;">1323</span><span style="color: Gray;">,</span><span style="color: Blue;">Manufacturing</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">S</span><span style="color: Gray;">,</span><span style="color: Blue;">Pat</span><span style="color: Gray;">,</span><span style="color: Maroon;">29</span><span style="color: Gray;">,</span><span style="color: Maroon;">98625</span><span style="color: Gray;">,</span><span style="color: Blue;">Spanish</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">S</span><span style="color: Gray;">,</span><span style="color: Blue;">Cody</span><span style="color: Gray;">,</span><span style="color: Maroon;">22</span><span style="color: Gray;">,</span><span style="color: Maroon;">99743</span><span style="color: Gray;">,</span><span style="color: Blue;">Math</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">P</span><span style="color: Gray;">,</span><span style="color: Blue;">Ted</span><span style="color: Gray;">,</span><span style="color: Maroon;">43</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">E</span><span style="color: Gray;">,</span><span style="color: Blue;">Judy</span><span style="color: Gray;">,</span><span style="color: Maroon;">44</span><span style="color: Gray;">,</span><span style="color: Maroon;">87616</span><span style="color: Gray;">,</span><span style="color: Maroon;">1544</span><span style="color: Gray;">,</span><span style="color: Blue;">Accounting</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">E</span><span style="color: Gray;">,</span><span style="color: Blue;">Bob</span><span style="color: Gray;">,</span><span style="color: Maroon;">50</span><span style="color: Gray;">,</span><span style="color: Maroon;">63421</span><span style="color: Gray;">,</span><span style="color: Maroon;">1314</span><span style="color: Gray;">,</span><span style="color: Blue;">Shipping</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">S</span><span style="color: Gray;">,</span><span style="color: Blue;">Bob</span><span style="color: Gray;">,</span><span style="color: Maroon;">32</span><span style="color: Gray;">,</span><span style="color: Maroon;">67420</span><span style="color: Gray;">,</span><span style="color: Blue;">Psychology</span><span style="color: Gray;">, <br /></span><span style="color: Blue;">E</span><span style="color: Gray;">,</span><span style="color: Blue;">Cody</span><span style="color: Gray;">,</span><span style="color: Maroon;">33</span><span style="color: Gray;">,</span><span style="color: Maroon;">25143</span><span style="color: Gray;">,</span><span style="color: Maroon;">1002</span><span style="color: Gray;">,</span><span style="color: Blue;">Human</span><span style="color: Gray;"> </span><span style="color: Blue;">Resources</span><span style="color: Gray;">,<br />&nbsp;<br />建立一个控制文件</span><span style="color: Blue;">sqlldr</span><span style="color: Gray;">.</span><span style="color: Blue;">ctl</span><span style="color: Gray;"><br /></span><span style="color: Blue;">load</span><span style="color: Gray;"> </span><span style="color: Green;">data</span><span style="color: Gray;"><br /></span><span style="color: Blue;">infile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">sqlldr_file</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Blue;">append</span><span style="color: Gray;"> </span><span style="color: Green;">into</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">sqlldr_test</span><span style="color: Gray;"><br /></span><span style="color: Green;">TRAILING</span><span style="color: Gray;"> </span><span style="color: Blue;">NULLCOLS</span><span style="color: Gray;"><br /></span><span style="color: Olive;">(</span><span style="color: Blue;">col1</span><span style="color: Gray;"> </span><span style="color: Green;">CHAR</span><span style="color: Gray;"> </span><span style="color: Blue;">TERMINATED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,<br /></span><span style="color: Blue;">col2</span><span style="color: Gray;"> </span><span style="color: Green;">CHAR</span><span style="color: Gray;"> </span><span style="color: Blue;">TERMINATED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,<br /></span><span style="color: Blue;">col3</span><span style="color: Gray;"> </span><span style="color: Green;">INTEGER</span><span style="color: Gray;"> </span><span style="color: Green;">EXTERNAL</span><span style="color: Gray;"> </span><span style="color: Blue;">TERMINATED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,<br /></span><span style="color: Blue;">col4</span><span style="color: Gray;"> </span><span style="color: Green;">INTEGER</span><span style="color: Gray;"> </span><span style="color: Green;">EXTERNAL</span><span style="color: Gray;"> </span><span style="color: Blue;">TERMINATED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,<br /></span><span style="color: Blue;">col5</span><span style="color: Gray;"> </span><span style="color: Green;">INTEGER</span><span style="color: Gray;"> </span><span style="color: Green;">EXTERNAL</span><span style="color: Gray;"> </span><span style="color: Blue;">TERMINATED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">,<br /></span><span style="color: Blue;">col6</span><span style="color: Gray;"> </span><span style="color: Green;">CHAR</span><span style="color: Gray;"> </span><span style="color: Blue;">TERMINATED</span><span style="color: Gray;"> </span><span style="color: Green;">BY</span><span style="color: Gray;"> </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">,</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"><br /></span><span style="color: Olive;">)</span><span style="color: Gray;"> <br />&nbsp;<br />注意因为有几行的数据只有</span><span style="color: Maroon;">3</span><span style="color: Gray;">列</span><span style="color: Blue;">columns</span><span style="color: Gray;">，有些有</span><span style="color: Maroon;">6</span><span style="color: Gray;">列；对于不到</span><span style="color: Maroon;">6</span><span style="color: Gray;">列的行，后面的几列必须制定</span><span style="color: Blue;">tailing</span><span style="color: Gray;"> </span><span style="color: Blue;">nullcols</span><span style="color: Gray;">，用</span><span style="color: Green;">null</span><span style="color: Gray;">来补齐<br />&nbsp;<br /></span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">oracle</span><span style="color: Gray;">\</span><span style="color: Blue;">product</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">dumpdir</span><span style="color: Gray;">&gt;</span><span style="color: Blue;">sqlldr</span><span style="color: Gray;"> </span><span style="color: Blue;">test</span><span style="color: Gray;">/</span><span style="color: Blue;">test</span><span style="color: Gray;"> </span><span style="color: Blue;">control</span><span style="color: Gray;">=</span><span style="color: Blue;">sqlldr</span><span style="color: Gray;">.</span><span style="color: Blue;">ctl</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">*</span><span style="color: Blue;">Loader</span><span style="color: Gray;">: </span><span style="color: Blue;">Release</span><span style="color: Gray;"> </span><span style="color: Maroon;">10.2.0.1.0</span><span style="color: Gray;"> - </span><span style="color: Blue;">Production</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> 星期四 </span><span style="color: Maroon;">8</span><span style="color: Gray;">月 </span><span style="color: Maroon;">12</span><span style="color: Gray;"> </span><span style="color: Maroon;">23</span><span style="color: Gray;">:</span><span style="color: Maroon;">52</span><span style="color: Gray;">:</span><span style="color: Maroon;">00</span><span style="color: Gray;"> </span><span style="color: Maroon;">2010</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Blue;">Copyright</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: #00008b;">c</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Maroon;">1982</span><span style="color: Gray;">, </span><span style="color: Maroon;">2005</span><span style="color: Gray;">, </span><span style="color: Blue;">Oracle</span><span style="color: Gray;">.&nbsp; </span><span style="color: Green;">All</span><span style="color: Gray;"> </span><span style="color: Blue;">rights</span><span style="color: Gray;"> </span><span style="color: Blue;">reserved</span><span style="color: Gray;">.<br />&nbsp;<br />达到提交点 - 逻辑记录计数 </span><span style="color: Maroon;">14</span><span style="color: Gray;"><br />达到提交点 - 逻辑记录计数 </span><span style="color: Maroon;">15</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Blue;">D</span><span style="color: Gray;">:\</span><span style="color: Blue;">oracle</span><span style="color: Gray;">\</span><span style="color: Blue;">product</span><span style="color: Gray;">\</span><span style="color: Maroon;">10.2.0</span><span style="color: Gray;">\</span><span style="color: Blue;">dumpdir</span><span style="color: Gray;">&gt;</span></div></div>
<p>section 5:数据库管理<br />
1、表空间传输(相关知识：Administrator&#8217;s Guide-8 Managing Tablespaces-Transporting Tablespaces Between Databases-Example)</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">t4trans</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/t4trans.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">5</span><span style="color: #00008b;">m</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">test</span><span style="color: Gray;">.</span><span style="color: Blue;">ttt</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">t4trans</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: Green;">select</span><span style="color: Gray;"> * </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_users</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Green;">Table</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">t4trans</span><span style="color: Gray;"> </span><span style="color: Green;">read</span><span style="color: Gray;"> </span><span style="color: Green;">only</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">altered</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">exec</span><span style="color: Gray;"> </span><span style="color: Blue;">dbms_tts</span><span style="color: Gray;">.</span><span style="color: Blue;">TRANSPORT_SET_CHECK</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">T4TRANS</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Green;">true</span><span style="color: Gray;">,</span><span style="color: Green;">true</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">PL</span><span style="color: Gray;">/</span><span style="color: Green;">SQL</span><span style="color: Gray;"> </span><span style="color: Green;">procedure</span><span style="color: Gray;"> </span><span style="color: Blue;">successfully</span><span style="color: Gray;"> </span><span style="color: Blue;">completed</span><span style="color: Gray;">.<br />[</span><span style="color: Blue;">oracle</span><span style="color: Gray;">@</span><span style="color: Blue;">ocmdb1</span><span style="color: Gray;"> ~]$ </span><span style="color: Blue;">cp</span><span style="color: Gray;"> /</span><span style="color: Blue;">oracle</span><span style="color: Gray;">/</span><span style="color: Blue;">app</span><span style="color: Gray;">/</span><span style="color: Blue;">oracle</span><span style="color: Gray;">/</span><span style="color: Blue;">oradata</span><span style="color: Gray;">/</span><span style="color: Blue;">ocmdb</span><span style="color: Gray;">/</span><span style="color: Blue;">dfile</span><span style="color: Gray;">/</span><span style="color: Blue;">t4trans</span><span style="color: Gray;">.</span><span style="color: Blue;">dbf</span><span style="color: Gray;"> /</span><span style="color: Blue;">oracle</span><span style="color: Gray;">/</span><span style="color: Blue;">app</span><span style="color: Gray;">/</span><span style="color: Blue;">oracle</span><span style="color: Gray;">/</span><span style="color: Blue;">oradata</span><span style="color: Gray;">/</span><span style="color: Blue;">ocmgc</span><span style="color: Gray;">/</span><span style="color: Blue;">dfile</span><span style="color: Gray;">/</span><span style="color: Blue;">t4trans</span><span style="color: Gray;">.</span><span style="color: Blue;">dbf</span><span style="color: Gray;"><br />[</span><span style="color: Blue;">oracle</span><span style="color: Gray;">@</span><span style="color: Blue;">ocmdb1</span><span style="color: Gray;"> ~]$ <br />[</span><span style="color: Blue;">oracle</span><span style="color: Gray;">@</span><span style="color: Blue;">ocmdb1</span><span style="color: Gray;"> ~]$ </span><span style="color: Blue;">imp</span><span style="color: Gray;"> </span><span style="color: Blue;">userid</span><span style="color: Gray;">=\</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">/ as sysdba</span><span style="color: Navy;">\&quot;</span><span style="color: Red;"> file=tbs_t4trans.dmp TTS_OWNERS=test TRANSPORT_TABLESPACE=y TABLESPACES=t4trans DATAFILES=/oracle/app/oracle/oradata/ocmgc/dfile/t4trans.dbf fromuser=test touser=test1;<br />&nbsp;<br />Import: Release 10.2.0.2.0 - Production on Thu Aug 12 20:59:34 2010<br />&nbsp;<br />Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<br />&nbsp;<br />&nbsp;<br />Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production<br />With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options<br />&nbsp;<br />Export file created by EXPORT:V10.02.01 via conventional path<br />About to import transportable tablespace(s) metadata...<br />import done in ZHS16GBK character set and AL16UTF16 NCHAR character set<br />import server uses US7ASCII character set (possible charset conversion)<br />. importing TEST's objects into TEST1<br />. . importing table&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #8b0000;">&quot;</span><span style="color: Blue;">TTT</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"><br />Import terminated successfully without warnings.<br />[oracle@ocmdb1 ~]$ <br />&nbsp;<br />SQL&gt; <br />SQL&gt; <br />SQL&gt; <br />SQL&gt; <br />SQL&gt; select * from transport_set_violations;<br />&nbsp;<br />no rows selected<br />&nbsp;<br />SQL&gt;&nbsp; exit<br />Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production<br />With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options<br />[oracle@ocmdb1 ~]$ <br />[oracle@ocmdb1 ~]$ <br />[oracle@ocmdb1 ~]$ exp userid=</span><span style="color: Navy;">\&quot;</span><span style="color: Red;">/ as sysdba</span><span style="color: Navy;">\&quot;</span><span style="color: Red;"> TRANSPORT_TABLESPACE=y TABLESPACES=(t4trans) file=tbs_t4trans.dmp<br />&nbsp;<br />Export: Release 10.2.0.2.0 - Production on Thu Aug 12 20:12:45 2010<br />&nbsp;<br />Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<br />&nbsp;<br />&nbsp;<br />Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production<br />With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options<br />Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set<br />server uses US7ASCII character set (possible charset conversion)<br />Note: table data (rows) will not be exported<br />About to export transportable tablespace metadata...<br />For tablespace T4TRANS ...<br />. exporting cluster definitions<br />. exporting table definitions<br />. . exporting table&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TTT<br />. exporting referential integrity constraints<br />. exporting triggers<br />. end transportable tablespace metadata export<br />Export terminated successfully without warnings.<br />[oracle@ocmdb1 ~]$</span></div></div>
<p>2、打开一个表上所有的索引监控(相关知识：Administrator&#8217;s Guide-16 Managing Indexes-Monitoring Index Usage)：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">or</span><span style="color: Gray;"> </span><span style="color: Blue;">replace</span><span style="color: Gray;"> </span><span style="color: Green;">procedure</span><span style="color: Gray;"> </span><span style="color: Blue;">pro_monitor_index</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">as</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">idx_name</span><span style="color: Gray;"> </span><span style="color: Blue;">varchar2</span><span style="color: Olive;">(</span><span style="color: Maroon;">20</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">cursor</span><span style="color: Gray;"> </span><span style="color: Blue;">c1</span><span style="color: Gray;"> </span><span style="color: Green;">is</span><span style="color: Gray;"> </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: Blue;">index_name</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">user_indexes</span><span style="color: Gray;"> </span><span style="color: Green;">where</span><span style="color: Gray;"> </span><span style="color: #00008b;">table_name</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">TEST_1</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br />&nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">begin</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">6</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">open</span><span style="color: Gray;"> </span><span style="color: Blue;">c1</span><span style="color: Gray;">;<br />&nbsp; </span><span style="color: Maroon;">7</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">loop</span><span style="color: Gray;"> </span><span style="color: Green;">fetch</span><span style="color: Gray;"> </span><span style="color: Blue;">c1</span><span style="color: Gray;"> </span><span style="color: Green;">into</span><span style="color: Gray;"> </span><span style="color: Blue;">idx_name</span><span style="color: Gray;">;<br />&nbsp; </span><span style="color: Maroon;">8</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">if</span><span style="color: Gray;"> </span><span style="color: Blue;">c1</span><span style="color: Gray;">%</span><span style="color: Green;">found</span><span style="color: Gray;"> </span><span style="color: Green;">then</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">9</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">execute</span><span style="color: Gray;"> </span><span style="color: Green;">immediate</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">alter index </span><span style="color: #8b0000;">'</span><span style="color: Gray;">||</span><span style="color: Blue;">idx_name</span><span style="color: Gray;">||</span><span style="color: #8b0000;">'</span><span style="color: Red;"> monitoring usage</span><span style="color: #8b0000;">'</span><span style="color: Gray;">;<br />&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">else</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">11</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">exit</span><span style="color: Gray;">;<br />&nbsp;</span><span style="color: Maroon;">12</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">end</span><span style="color: Gray;"> </span><span style="color: Blue;">if</span><span style="color: Gray;">;<br />&nbsp;</span><span style="color: Maroon;">13</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">end</span><span style="color: Gray;"> </span><span style="color: Blue;">loop</span><span style="color: Gray;">;<br />&nbsp;</span><span style="color: Maroon;">14</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">close</span><span style="color: Gray;"> </span><span style="color: Blue;">c1</span><span style="color: Gray;">;<br />&nbsp;</span><span style="color: Maroon;">15</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">end</span><span style="color: Gray;">;<br />&nbsp;</span><span style="color: Maroon;">16</span><span style="color: Gray;">&nbsp; /<br />&nbsp;<br /></span><span style="color: Green;">Procedure</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">exec</span><span style="color: Gray;"> </span><span style="color: Blue;">pro_monitor_index</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">PL</span><span style="color: Gray;">/</span><span style="color: Green;">SQL</span><span style="color: Gray;"> </span><span style="color: Green;">procedure</span><span style="color: Gray;"> </span><span style="color: Blue;">successfully</span><span style="color: Gray;"> </span><span style="color: Blue;">completed</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">select</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: Blue;">OBJECT_USAGE</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Blue;">INDEX_NAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">TABLE_NAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">MONITO</span><span style="color: Gray;"> </span><span style="color: Blue;">USED</span><span style="color: Gray;">&nbsp; &nbsp;</span><span style="color: Blue;">START_MONITORING</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">END_MONITORING</span><span style="color: Gray;"><br />------------------</span><span style="color: #ffa500;">-- -------------------- ------ ------ ------------------------------ --------------------------------------</span><span style="color: Gray;"><br /></span><span style="color: Blue;">IDX_ID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">TEST_1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">YES</span><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">YES</span><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Maroon;">08</span><span style="color: Gray;">/</span><span style="color: Maroon;">12</span><span style="color: Gray;">/</span><span style="color: Maroon;">2010</span><span style="color: Gray;"> </span><span style="color: Maroon;">23</span><span style="color: Gray;">:</span><span style="color: Maroon;">02</span><span style="color: Gray;">:</span><span style="color: Maroon;">09</span><span style="color: Gray;"><br /></span><span style="color: Blue;">IDX_LAST_DDL_TIME</span><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Blue;">TEST_1</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">YES</span><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Green;">NO</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Maroon;">08</span><span style="color: Gray;">/</span><span style="color: Maroon;">12</span><span style="color: Gray;">/</span><span style="color: Maroon;">2010</span><span style="color: Gray;"> </span><span style="color: Maroon;">23</span><span style="color: Gray;">:</span><span style="color: Maroon;">02</span><span style="color: Gray;">:</span><span style="color: Maroon;">11</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>3、建立分区表(相关知识： SQL Reference-CREATE INDEX)：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: #00008b;">system</span><span style="color: Gray;"> </span><span style="color: Green;">set</span><span style="color: Gray;"> </span><span style="color: Blue;">db_16k_cache_size</span><span style="color: Gray;">=</span><span style="color: Maroon;">200</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Green;">scope</span><span style="color: Gray;">=</span><span style="color: Blue;">spfile</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: #00008b;">System</span><span style="color: Gray;"> </span><span style="color: Blue;">altered</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">startup</span><span style="color: Gray;"> </span><span style="color: Blue;">force</span><span style="color: Gray;"><br /></span><span style="color: Blue;">ORACLE</span><span style="color: Gray;"> </span><span style="color: #00008b;">instance</span><span style="color: Gray;"> </span><span style="color: Blue;">started</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Blue;">Total</span><span style="color: Gray;"> </span><span style="color: #00008b;">System</span><span style="color: Gray;"> </span><span style="color: Green;">Global</span><span style="color: Gray;"> </span><span style="color: Blue;">Area</span><span style="color: Gray;">&nbsp; </span><span style="color: Maroon;">314572800</span><span style="color: Gray;"> </span><span style="color: Blue;">bytes</span><span style="color: Gray;"><br /></span><span style="color: Blue;">Fixed</span><span style="color: Gray;"> </span><span style="color: Green;">Size</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">1260612</span><span style="color: Gray;"> </span><span style="color: Blue;">bytes</span><span style="color: Gray;"><br /></span><span style="color: Green;">Variable</span><span style="color: Gray;"> </span><span style="color: Green;">Size</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">62915516</span><span style="color: Gray;"> </span><span style="color: Blue;">bytes</span><span style="color: Gray;"><br /></span><span style="color: Blue;">Database</span><span style="color: Gray;"> </span><span style="color: Blue;">Buffers</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">247463936</span><span style="color: Gray;"> </span><span style="color: Blue;">bytes</span><span style="color: Gray;"><br /></span><span style="color: Blue;">Redo</span><span style="color: Gray;"> </span><span style="color: Blue;">Buffers</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2932736</span><span style="color: Gray;"> </span><span style="color: Blue;">bytes</span><span style="color: Gray;"><br /></span><span style="color: Blue;">Database</span><span style="color: Gray;"> </span><span style="color: Blue;">mounted</span><span style="color: Gray;">.<br /></span><span style="color: Blue;">Database</span><span style="color: Gray;"> </span><span style="color: Blue;">opened</span><span style="color: Gray;">.<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data01</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data01.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">32</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Blue;">blocksize</span><span style="color: Gray;"> </span><span style="color: Maroon;">16</span><span style="color: #00008b;">k</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">uniform</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: #00008b;">m</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data02</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data02.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">32</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Blue;">blocksize</span><span style="color: Gray;"> </span><span style="color: Maroon;">16</span><span style="color: #00008b;">k</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">uniform</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: #00008b;">m</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data02</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data02.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: #00008b;">c</span><span style="color: Gray;">/</span><span style="color: Maroon;">02</span><span style="color: Gray;">/</span><span style="color: Maroon;">03</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data03</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data02.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: #00008b;">c</span><span style="color: Gray;">/</span><span style="color: Maroon;">02</span><span style="color: Gray;">/</span><span style="color: Maroon;">03</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data03</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data03.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data03</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data03.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">32</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Blue;">blocksize</span><span style="color: Gray;"> </span><span style="color: Maroon;">16</span><span style="color: #00008b;">k</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">* </span><span style="color: Blue;">uniform</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: #00008b;">m</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data03</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data03.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: #00008b;">c</span><span style="color: Gray;">/</span><span style="color: Maroon;">03</span><span style="color: Gray;">/</span><span style="color: Maroon;">04</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data04</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data03.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: #00008b;">c</span><span style="color: Gray;">/</span><span style="color: Maroon;">03</span><span style="color: Gray;">/</span><span style="color: Maroon;">04</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data04</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data04.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data04</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data04.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">32</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Blue;">blocksize</span><span style="color: Gray;"> </span><span style="color: Maroon;">16</span><span style="color: #00008b;">k</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">* </span><span style="color: Blue;">uniform</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: #00008b;">m</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data04</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data04.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: #00008b;">c</span><span style="color: Gray;">/</span><span style="color: Maroon;">04</span><span style="color: Gray;">/</span><span style="color: Maroon;">05</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data05</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data04.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: #00008b;">c</span><span style="color: Gray;">/</span><span style="color: Maroon;">04</span><span style="color: Gray;">/</span><span style="color: Maroon;">05</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data05</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data05.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data05</span><span style="color: Gray;"> </span><span style="color: Blue;">datafile</span><span style="color: Gray;"> </span><span style="color: #8b0000;">'</span><span style="color: Red;">/oracle/app/oracle/oradata/ocmdb/dfile/data05.dbf</span><span style="color: #8b0000;">'</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">32</span><span style="color: #00008b;">m</span><span style="color: Gray;"> </span><span style="color: Blue;">blocksize</span><span style="color: Gray;"> </span><span style="color: Maroon;">16</span><span style="color: #00008b;">k</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">* </span><span style="color: Blue;">uniform</span><span style="color: Gray;"> </span><span style="color: Green;">size</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: #00008b;">m</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Blue;">Tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">conn</span><span style="color: Gray;"> </span><span style="color: Blue;">sh</span><span style="color: Gray;">/</span><span style="color: Blue;">sh</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /></span><span style="color: Blue;">Connected</span><span style="color: Gray;">.<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">sales_history</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Blue;">id</span><span style="color: Gray;"> </span><span style="color: #00008b;">number</span><span style="color: Olive;">(</span><span style="color: Maroon;">5</span><span style="color: Olive;">)</span><span style="color: Gray;">,<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">salesman_name</span><span style="color: Gray;"> </span><span style="color: Blue;">varchar2</span><span style="color: Olive;">(</span><span style="color: Maroon;">20</span><span style="color: Olive;">)</span><span style="color: Gray;">,<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">sales_date</span><span style="color: Gray;"> </span><span style="color: Green;">date</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Green;">by</span><span style="color: Gray;"> </span><span style="color: Blue;">range</span><span style="color: Olive;">(</span><span style="color: Blue;">sales_date</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">6</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p1</span><span style="color: Gray;"> </span><span style="color: Green;">values</span><span style="color: Gray;"> </span><span style="color: Green;">less</span><span style="color: Gray;"> </span><span style="color: Green;">than</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">to_date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">1999-01-01</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">yyyy-mm-dd</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data01</span><span style="color: Gray;">,<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">7</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p2</span><span style="color: Gray;"> </span><span style="color: Green;">values</span><span style="color: Gray;"> </span><span style="color: Green;">less</span><span style="color: Gray;"> </span><span style="color: Green;">than</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">to_date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">2000-01-01</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">yyyy-mm-dd</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data02</span><span style="color: Gray;">,<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">8</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p3</span><span style="color: Gray;"> </span><span style="color: Green;">values</span><span style="color: Gray;"> </span><span style="color: Green;">less</span><span style="color: Gray;"> </span><span style="color: Green;">than</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">to_date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">2001-01-01</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">yyyy-mm-dd</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data03</span><span style="color: Gray;">,<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Maroon;">9</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p4</span><span style="color: Gray;"> </span><span style="color: Green;">values</span><span style="color: Gray;"> </span><span style="color: Green;">less</span><span style="color: Gray;"> </span><span style="color: Green;">than</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">to_date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">2002-01-01</span><span style="color: #8b0000;">'</span><span style="color: Gray;">, </span><span style="color: #8b0000;">'</span><span style="color: Red;">yyyy-mm-dd</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data04</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">10</span><span style="color: Gray;">* </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p5</span><span style="color: Gray;"> </span><span style="color: Green;">values</span><span style="color: Gray;"> </span><span style="color: Green;">less</span><span style="color: Gray;"> </span><span style="color: Green;">than</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">to_date</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">2003-01-01</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">yyyy-mm-dd</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">data05</span><span style="color: Olive;">)</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Green;">Table</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; <br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"> </span><span style="color: Blue;">pk_id</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">sales_history</span><span style="color: Olive;">(</span><span style="color: Blue;">id</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">global</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Green;">by</span><span style="color: Gray;"> </span><span style="color: Blue;">hash</span><span style="color: Olive;">(</span><span style="color: Blue;">id</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Blue;">parallel</span><span style="color: Gray;"> </span><span style="color: Maroon;">4</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">Index</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"> </span><span style="color: Blue;">id_name</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">sales_history</span><span style="color: Olive;">(</span><span style="color: Blue;">SALESMAN_NAME</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">local</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">Index</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"> </span><span style="color: Blue;">idx_date</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">sales_history</span><span style="color: Olive;">(</span><span style="color: Blue;">SALES_DATE</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">global</span><span style="color: Gray;"> </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Green;">by</span><span style="color: Gray;"> </span><span style="color: Blue;">hash</span><span style="color: Olive;">(</span><span style="color: Blue;">SALES_DATE</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p1</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p2</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">partition</span><span style="color: Gray;"> </span><span style="color: Blue;">p3</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">Index</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>4、建立带LOB字段表（相关知识： SQL Reference-CREATE TABLE-LOB_storage_clause::=和LOB Column Example）：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">MAGAZINE_ARTICLES</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">AUTHOR</span><span style="color: Gray;"> </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">ARTICLE_NAME</span><span style="color: Gray;"> </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">50</span><span style="color: Olive;">)</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">ARTICLE_DATE</span><span style="color: Gray;"> </span><span style="color: Green;">DATE</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">6</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">ARTICLE_DATA</span><span style="color: Gray;"> </span><span style="color: Green;">CLOB</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">TBS_1</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">7</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">LOB</span><span style="color: Olive;">(</span><span style="color: Blue;">ARTICLE_DATA</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">8</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">store</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Olive;">(</span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">TBS_2</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">9</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">disable</span><span style="color: Gray;"> </span><span style="color: Blue;">storage</span><span style="color: Gray;"> </span><span style="color: Green;">in</span><span style="color: Gray;"> </span><span style="color: Green;">row</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">chunk</span><span style="color: Gray;"> </span><span style="color: Maroon;">16</span><span style="color: #00008b;">k</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">11</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">nocache</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">12</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Green;">Table</span><span style="color: Gray;"> </span><span style="color: Blue;">created</span><span style="color: Gray;">.<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>5、FGA审计（相关知识 PL/SQL Packages and Types Reference-40 DBMS_FGA-ADD_POLICY Procedure)：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">DESC</span><span style="color: Gray;"> </span><span style="color: Blue;">TEST</span><span style="color: Gray;">.</span><span style="color: Blue;">T2</span><span style="color: Gray;"><br />&nbsp;名称&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 是否为空? 类型<br />&nbsp;---------------------------------------</span><span style="color: #ffa500;">-- -------- ----------------------------</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">USERNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">NOT</span><span style="color: Gray;"> </span><span style="color: Green;">NULL</span><span style="color: Gray;"> </span><span style="color: Blue;">VARCHAR2</span><span style="color: Olive;">(</span><span style="color: Maroon;">30</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">USER_ID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">NOT</span><span style="color: Gray;"> </span><span style="color: Green;">NULL</span><span style="color: Gray;"> </span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">exec</span><span style="color: Gray;"> </span><span style="color: Blue;">dbms_fga</span><span style="color: Gray;">.</span><span style="color: Blue;">ADD_POLICY</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">TEST</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">T2</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">AUD_T2</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">USER_ID&gt;=3</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">USER_ID,USERNAME</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Green;">NULL</span><span style="color: Gray;">,</span><span style="color: Green;">NULL</span><span style="color: Gray;">,</span><span style="color: Green;">TRUE</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">INSERT, UPDATE, DELET<br />E</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">DBMS_FGA</span><span style="color: Gray;">.</span><span style="color: Blue;">XML</span><span style="color: Gray;">+</span><span style="color: Blue;">DBMS_FGA</span><span style="color: Gray;">.</span><span style="color: Blue;">EXTENDED</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">PL</span><span style="color: Gray;">/</span><span style="color: Green;">SQL</span><span style="color: Gray;"> 过程已成功完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">CONN</span><span style="color: Gray;"> </span><span style="color: Blue;">TEST</span><span style="color: Gray;">/</span><span style="color: Blue;">TEST</span><span style="color: Gray;"><br />已连接。<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">SELECT</span><span style="color: Gray;"> </span><span style="color: #00008b;">COUNT</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Green;">FROM</span><span style="color: Gray;"> </span><span style="color: Blue;">T2</span><span style="color: Gray;">;<br />&nbsp;<br />&nbsp; </span><span style="color: #00008b;">COUNT</span><span style="color: Olive;">(</span><span style="color: Gray;">*</span><span style="color: Olive;">)</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">--<br />&nbsp;&nbsp; &nbsp; &nbsp; 220</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">UPDATE</span><span style="color: Gray;"> </span><span style="color: Blue;">T2</span><span style="color: Gray;"> </span><span style="color: Green;">SET</span><span style="color: Gray;"> </span><span style="color: Blue;">USERNAME</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">ASASAS</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">WHERE</span><span style="color: Gray;"> </span><span style="color: Blue;">USER_ID</span><span style="color: Gray;">&gt;</span><span style="color: Maroon;">6</span><span style="color: Gray;">;<br />&nbsp;<br />已更新</span><span style="color: Maroon;">196</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">UPDATE</span><span style="color: Gray;"> </span><span style="color: Blue;">T2</span><span style="color: Gray;"> </span><span style="color: Green;">SET</span><span style="color: Gray;"> </span><span style="color: Blue;">USERNAME</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">QQWW</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">WHERE</span><span style="color: Gray;"> </span><span style="color: Blue;">USER_ID</span><span style="color: Gray;">&lt;</span><span style="color: Maroon;">2</span><span style="color: Gray;">;<br />&nbsp;<br />已更新</span><span style="color: Maroon;">12</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">COMMIT</span><span style="color: Gray;">;<br />&nbsp;<br />提交完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">L</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">* </span><span style="color: Green;">SELECT</span><span style="color: Gray;"> </span><span style="color: Blue;">SESSION_ID</span><span style="color: Gray;">,</span><span style="color: Blue;">AUDIT_TYPE</span><span style="color: Gray;">,</span><span style="color: Blue;">EXTENDED_TIMESTAMP</span><span style="color: Gray;">,</span><span style="color: Blue;">SQL_TEXT</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: Blue;">XML_AUDIT_TRAIL</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br /></span><span style="color: Blue;">SESSION_ID</span><span style="color: Gray;"> </span><span style="color: Blue;">AUDIT_TYPE</span><span style="color: Gray;"> </span><span style="color: Blue;">EXTENDED_TIMESTAMP</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">SQL_TEXT</span><span style="color: Gray;"><br />--------</span><span style="color: #ffa500;">-- ---------- ---------------------------------------- --------------------------------------------------</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">189</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;"> </span><span style="color: Maroon;">18</span><span style="color: Gray;">-</span><span style="color: Maroon;">8</span><span style="color: Gray;">月 -</span><span style="color: Maroon;">10</span><span style="color: Gray;"> </span><span style="color: Maroon;">11.32.09.879000</span><span style="color: Gray;"> 下午 +</span><span style="color: Maroon;">08</span><span style="color: Gray;">:</span><span style="color: Maroon;">00</span><span style="color: Gray;">&nbsp; &nbsp;</span><span style="color: Green;">UPDATE</span><span style="color: Gray;"> </span><span style="color: Blue;">T2</span><span style="color: Gray;"> </span><span style="color: Green;">SET</span><span style="color: Gray;"> </span><span style="color: Blue;">USERNAME</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">ASASAS</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">WHERE</span><span style="color: Gray;"> </span><span style="color: Blue;">USER_ID</span><span style="color: Gray;">&gt;</span><span style="color: Maroon;">6</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br />&nbsp;<br />或者：<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">exec</span><span style="color: Gray;"> </span><span style="color: Blue;">dbms_fga</span><span style="color: Gray;">.</span><span style="color: Blue;">ADD_POLICY</span><span style="color: Olive;">(</span><span style="color: #8b0000;">'</span><span style="color: Red;">TEST</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">T2</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">AUD_T2</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">USER_ID&gt;=3</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">USER_ID,USERNAME</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Green;">NULL</span><span style="color: Gray;">,</span><span style="color: Green;">NULL</span><span style="color: Gray;">,</span><span style="color: Green;">TRUE</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">INSERT, UPDATE, DELET<br />E</span><span style="color: #8b0000;">'</span><span style="color: Gray;">,</span><span style="color: Blue;">DBMS_FGA</span><span style="color: Gray;">.</span><span style="color: Blue;">DB</span><span style="color: Gray;">+</span><span style="color: Blue;">DBMS_FGA</span><span style="color: Gray;">.</span><span style="color: Blue;">EXTENDED</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">PL</span><span style="color: Gray;">/</span><span style="color: Green;">SQL</span><span style="color: Gray;"> 过程已成功完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">conn</span><span style="color: Gray;"> </span><span style="color: Blue;">test</span><span style="color: Gray;">/</span><span style="color: Blue;">test</span><span style="color: Gray;"><br />已连接。<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">UPDATE</span><span style="color: Gray;"> </span><span style="color: Blue;">T2</span><span style="color: Gray;"> </span><span style="color: Green;">SET</span><span style="color: Gray;"> </span><span style="color: Blue;">USERNAME</span><span style="color: Gray;">=</span><span style="color: #8b0000;">'</span><span style="color: Red;">test3</span><span style="color: #8b0000;">'</span><span style="color: Gray;"> </span><span style="color: Green;">WHERE</span><span style="color: Gray;"> </span><span style="color: Blue;">USER_ID</span><span style="color: Gray;">=</span><span style="color: Maroon;">5</span><span style="color: Gray;">;<br />&nbsp;<br />已更新</span><span style="color: Maroon;">12</span><span style="color: Gray;">行。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">COMMIT</span><span style="color: Gray;">;<br />&nbsp;<br />提交完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">conn</span><span style="color: Gray;"> / </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: Blue;">sysdba</span><span style="color: Gray;"><br />已连接。<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">select</span><span style="color: Gray;"> </span><span style="color: Blue;">sql_text</span><span style="color: Gray;"> </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_fga_audit_trail</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">SQL_TEXT</span><span style="color: Gray;"><br />------------------------------------------------</span><span style="color: #ffa500;">--<br />UPDATE T2 SET USERNAME='test3' WHERE USER_ID=5</span><span style="color: Gray;"><br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>section 6:数据库性能管理<br />
1、创建IOT表(相关知识：Administrator&#8217;s Guide-Managing tables-Creating an Index-Organized Table 或者 SQL Reference-CREATE  TABLE-Index-Organized Table Example )：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Blue;">l</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">1</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">test_iot</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">2</span><span style="color: Gray;">&nbsp; </span><span style="color: Olive;">(</span><span style="color: Blue;">a</span><span style="color: Gray;"> </span><span style="color: #00008b;">number</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">3</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">b</span><span style="color: Gray;"> </span><span style="color: Blue;">varchar2</span><span style="color: Olive;">(</span><span style="color: Maroon;">20</span><span style="color: Olive;">)</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">4</span><span style="color: Gray;">&nbsp; </span><span style="color: #00008b;">c</span><span style="color: Gray;"> </span><span style="color: Green;">date</span><span style="color: Gray;">,<br />&nbsp; </span><span style="color: Maroon;">5</span><span style="color: Gray;">&nbsp; </span><span style="color: Green;">constraint</span><span style="color: Gray;"> </span><span style="color: Blue;">pk_a</span><span style="color: Gray;"> </span><span style="color: Green;">primary</span><span style="color: Gray;"> </span><span style="color: Green;">key</span><span style="color: Olive;">(</span><span style="color: Blue;">a</span><span style="color: Gray;">,</span><span style="color: Blue;">b</span><span style="color: Olive;">))</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">6</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">organization</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">7</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">users</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">8</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">pctthreshold</span><span style="color: Gray;"> </span><span style="color: Maroon;">20</span><span style="color: Gray;"><br />&nbsp; </span><span style="color: Maroon;">9</span><span style="color: Gray;">&nbsp; </span><span style="color: Blue;">including</span><span style="color: Gray;"> </span><span style="color: #00008b;">c</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Maroon;">10</span><span style="color: Gray;">* </span><span style="color: Blue;">overflow</span><span style="color: Gray;"> </span><span style="color: Blue;">tablespace</span><span style="color: Gray;"> </span><span style="color: Blue;">big_tbs</span><span style="color: Gray;"><br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; /<br />&nbsp;<br />表已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>2、keep 在cache中：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: #00008b;">system</span><span style="color: Gray;"> </span><span style="color: Green;">set</span><span style="color: Gray;"> </span><span style="color: Blue;">db_keep_cache_size</span><span style="color: Gray;">=</span><span style="color: Maroon;">20</span><span style="color: #00008b;">m</span><span style="color: Gray;">;<br />&nbsp;<br />系统已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">alter</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">test_iot</span><span style="color: Gray;"> </span><span style="color: Blue;">storage</span><span style="color: Olive;">(</span><span style="color: Blue;">buffer_pool</span><span style="color: Gray;"> </span><span style="color: Blue;">keep</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br />表已更改。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>3、创建bitmap index：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Green;">table</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Gray;"> </span><span style="color: Green;">as</span><span style="color: Gray;"> </span><span style="color: Green;">select</span><span style="color: Gray;"> * </span><span style="color: Green;">from</span><span style="color: Gray;"> </span><span style="color: Blue;">dba_tables</span><span style="color: Gray;">;<br />&nbsp;<br />表已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">bitmap</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"> </span><span style="color: Blue;">idx_bitmap</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Olive;">(</span><span style="color: Blue;">OWNER</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;<br />索引已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>4、创建reverse index：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"> </span><span style="color: Blue;">idx_rev</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Olive;">(</span><span style="color: Blue;">PCT_FREE</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Blue;">reverse</span><span style="color: Gray;">;<br />&nbsp;<br />索引已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>5、创建function base index：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">create</span><span style="color: Gray;"> </span><span style="color: Blue;">index</span><span style="color: Gray;"> </span><span style="color: Blue;">idx_fun</span><span style="color: Gray;"> </span><span style="color: Green;">on</span><span style="color: Gray;"> </span><span style="color: Blue;">t1</span><span style="color: Olive;">(</span><span style="color: Blue;">to_char</span><span style="color: Olive;">(</span><span style="color: Blue;">LAST_ANALYZED</span><span style="color: Gray;">,</span><span style="color: #8b0000;">'</span><span style="color: Red;">yyyy-mm-dd hh24:mi:ss</span><span style="color: #8b0000;">'</span><span style="color: Olive;">))</span><span style="color: Gray;">;<br />&nbsp;<br />索引已创建。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>6、收集统计信息：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">desc</span><span style="color: Gray;"> </span><span style="color: Blue;">dbms_stats</span><span style="color: Gray;"><br />……<br /></span><span style="color: Green;">PROCEDURE</span><span style="color: Gray;"> </span><span style="color: Blue;">GATHER_SCHEMA_STATS</span><span style="color: Gray;"><br />参数名称&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;类型&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 输入/输出默认值?<br />----------------------------</span><span style="color: #ffa500;">-- ----------------------- ------ --------</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">OWNNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">ESTIMATE_PERCENT</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">BLOCK_SAMPLE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">METHOD_OPT</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">DEGREE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GRANULARITY</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Green;">CASCADE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTAB</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: #00008b;">OPTIONS</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">OBJLIST</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">DBMS_STATS</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">OUT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATOWN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">NO_INVALIDATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GATHER_TEMP</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GATHER_FIXED</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTYPE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">FORCE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br /></span><span style="color: Green;">PROCEDURE</span><span style="color: Gray;"> </span><span style="color: Blue;">GATHER_SCHEMA_STATS</span><span style="color: Gray;"><br />参数名称&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;类型&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 输入/输出默认值?<br />----------------------------</span><span style="color: #ffa500;">-- ----------------------- ------ --------</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">OWNNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">ESTIMATE_PERCENT</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">BLOCK_SAMPLE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">METHOD_OPT</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">DEGREE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GRANULARITY</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Green;">CASCADE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTAB</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: #00008b;">OPTIONS</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATOWN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">NO_INVALIDATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GATHER_TEMP</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GATHER_FIXED</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTYPE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">FORCE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br /></span><span style="color: Green;">PROCEDURE</span><span style="color: Gray;"> </span><span style="color: Blue;">GATHER_SYSTEM_STATS</span><span style="color: Gray;"><br />参数名称&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;类型&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 输入/输出默认值?<br />----------------------------</span><span style="color: #ffa500;">-- ----------------------- ------ --------</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GATHERING_MODE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Green;">INTERVAL</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Olive;">(</span><span style="color: Maroon;">38</span><span style="color: Olive;">)</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTAB</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATOWN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br /></span><span style="color: Green;">PROCEDURE</span><span style="color: Gray;"> </span><span style="color: Blue;">GATHER_TABLE_STATS</span><span style="color: Gray;"><br />参数名称&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;类型&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 输入/输出默认值?<br />----------------------------</span><span style="color: #ffa500;">-- ----------------------- ------ --------</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">OWNNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">TABNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">PARTNAME</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">ESTIMATE_PERCENT</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">BLOCK_SAMPLE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">METHOD_OPT</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">DEGREE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #00008b;">NUMBER</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">GRANULARITY</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Green;">CASCADE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTAB</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATID</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATOWN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">NO_INVALIDATE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">STATTYPE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">FORCE</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">BOOLEAN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />……<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">desc</span><span style="color: Gray;"> </span><span style="color: Blue;">dbms_workload_repository</span><span style="color: Gray;"><br />……<br /></span><span style="color: Green;">PROCEDURE</span><span style="color: Gray;"> </span><span style="color: Blue;">CREATE_SNAPSHOT</span><span style="color: Gray;"><br />参数名称&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;类型&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 输入/输出默认值?<br />----------------------------</span><span style="color: #ffa500;">-- ----------------------- ------ --------</span><span style="color: Gray;"><br />&nbsp;</span><span style="color: Blue;">FLUSH_LEVEL</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Blue;">VARCHAR2</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Green;">IN</span><span style="color: Gray;">&nbsp; &nbsp; &nbsp;</span><span style="color: Green;">DEFAULT</span><span style="color: Gray;"><br />……<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt; </span><span style="color: Green;">exec</span><span style="color: Gray;"> </span><span style="color: Blue;">DBMS_WORKLOAD_REPOSITORY</span><span style="color: Gray;">.</span><span style="color: Blue;">CREATE_SNAPSHOT</span><span style="color: Gray;">;<br />&nbsp;<br /></span><span style="color: Blue;">PL</span><span style="color: Gray;">/</span><span style="color: Green;">SQL</span><span style="color: Gray;"> 过程已成功完成。<br />&nbsp;<br /></span><span style="color: Green;">SQL</span><span style="color: Gray;">&gt;</span></div></div>
<p>section 7:部署Oracle RAC数据库，相关文章见：<a href="http://www.oracleblog.cn/study-note/install-rac/">《ocm考试-rac安装》</a></p>
<p>sectoin 8:部署dataguard数据库 ，相关文章见：<a href="http://www.oracleblog.cn/study-note/install-dg-for-ocm/">《OCM考试-DG安装》</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/study-note/ocm-exam-summary-one/feed/</wfw:commentRss>
		</item>
		<item>
		<title>我们不是不够skill，我们只是have no time</title>
		<link>http://www.oracleblog.cn/its-my-life/we-are-not-skillless-but-have-no-time/</link>
		<comments>http://www.oracleblog.cn/its-my-life/we-are-not-skillless-but-have-no-time/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 18:32:48 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[It's my life]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1126</guid>
		<description><![CDATA[    这篇文章不是关于技术的，而是关于工作的一些思考。
    起因是这样的，5月底6月初开始，某个客户上海的项目遭遇客户抱怨，SDM异常紧张，现场的PM压力也非常大，召集各个team频繁会议，... ]]></description>
			<content:encoded><![CDATA[<p>    这篇文章不是关于技术的，而是关于工作的一些思考。</p>
<p>    起因是这样的，5月底6月初开始，某个客户上海的项目遭遇客户抱怨，SDM异常紧张，现场的PM压力也非常大，召集各个team频繁会议，最终在网络工程师的努力下，发现系统变慢是由于某个感染病毒的客户端连接上来，造成了应用服务器的cpu消耗过高，当隔离该客户端之后，问题就解决了。</p>
<p>    问题解决后，客户要求提供相关的文档，说明解决思路和日后的处理方法。ok，这也没问题，客户的要求很合理，考虑也很周到，因为万一相关人员离职了，后续的工作谁来做，没有文档记录，每个人有每个人的处理方法，就没有了标准的作业流程。于是，大家就是忙着准备各自领域内的操作文档。</p>
<p>    本来，事情应该告一段落，但是又跳出一个架构的项目经理，说数据库也存在性能问题，列举了几条performance issue。我不太清楚当初的这几条performance issue是怎么提交上去的，首先说说这几条issue，从我的观点看，表空间的大小调整，死锁的发生，还有数据的加载时间段——这些，其实应该算是一个troubleshooting的问题，而不是放到performance tunning来做。所以，第一，问题的引入就不是非常的恰当。因为performance tunning，必须是有一个明确的问题和目标，比如，cpu idle过小，内存使用率过高，应用的某个模块执行过慢。通过tunning，我系统cpu idle达到多少，内存使用率降低到多少，应用模块执行在多少秒内完成，等等。有了具体的目标，我们才能针对目标进行tunning。而不是说你去查一下数据库中的parameter，看看有没有设置不合理的，我们调整这些参数来改变数据库。tunning的第一步，就是应该设立一个明确的问题和目标。</p>
<p>    当确立tunning目标之后，开始tunning。就tunning的工作来说，这是一个没有尽头的工作，谁也无法说，我将这个tunning的工作做到了极致了，已经没有可以再优化的东西了。正确的tunning，应该是根据之前确立的目标，一旦到达这个目标，后续的事情就应该停止了。而在这个案例中，系统的瓶颈不是出在数据库，而是一个感染病毒的客户端，查出问题，解决问题，ok，tunning就应该到此为止。</p>
<p>    退一步讲，如果数据库确实存在问题，而且客户提出了tunning要求，ok，那么dba进行介入。这里就涉及到一个用人的问题。我向来的观点是：用人不疑，疑人不用。但是在我收到邀请我参加performance issue meeting之后，我得知还有一个北京的DBA会来参与这个tunning。本来，多一个人，多一种思路，大家集思广益，观点和思想互相交锋，这是有好处的。但是当我了解到，这是因为上面的领导觉得我们team不够skill去做这个事情，特地的从北京的team要了一个dba来临时帮忙cover这个事情，我就觉得非常的气愤了。</p>
<p>    我们不是不够skill，我们只是have no time。进入IBM之后，我就发现大家的工作量非常的饱和，当然，这个工作量不仅仅是在处理事情上，也有很大的一部分时间，是在会议上，在写报告上，在参加公司政策的培训上，在对流程的熟悉上，在不断的填写自己的个人信息个人计划个人目标个人总结上，在不断的create change，approve change和做change上（当然很多change不是在上班时间做，很多change是在下班时间做，连alter tablespace add datafile这样的常规维护操作，也要安排到晚上，也有人会跑过来问你这个操作有没有在测试环境上做过——虽然可能他也不知道我们有没有测试环境）。在team中，似乎流行着一种心态，就是我加班你不加班，我就嫉妒你，你应该留下来陪我们一起加班。这本来就是一种不正常的心态，之前在推上听过一句话，不希望别人幸福的人，自己永远得不到幸福。由于这种变态的加班心理存在，感觉每次上班的心情和上坟差不多了。但是，为什么会有这样的心态产生呢？说到底，还是工作量的缘故。从数据库的数量上来说，我们已经接近快500个instance了，但是维护的人员只有4个。IBM的库虽然都不大，也就几十百来G，但是由于数量多，出问题的概率就大了。而且不仅仅是出问题，平常的一些简单操作，比如执行某个应用的脚本，也需要dba，这就造成了dba在整个系统中充当的角色，是个消防员。</p>
<p>    在进一步想一下，是什么造成了我们这么大的工作量？是近500台db吗？其实不是，500台的db，如果一开始的架构做的好，就完全不会有那么多的麻烦。在我接触到的这个项目中，一台sever上多个instance比比皆是，某项目一台server上有24个instance，另外还有生产库和测试库混杂在一起，oltp和dss混杂在一起。作为一开始的架构，db服务器就应该是一个专用的机器，一般情况下，都是可以一个instance里面多个schema来解决，如果真的不行，需要分离，那么比如像上面说一台server上24个db，可以采用intel的虚拟化技术，通过建立多个虚拟机来实现。操蛋的架构，导致了后续维护成本的升高。</p>
<p>    除了架构，还有什么？除了架构，还是架构！不过这个架个不是系统的架构，而是项目管理的架构。这个项目中的哪个项目经理是老大？我该听谁的话，我该对谁负责？PM M？PM L？还是PM J？每一个都会蹦出来邀请我参加会议，会议完之后一堆任务。项目管理架构的混乱，导致人员疲于准备会议、参加会议、总结会议、完成会议的任务、汇报任务的情况、最后在召开会议大家一起回顾。</p>
<p>    除了架构，还有什么？除了架构，还是架构！不过这个架个不是系统的架构，而是人员的架构。由于在外企，人们都是被摁在一个框一个框之内，接触到的东西就只有眼前的那么一点，要站在整体的角度去看问题，就非常困难，成本很高。很多情况下，会出现这样的问题：客户抱怨说系统慢的不行了，然后应用检查说没问题，网络检查说没问题，主机检查说没问题，数据库检查说没问题，中间件检查说没问题。那么既然大家都没问题，为什么客户那边就发生了问题？那是因为大家都只盯着眼前的一块，没有站在高处去看这个问题，没有一个能掌控整个架构的人出现。</p>
<p>    作为一个dba，应该有整体运维的思维，而不仅仅局限在db上的一点。从开始的容量预估，架构设计，高可用方案设计，容灾设计，备份设计，集成部署，到中间的日常维护，监控（监控数据库、监控集群情况、监控网络、监控备份、监控主机三驾马车：cpu、内存、io），从监控的数据得到性能的基线和波动曲线，了解业务的峰值和空闲时间，定期的巡检，还有性能优化，到后来，还要关注补丁计划，迁移计划，版本升级计划，以及容灾演练的操作……</p>
<p>    回到之前的那个performance issue，其实我挺佩服北京的dba那哥们，他确实是一个很不错的dba，站的角度也很高，从主机参数到磁盘IO各项性能指标都进行询问。另外，我们深圳dba team的内部也对这个case进行了讨论，在讨论中，大家都对该issue发表了很有针对性的看法，Dean、Rainny都是一等一的好手，我觉得我们的team完全有实力去解决这个问题！我不知道为什么在我接手之前，上面的领导会觉得我们team不够skill。我只是觉得：我们不是不够skill，我们只是have no time——no time到没有生活（同事去东部华侨城玩的时候还背着笔记本电脑），no time到没有自我提升（晚上做完change回到家基本可以洗洗睡了，不用看什么书了），no time到没有改进（工作就是让你去完成的，你想改进，连个测试的时间都没有），no time到没有思考（我们的这种状态正常吗？需要反思吗？需要改进吗？什么是我们的追求？）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/its-my-life/we-are-not-skillless-but-have-no-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>工作中遇到的一些小技巧</title>
		<link>http://www.oracleblog.cn/working-case/some-skill-of-working/</link>
		<comments>http://www.oracleblog.cn/working-case/some-skill-of-working/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 14:46:39 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[..experience]]></category>

		<category><![CDATA[Working case]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1102</guid>
		<description><![CDATA[最近的工作中总结了一些小技巧，利用这些小技巧，可以在平时的工作中促进效率，但是其实这些小技巧说实在话，还是对数据库的安全性有一定的影响。
1.在9i中，或者说在8i，9i，10gR1中，dbl... ]]></description>
			<content:encoded><![CDATA[<p>最近的工作中总结了一些小技巧，利用这些小技巧，可以在平时的工作中促进效率，但是其实这些小技巧说实在话，还是对数据库的安全性有一定的影响。<br />
1.在9i中，或者说在8i，9i，10gR1中，dblink的用户密码被以明文的形式保留在link$表中：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">test@ORADG(192.168.190.241)&gt; create database link to_oralocal connect to test identified by test using 'oralocal';<br />&nbsp;<br />Database link created.<br />&nbsp;<br />Elapsed: 00:00:00.93<br />test@ORADG(192.168.190.241)&gt; <br />test@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; l<br />&nbsp; 1* select userid,password,host from link$<br />sys@ORADG(192.168.190.241)&gt; /<br />&nbsp;<br />USERID&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PASSWORD&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HOST<br />-------------------- ------------------------------------------------------------ --------------------<br />TEST&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TEST&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oralocal<br />&nbsp;<br />Elapsed: 00:00:00.09<br />sys@ORADG(192.168.190.241)&gt;</span></div></div>
<p>2.没有用户密码，用dba用户也可以直接操作该用户的表。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">sys@ORADG(192.168.190.241)&gt; sys@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; create table test.tb_test tablespace tools as select * from dba_users;<br />&nbsp;<br />Table created.<br />&nbsp;<br />Elapsed: 00:00:02.66<br />sys@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; desc tb_test<br />ERROR:<br />ORA-04043: object tb_test does not exist<br />&nbsp;<br />&nbsp;<br />sys@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; alter session set current_schema=test;<br />&nbsp;<br />Session altered.<br />&nbsp;<br />Elapsed: 00:00:00.04<br />sys@ORADG(192.168.190.241)&gt; <br />sys@ORADG(192.168.190.241)&gt; desc tb_test<br />&nbsp;Name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Null?&nbsp; &nbsp; Type<br />&nbsp;----------------------------------------------------- -------- ------------------------------------<br />&nbsp;USERNAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL VARCHAR2(30)<br />&nbsp;USER_ID&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NOT NULL NUMBER<br />&nbsp;PASSWORD&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;VARCHAR2(30)<br />&nbsp;ACCOUNT_STATUS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL VARCHAR2(32)<br />&nbsp;LOCK_DATE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DATE<br />&nbsp;EXPIRY_DATE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DATE<br />&nbsp;DEFAULT_TABLESPACE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL VARCHAR2(30)<br />&nbsp;TEMPORARY_TABLESPACE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL VARCHAR2(30)<br />&nbsp;CREATED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NOT NULL DATE<br />&nbsp;PROFILE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NOT NULL VARCHAR2(30)<br />&nbsp;INITIAL_RSRC_CONSUMER_GROUP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VARCHAR2(30)<br />&nbsp;EXTERNAL_NAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VARCHAR2(4000)<br />&nbsp;<br />sys@ORADG(192.168.190.241)&gt;</span></div></div>
<p>这个操作比较适合不想建synonym只是临时用来对数据的操作上。注意alter session之后，是否对schema的表有操作权限取决于你之前登录的用户，之前登录的用户需要对当前schema的用户的表有操作权限。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/working-case/some-skill-of-working/feed/</wfw:commentRss>
		</item>
		<item>
		<title>exp full报错SYS.DBMS_DEFER_IMPORT_INTERNAL</title>
		<link>http://www.oracleblog.cn/working-case/exp-full-cause-dbms_defer_import_internal/</link>
		<comments>http://www.oracleblog.cn/working-case/exp-full-cause-dbms_defer_import_internal/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 13:07:16 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[..experience]]></category>

		<category><![CDATA[Working case]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1098</guid>
		<description><![CDATA[今天在进行一个全库exp的导出的时候，遇到一个报错：
EXP-00008: ORACLE error 6550 encounteredORA-06550: line 1, column 18:PLS-00201: identifier 'SYS.DBMS_DEFER_IMPORT_INTERNAL' must be declaredORA-06550: line 1, column 7:PL/SQL: State... ]]></description>
			<content:encoded><![CDATA[<p>今天在进行一个全库exp的导出的时候，遇到一个报错：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">EXP-00008: ORACLE error 6550 encountered<br />ORA-06550: line 1, column 18:<br />PLS-00201: identifier 'SYS.DBMS_DEFER_IMPORT_INTERNAL' must be declared<br />ORA-06550: line 1, column 7:<br />PL/SQL: Statement ignored<br />ORA-06512: at &quot;SYS.DBMS_SYS_SQL&quot;, line 1120<br />ORA-06512: at &quot;SYS.DBMS_SQL&quot;, line 323<br />ORA-06512: at &quot;SYS.DBMS_EXPORT_EXTENSION&quot;, line 97<br />ORA-06512: at &quot;SYS.DBMS_EXPORT_EXTENSION&quot;, line 126<br />ORA-06512: at line 1<br />. . exporting table&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DEF$_AQERROR<br />EXP-00008: ORACLE error 6510 encountered<br />ORA-06510: PL/SQL: unhandled user-defined exception<br />ORA-06512: at &quot;SYS.DBMS_EXPORT_EXTENSION&quot;, line 50<br />ORA-06512: at &quot;SYS.DBMS_EXPORT_EXTENSION&quot;, line 126<br />ORA-06512: at line 1</span></div></div>
<p>这个库是在aix的上一个9208的库，前段时间刚刚打了CPUApr2010。应该来说，做全库导出，是不会有这样的报错的，做全库导出的用户也给了connect，resource，dba的权限。全库导入的话，可能会遇到system用户中唯一性约束的问题，但是全库导出不应该有报错。</p>
<p>查询了metalink，发现原来是和CPU的patch有关，在打过9208上的Oct07 CPU时就会有这个报错（ID 465018.1）：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">Cause<br />Problem with the permissions caused by applying the Oct 07 CPU patch.<br />&nbsp;<br />Export is failing after applying the Oct 07 CPU patch however it was working earlier .Rolling back the patch make the export works properly.<br />&nbsp;<br />So seems the permissions associated with export are corrupted.<br />Solution<br />&nbsp;<br />&nbsp;<br />Grant the FULL_EXP_DATABASE,EXECUTE ON SYS.DBMS_DEFER_IMPORT_INTERNAL to the user performing the export by running the following two SQL commands :<br />&nbsp;<br />SQL&gt;GRANT EXP_FULL_DATABASE TO </span><span style="color: Olive;">&lt;</span><span style="color: Green;">USER</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">;<br />SQL&gt;GRANT EXECUTE ON SYS.DBMS_DEFER_IMPORT_INTERNAL TO </span><span style="color: Olive;">&lt;</span><span style="color: Green;">USER</span><span style="color: Olive;">&gt;</span></div></div>
<p>在按照metalink的指示进行grant之后，果然没有报错了。我很怀疑这个报错也是在应用了CPUAri2010引起的。其实我的观点是，没有遇到bug，还是不要打补丁，不会触发新的bug，也省事。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/working-case/exp-full-cause-dbms_defer_import_internal/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OCM考试-DG安装</title>
		<link>http://www.oracleblog.cn/study-note/install-dg-for-ocm/</link>
		<comments>http://www.oracleblog.cn/study-note/install-dg-for-ocm/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:16:51 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[Study note]]></category>

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

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1083</guid>
		<description><![CDATA[在ocm的考试中，dg的安装本来是件很容易的事情，因为grid control安装完成后，只要一路next下去就可以完成安装。不过也有可能运气比较衰的时候，像我，在虚拟机的安装过程中，总是报错：

同... ]]></description>
			<content:encoded><![CDATA[<p>在ocm的考试中，dg的安装本来是件很容易的事情，因为grid control安装完成后，只要一路next下去就可以完成安装。不过也有可能运气比较衰的时候，像我，在虚拟机的安装过程中，总是报错：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage13.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage13.jpg" alt="" title="spximage13" width="500" height="283" class="aligncenter size-full wp-image-1094" /></a></p>
<p>同时，在gc的$ORACLE_BASE/OracleHomes/oms10g/sysman/log/中看到：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">2010-07-16 10:52:01,679 [EMUI_10_52_01_/console/database/dataguard/create] ERROR jobs.dbclone checkSetFileError.77 - DatabaseFileAttributes.checkSetFileError(): Null database file!<br />2010-07-16 10:52:01,680 [EMUI_10_52_01_/console/database/dataguard/create] ERROR jobs.dbclone setControlfiles.158 - DatabaseFileAttributes.setDatafiles(): Invalid control file!<br />2010-07-16 10:52:01,752 [EMUI_10_52_01_/console/database/dataguard/create] ERROR jobs.dbclone getControlFileNames.614 - DatabaseFileAttributes.getDatafileNames(): null datafile names!<br />……<br />2010-07-16 10:58:42,011 [Thread-25] ERROR jobs.dbclone getFileFromEMD.858 - DBCloneVerify.getFileFromEMD(): Exception: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora: java.io.IOException: No space left on device<br />2010-07-16 10:58:42,014 [Thread-25] ERROR jobs.dbclone updateNetworkConfigFiles.1180 - DBCloneObject.updateNetworkConfigFiles(): Exception: java.lang.Exception: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora: java.io.IOException: No space left on device<br />2010-07-16 10:58:44,557 [EMUI_10_58_44_/console/database/dataguard/create] ERROR em.dataguard onEvent.1038 - CreateConfigController: Exception: oracle.sysman.db.dg.util.VxxStandbyException: /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora: java.io.IOException: No space left on device</span></div></div>
<p>查询metalink似乎是个bug（Bug 7342584），于是，从最简单的角度出发，我觉得手工建dg。</p>
<p>手工建dg的方式也比较简单。对于考试的库，由于比较小，我们可以用hot backup的方式也进行复制。以下是操作的方式：</p>
<p>1.由于我们的主库（ocmdb）和备库（dg2）都是在同一的机器上（奇数机），因此，有几个convert的参数需要配置，结合其他要调整的参数，在这里，我在主库上改了如下几个参数：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">alter system set fal_client=dg2 scope=spfile;<br />alter system set fal_server=ocmdb scope=spfile;<br />&nbsp;<br />alter system set log_archive_dest='' scope=spfile;<br />alter system set log_archive_dest_1='LOCATION=/oracle/app/oracle/arch/ocmdb' scope=spfile;<br />alter system set log_archive_dest_2='SERVICE=dg2_site1 optional' scope=spfile;<br />&nbsp;<br />alter system set standby_archive_dest='/oracle/app/oracle/arch/dg2' scope=spfile;<br />alter system set standby_file_management=auto scope=both;<br />&nbsp;<br />alter system set db_file_name_convert='/oracle/app/oracle/oradata/ocmdb/dfile', '/oracle/app/oracle/oradata/dg2/dfile';<br />alter system set log_file_name_convert='/oracle/app/oracle/oradata/ocmdb/lfile','/oracle/app/oracle/oradata/dg2/lfile';</span></div></div>
<p>将以上参数create pfile from spfile。</p>
<p>2.将pfile rename成initdg2.ora，同时修改下面几行：<br />
*.db_name=&#8217;ocmdb&#8217;<br />
*.db_unique_name=ocmdb_site1<br />
*.instance_name=&#8217;dg2&#8242;<br />
再修改控制文件的名字<br />
生成备库的密码文件，然后用该pfile启动备库到nomount状态。</p>
<p>3.配置tnsnames.ora，在里面添加备库的信息。</p>
<p>4.在备库alter system register，使得备库在主库能动态注册。</p>
<p>5.在主库做几次checkpoint，检查scn是否一致：select CHECKPOINT_CHANGE#,CONTROLFILE_CHANGE# from v$database;和select distinct CHECKPOINT_CHANGE# from v$datafile_header;。再运行alter database begin backup。</p>
<p>6.alter database create standby controlfile as &#8216;某路径&#8217;;</p>
<p>7.将控制文件复制到对应的路径，将数据文件、日志文件复制到对应路径。</p>
<p>8.启动备库，alter database mount standby database;alter database recover managed standby database disconnect from session;</p>
<p>9.检查RFS服务是否对日志的传送情况和mrp进程是否apply了传送的日志。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/study-note/install-dg-for-ocm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>远去了，2010年的那场嗡嗡祖拉。</title>
		<link>http://www.oracleblog.cn/its-my-life/goodbye-2010-world-cpu/</link>
		<comments>http://www.oracleblog.cn/its-my-life/goodbye-2010-world-cpu/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 13:49:33 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[It's my life]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1087</guid>
		<description><![CDATA[
    作为一个球迷，能看世界杯的比赛是一件很幸福的事情；而更幸福的事情，就是把老婆也带成一个球迷，一起看球。
    在若干年后，你可能不记得有一届世界杯是在南非举行了，但是说到2... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/4783801359_ce13b8e7bf_b.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/4783801359_ce13b8e7bf_b.jpg" alt="" title="西班牙捧杯" width="500" height="375" class="aligncenter size-full wp-image-1089" /></a></p>
<p>    作为一个球迷，能看世界杯的比赛是一件很幸福的事情；而更幸福的事情，就是把老婆也带成一个球迷，一起看球。</p>
<p>    在若干年后，你可能不记得有一届世界杯是在南非举行了，但是说到2010年夏天的那场嗡嗡祖拉，你肯定记忆犹新。像马蜂般的嗡嗡祖拉，像苍蝇般的嗡嗡祖拉，驱赶狒狒的嗡嗡祖拉，让人崩溃的嗡嗡祖拉，出口转内销的嗡嗡祖拉，韩大嘴吹嗡嗡祖拉。正是这惹人争议的嗡嗡祖拉，造就了南非世界杯独特的印象，在人的记忆深处划下一道深深的痕。</p>
<p>   伴随着嗡嗡祖拉的声音，我和老婆在一个月的时间里，一起看了本次世界杯的好几场比赛，有些是19：30场次，有些是22：00的场次，还有些是半夜2：30熬夜的场次；看了开幕式，看了闭幕式，看了亚洲球队挺进淘汰赛，看了南美球队止步8强，看到了郑大世的眼泪，看到了梅西的灵动，看到了查巴拉拉进球后的舞蹈，看到科维尔的悲情，看到了马拉多纳的可爱，看到了上届世界杯的冠军意大利和亚军法国一起无法小组赛出线，看到了无冕之王荷兰仍然无冕，看到了德国队如行云流水般的进攻：4：1拿下英格兰，4：0狂扫阿根廷，最后却束手束脚0：1不敌西班牙，看到了葡萄牙像打筛子一样7：0狂扫朝鲜，更见识了连猜8场比赛全中的神奇章鱼保罗。</p>
<p>   伴着嗡嗡祖拉的声音，我们一起买了啤酒、鱿鱼丝、绝味鸭脖、豆腐干、酸梅汤、恰恰瓜子，该死的豆干还害得我iphone屏幕进油！伴着嗡嗡祖拉的声音，我们常常在凌晨的那场煮方便面吃；伴着嗡嗡祖拉的声音，老婆学会了什么叫角球，什么叫任意球，什么叫越位；伴着嗡嗡祖拉的声音，我和老婆还在老丈人家和老丈人还有丈母娘一起看了一场球；伴着嗡嗡祖拉的声音，老婆认识了梅西、C罗、卡卡，并且喜欢上了梅西的那个腾讯广告。伴着嗡嗡祖拉的声音，我也离开了卓望到了IBM工作。伴着嗡嗡祖拉的声音，我们在Chinaunix论坛猜球赢积分，虽然开始的时候连猜5场全错，但是后面几场相信章鱼帝，到世界杯结束，老婆略有盈余，我却离持平还差几十积分。</p>
<p>   最后的那场比赛，看完开幕式老婆就忍不住睡意在沙发睡去，到比赛开始前半小时，被我叫醒，擦了把脸嘟着个嘴起来看球，最终再加时赛的时候再次倒下睡去。伪球迷的姿态原形毕露了，哈哈。不过在我的惊呼中：西班牙进球了！老婆再次惊醒，和我一起欢呼，直到最后的西班牙举起大力神杯，老婆一直都是很激动的。</p>
<p>   今晚，世界杯已经结束，嗡嗡祖拉的声音也渐渐远去。不过，2010年那年夏天的事情，将永远的刻在我和老婆的脑海中，我们到时候要讲给我们的小孩听：想当年……</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/its-my-life/goodbye-2010-world-cpu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AIX上升级CPUApr2010</title>
		<link>http://www.oracleblog.cn/working-case/upgrade-cpuapr2010/</link>
		<comments>http://www.oracleblog.cn/working-case/upgrade-cpuapr2010/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 09:36:55 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[..experience]]></category>

		<category><![CDATA[Working case]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1085</guid>
		<description><![CDATA[周末有个加班，需要在一台sever上升级22个instance，数据库从9207升级到9208，在打一个CPUApr2010。在这里简单记录一下升级的过程和经验。
从这个架构来看，这个server上的数据库属于库小且多的类... ]]></description>
			<content:encoded><![CDATA[<p>周末有个加班，需要在一台sever上升级22个instance，数据库从9207升级到9208，在打一个CPUApr2010。在这里简单记录一下升级的过程和经验。</p>
<p>从这个架构来看，这个server上的数据库属于库小且多的类型，虽然每个库都很小，也就几个G，但是数量不少。所以在做9207升级到9208时候，我选择了在升级完oracle软件之后，并发的升级数据字典，来提高效率。同时，由于升级数据字典大部分是sga内的操作，比如编辑，生成数据字典等，为了加快速度，我也将原来100M的shared_pool_size临时的加大了。同时为了保证并发，多个数据库能启动一起跑，也不能加太多。最后找到一个比较平衡的值：sga max size为600M，shared pool size 为200M，java pool为200M，执行catpatch脚本的时候，剩余的物理内存：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">kthr&nbsp; &nbsp; memory&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; page&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; faults&nbsp; &nbsp; &nbsp; &nbsp; cpu&nbsp; &nbsp; <br />----- ----------- ------------------------ ------------ -----------<br />&nbsp;r&nbsp; b&nbsp; &nbsp;avm&nbsp; &nbsp;fre&nbsp; re&nbsp; pi&nbsp; po&nbsp; fr&nbsp; &nbsp;sr&nbsp; cy&nbsp; in&nbsp; &nbsp;sy&nbsp; cs us sy id wa<br />&nbsp;1&nbsp; 0 775970&nbsp; 1154&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 128&nbsp; 406&nbsp; &nbsp;0 283 69513 2820 19&nbsp; 4 73&nbsp; 4<br />&nbsp;1&nbsp; 0 775967&nbsp; 1034&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 321 1508&nbsp; &nbsp;0 265 58798 2322 18&nbsp; 3 71&nbsp; 8<br />&nbsp;2&nbsp; 0 775963&nbsp; 1063&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 386&nbsp; 870&nbsp; &nbsp;0 348 58771 2305 19&nbsp; 9 64&nbsp; 8<br />&nbsp;1&nbsp; 0 776063&nbsp; 1073&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 450&nbsp; 642&nbsp; &nbsp;0 388 68940 2642 21&nbsp; 6 70&nbsp; 4<br />&nbsp;1&nbsp; 0 776064&nbsp; 1684&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 644 1356&nbsp; &nbsp;0 374 64883 3350 20&nbsp; 3 72&nbsp; 4<br />&nbsp;1&nbsp; 0 776058&nbsp; &nbsp;960&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp; 0&nbsp; &nbsp;0 470 51368 4602 18&nbsp; 5 71&nbsp; 6<br />&nbsp;1&nbsp; 1 776056&nbsp; 1196&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 514 1173&nbsp; &nbsp;0 506 44987 4851 18&nbsp; 3 72&nbsp; 7<br />&nbsp;1&nbsp; 0 776039&nbsp; 1102&nbsp; &nbsp;0&nbsp; &nbsp;1&nbsp; &nbsp;0 323&nbsp; 630&nbsp; &nbsp;0 551 41085 5471 18&nbsp; 4 69 10<br />&nbsp;2&nbsp; 0 776040&nbsp; 1024&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 324&nbsp; 696&nbsp; &nbsp;0 476 54143 4648 20&nbsp; 4 72&nbsp; 5<br />&nbsp;2&nbsp; 0 776141&nbsp; 1727&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 772 4029&nbsp; &nbsp;0 452 55381 4149 19&nbsp; 3 72&nbsp; 6<br />&nbsp;1&nbsp; 0 776111&nbsp; 1035&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp; 0&nbsp; &nbsp;0 463 61001 4753 20&nbsp; 6 70&nbsp; 4<br />&nbsp;2&nbsp; 0 776110&nbsp; 1036&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 322 1077&nbsp; &nbsp;0 366 48175 3192 18&nbsp; 2 72&nbsp; 8<br />&nbsp;1&nbsp; 0 776102&nbsp; 1037&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 193 1741&nbsp; &nbsp;0 322 49947 2725 19&nbsp; 2 75&nbsp; 4<br />&nbsp;1&nbsp; 1 776100&nbsp; 1002&nbsp; &nbsp;0&nbsp; &nbsp;0&nbsp; &nbsp;0 129&nbsp; 313&nbsp; &nbsp;0 281 54982 2177 21&nbsp; 2 71&nbsp; 6</span></div></div>
<p>可以看到在2个instance起来后，并且同时跑catpatch脚本的时候，大约剩余的物理内存为4M左右（1000个页面，每个页面4K，因此大约为4M）。至于为什么只启动2个600M sga的库，就把物理内存压的那么死，后面我会进一步分析。</p>
<p>升级9207到9208的过程很顺利，原来估计每个库1小时左右的时间，在执行的时候，也就每个库6，7分钟左右。</p>
<p>升级完后，开始打CPUApr2010的补丁。</p>
<p>在利用opatch apply的时候，报错：<br />
OPatch encounters the following issues during file patching:</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">The following files had problems with being patched:<br />1.&nbsp; &nbsp; &nbsp; /u01/oracle/product/9.2.0/lib/libjox9.a<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[ Couldn't copy /migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/libjox9.a to /u01/oracle/product/9.2.0/lib/libjox9.a from /migr/ora_patch/p9352224_CPUApr2010/9352224. ]<br />&nbsp;<br />Replying 'Y' will terminate the patch installation immediately. It WILL NOT restore any updates that have been performed to this point. It WILL NOT update the inventory.<br />Replying 'N' will update the inventory showing the patch has been applied.<br />NOTE: After replying either 'Y' or 'N' it is critical to review: <br />&nbsp;&nbsp; &nbsp; &nbsp;My Oracle Support Note 312767.1 How to rollback a failed Interim patch installation.<br />Do you want to STOP?<br />Please respond Y|N &gt;</span></div></div>
<p>ok，这是这个patch在read me中说到的issue：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">Issue 3&nbsp; &nbsp;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;When installing the CPUApr2010 using the OPatch utility, you may see the following error:<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;OPatch encounters the following issues during file patching:<br />&nbsp;&nbsp; &nbsp;The following files had problems with being patched:1.&nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">&lt;</span><span style="color: Green;">ORACLE_HOME</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">/lib<br />&nbsp;&nbsp; &nbsp;[ Couldn't copy </span><span style="color: Olive;">&lt;</span><span style="color: Green;">Patch</span><span style="color: Gray;"> </span><span style="color: #00008b;">location</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">/files/lib/libjox9.a to </span><span style="color: Olive;">&lt;</span><span style="color: Green;">ORACL:E_HOME</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">/lib from </span><span style="color: Olive;">&lt;</span><span style="color: Green;">Patch</span><span style="color: Gray;"> </span><span style="color: #00008b;">location</span><span style="color: Olive;">&gt;</span><span style="color: Gray;">. ]<br />&nbsp;<br />&nbsp;<br />&nbsp;&nbsp; &nbsp;Workaround:<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; 1.<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Reply Y to the Do you want to STOP? prompt.<br />&nbsp;&nbsp; &nbsp; &nbsp; 2.<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;As root, run the following command:<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/sbin/slibclean<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; 3.<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rollback the patch using the following command:<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sh $ORACLE_HOME/.patch_storage/123456/rollback_123456.sh <br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(where 123456 is the patch number)<br />&nbsp;&nbsp; &nbsp; &nbsp; 4.<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Apply the patch again.</span></div></div>
<p>于是按照wordround的方式操作，执行slibclean之后，再次执行opatch。没想到，这次报错的是：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">Comparing &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiDataCursorModule.o&quot; and &quot;/u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/ExpressOlapiDataCursorModule.o&quot;<br />&nbsp;&nbsp; &nbsp;Source file name is : /migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiDataCursorModule.o,&nbsp; size is : 59616<br />&nbsp;&nbsp; &nbsp;Destination file name(from OracleHome) is : /u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/ExpressOlapiDataCursorModule.o,&nbsp; size is : 59046<br />&nbsp;&nbsp; Archive failed: failed to update &quot;/u01/oracle/product/9.2.0/lib/liboraolap9.a&quot; with updated &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiDataCursorModule.o&quot;<br />&nbsp;<br />Comparing &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiDataSourceModule.o&quot; and &quot;/u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/ExpressOlapiDataSourceModule.o&quot;<br />&nbsp;&nbsp; &nbsp;Source file name is : /migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiDataSourceModule.o,&nbsp; size is : 148542<br />&nbsp;&nbsp; &nbsp;Destination file name(from OracleHome) is : /u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/ExpressOlapiDataSourceModule.o,&nbsp; size is : 147238<br />&nbsp;&nbsp; Archive failed: failed to update &quot;/u01/oracle/product/9.2.0/lib/liboraolap9.a&quot; with updated &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiDataSourceModule.o&quot;<br />&nbsp;<br />Comparing &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiModule.o&quot; and &quot;/u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/ExpressOlapiModule.o&quot;<br />&nbsp;&nbsp; &nbsp;Source file name is : /migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiModule.o,&nbsp; size is : 706<br />&nbsp;&nbsp; &nbsp;Destination file name(from OracleHome) is : /u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/ExpressOlapiModule.o,&nbsp; size is : 706<br />&nbsp;&nbsp; Archive failed: failed to update &quot;/u01/oracle/product/9.2.0/lib/liboraolap9.a&quot; with updated &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/ExpressOlapiModule.o&quot;<br />&nbsp;<br />Comparing &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/xsoqftbl.o&quot; and &quot;/u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/xsoqftbl.o&quot;<br />&nbsp;&nbsp; &nbsp;Source file name is : /migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/xsoqftbl.o,&nbsp; size is : 46110<br />&nbsp;&nbsp; &nbsp;Destination file name(from OracleHome) is : /u01/oracle/product/9.2.0/.patch_storage/verify/lib/liboraolap9.a/xsoqftbl.o,&nbsp; size is : 46110<br />&nbsp;&nbsp; Archive failed: failed to update &quot;/u01/oracle/product/9.2.0/lib/liboraolap9.a&quot; with updated &quot;/migr/ora_patch/p9352224_CPUApr2010/9352224/files/lib/liboraolap9.a/xsoqftbl.o&quot;<br />There are 56 issues copying files to Oracle Home.<br />There are 14 issues patching Java library in Oracle Home.<br />There are 115 issues patching static library in Oracle Home.<br />FILE PROBLEM: some files are not patched.<br />OPATCH_JAVA_ERROR: Patch was not successfully applied.<br />Verification of the patch failed.<br />&nbsp;<br />ERROR: OPatch failed as verification of the patch failed.<br />[resoprod:oracle:/migr/ora_patch/p9352224_CPUApr2010/9352224:]</span></div></div>
<p>由于用opatch rollback进行回滚，回滚成功，再次进行opatch，还是遇到libjox9.a的报错，再次运行rollback_
<patchid>.sh 脚本，不过此次，不再提示脚本运行成功，而是提示libjox9.a正在被使用，无法回滚：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">./rollback_9352224.sh[905]: System:&nbsp; not found.<br />./rollback_9352224.sh[913]: System:&nbsp; not found.<br />./rollback_9352224.sh[921]: System:&nbsp; not found.<br />./rollback_9352224.sh[929]: System:&nbsp; not found.<br />./rollback_9352224.sh[937]: System:&nbsp; not found.<br />./rollback_9352224.sh[945]: System:&nbsp; not found.<br />./rollback_9352224.sh[953]: System:&nbsp; not found.<br />./rollback_9352224.sh[961]: System:&nbsp; not found.<br />./rollback_9352224.sh[969]: System:&nbsp; not found.<br />./rollback_9352224.sh[977]: System:&nbsp; not found.<br />cp: /u01/oracle/product/9.2.0//lib/libjox9.a: Cannot open or remove a file containing a running program.<br />Rollback completed.<br />[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:]</span></div></div>
<p>用fuser和lsof看，看不出是谁用在这个文件：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:] fuser /u01/oracle/product/9.2.0//lib/libjox9.a<br />/u01/oracle/product/9.2.0//lib/libjox9.a: <br />[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:] <br />[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:] lsof /u01/oracle/product/9.2.0//lib/libjox9.a<br />&nbsp;In while loop:256<br />Value of I :130&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; np:256<br />[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:]</span></div></div>
<p>尝试重命名：<br />
[resoprod:oracle:/u01/oracle/product/9.2.0/.patch_storage/9352224:] mv $OH//lib/libjox9.a $OH//lib/libjox9.a.bak20100710</p>
<p>再次opatch apply，成功！</p>
<p>这里遇到的一个问题，就是在opatch的时候，aix中会有写lib的文件会被占用，虽然在opatch的read me中会建议使用slibclean来清理，但是在实际的使用情况下往往会不适用，最好的方式就是用cp一个同名的，将原来被占用的那个mv成别的名字。再重新opatch。</p>
<p>最后，来说说那个机器的内存使用情况的问题。之前可能你会觉得奇怪，为什么只是启动了2个instance，每个instance的sga max size为600M，2个合计也就1.2G，为什么在执行catpatch的时候，剩余内存会那么少？</p>
<p>这个我在事后检查了主机的参数设置。</p>
<p>我们在数据库升级和patch完之后，恢复到原来sga大小，启动所有的实例，检查机器的剩余内存：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[resoprod:oracle:/home/oracle:] svmon -G<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size&nbsp; &nbsp; &nbsp; &nbsp;inuse&nbsp; &nbsp; &nbsp; &nbsp; free&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pin&nbsp; &nbsp; &nbsp;virtual<br />memory&nbsp; &nbsp; &nbsp; 2621440&nbsp; &nbsp; &nbsp;2617514&nbsp; &nbsp; &nbsp; &nbsp; 3926&nbsp; &nbsp; &nbsp; 196189&nbsp; &nbsp; &nbsp;1565904<br />pg space&nbsp; &nbsp; 2850816&nbsp; &nbsp; &nbsp; 578410<br />&nbsp;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; work&nbsp; &nbsp; &nbsp; &nbsp; pers&nbsp; &nbsp; &nbsp; &nbsp; clnt&nbsp; &nbsp; &nbsp; &nbsp;other<br />pin&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;96974&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0&nbsp; &nbsp; &nbsp; &nbsp;99209<br />in use&nbsp; &nbsp; &nbsp; 1294414&nbsp; &nbsp; &nbsp;1323054&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 46</span></div></div>
<p>剩余内存大约为3926×4k=16M</p>
<p>继续检查内存情况：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[resoprod:root:/home/root:] vmo -a<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cpu_scale_memp = 8<br />&nbsp;data_stagger_interval = 161<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; defps = 1<br />&nbsp;&nbsp; force_relalias_lite = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; framesets = 2<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; htabscale = n/a<br />&nbsp;&nbsp; &nbsp; kernel_heap_psize = 4096<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;kernel_psize = 4096<br />&nbsp; large_page_heap_size = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lgpg_regions = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lgpg_size = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; low_ps_handling = 1<br />&nbsp;&nbsp; &nbsp; &nbsp; lru_file_repage = 1<br />&nbsp;&nbsp; &nbsp; lru_poll_interval = 10<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lrubucket = 131072<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;maxclient% = 80<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxfree = 1088<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxperm = 2010410<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;maxperm% = 80<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;maxpin = 2116994<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxpin% = 80<br />&nbsp;&nbsp; &nbsp; &nbsp; mbuf_heap_psize = 4096<br />&nbsp;&nbsp; &nbsp; &nbsp; memory_affinity = 1<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; memory_frames = 2621440<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; memplace_data = 2<br />&nbsp; memplace_mapped_file = 2<br />memplace_shm_anonymous = 2<br />&nbsp;&nbsp; &nbsp;memplace_shm_named = 2<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;memplace_stack = 2<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; memplace_text = 2<br />memplace_unmapped_file = 2<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mempools = 1<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; minfree = 960<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; minperm = 502602<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;minperm% = 20<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nokilluid = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npskill = 22272<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npsrpgmax = 178176<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npsrpgmin = 133632<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npsscrubmax = 178176<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npsscrubmin = 133632<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; npswarn = 89088<br />&nbsp;&nbsp; &nbsp; &nbsp;num_spec_dataseg = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numpsblks = 2850816<br />&nbsp;&nbsp; &nbsp; page_steal_method = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pagecoloring = n/a<br />&nbsp;&nbsp; &nbsp; &nbsp; pinnable_frames = 2423453<br />&nbsp; psm_timeout_interval = 5000<br />&nbsp;pta_balance_threshold = n/a<br />&nbsp;&nbsp; relalias_percentage = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rpgclean = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rpgcontrol = 2<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scrub = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;scrubclean = 0<br />&nbsp;soft_min_lgpgs_vmpool = 0<br />&nbsp;&nbsp; &nbsp; &nbsp;spec_dataseg_int = 512<br />&nbsp;&nbsp; &nbsp; &nbsp;strict_maxclient = 1<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;strict_maxperm = 0<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v_pinshm = 0<br />&nbsp; vm_modlist_threshold = -1<br />&nbsp;&nbsp; &nbsp; &nbsp; vmm_fork_policy = 1<br />&nbsp;&nbsp; &nbsp;vmm_mpsize_support = 1<br />&nbsp;&nbsp; &nbsp;wlm_memlimit_nonpg = 1<br />[resoprod:root:/home/root:]</span></div></div>
<p>我们看到maxperm为80%。我个人认为，maxperm是用来设置non-computational的分页，（参考<a href="http://www.ibm.com/developerworks/aix/library/au-vmm/">《Overview of AIX page replacement》</a>此文），而non-computational的分页，也就是用于文件系统buffer，一般如果database使用裸设备，不经过文件系统缓存，maxperm可以设置成3%～5%，而对于文件系统做datafile的database，这个值也只要设置成20%～30%左右即可。把太多物理内存用于文件系统buffer，是没有必要的，对于database来说，将数据块从datafile中读取之后，就是在db buffer cache中进行运算了。</p>
<p>并且，在IBM的官方文档中也找到相关的文章也印证我的猜想。可见《<a href="http://www-900.ibm.com/cn/support/viewdoc/detail?DocId=2411083L10000">Oracle 9i在AIX上的性能调整 &#8212; 内存篇</a>》：<br />
在Oracle数据库应用的环境下，可以将MINPERM和MAXPERM分别设为5%和20%甚至更小，从而使内存更多地被用于Oracle的SGA而不是系统的文件缓存。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/working-case/upgrade-cpuapr2010/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ocm考试-rac安装</title>
		<link>http://www.oracleblog.cn/study-note/install-rac/</link>
		<comments>http://www.oracleblog.cn/study-note/install-rac/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 04:36:45 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[Study note]]></category>

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

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1038</guid>
		<description><![CDATA[在ocm考试中，rac数据库是安装在远程的主机上，远程的主机是在美国的服务器上。通过vnc连接，如果你不会vnc，平时用xmanager比较多，就像我一样，还是在考前熟悉一下vnc比较好。
ocm的rac安装... ]]></description>
			<content:encoded><![CDATA[<p>在ocm考试中，rac数据库是安装在远程的主机上，远程的主机是在美国的服务器上。通过vnc连接，如果你不会vnc，平时用xmanager比较多，就像我一样，还是在考前熟悉一下vnc比较好。<br />
ocm的rac安装主要是3点：<br />
1、主机信任机制的配置<br />
2、cluster的安装<br />
3、db软件安装和建库。</p>
<p>我们开始安装:<br />
1、准备工作：<br />
1.1 启动vnc server，其实这一步如果远端没有启动，或有任何vnc连接的问题，都可以向考场老师询问。</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[root@ocmrac1 ~]# vncserver<br />&nbsp;<br />You will require a password to access your desktops.<br />&nbsp;<br />Password: <br />Verify: <br />xauth:&nbsp; creating new authority file /root/.Xauthority<br />&nbsp;<br />New 'ocmrac1:1 (root)' desktop is ocmrac1:1<br />&nbsp;<br />Creating default startup script /root/.vnc/xstartup<br />Starting applications specified in /root/.vnc/xstartup<br />Log file is /root/.vnc/ocmrac1:1.log<br />&nbsp;<br />[root@ocmrac1 ~]# ps -ef |grep vnc<br />root&nbsp; &nbsp; &nbsp; 4461&nbsp; &nbsp; &nbsp;1&nbsp; 4 22:20 pts/1&nbsp; &nbsp; 00:00:00 Xvnc :1 -desktop ocmrac1:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn<br />root&nbsp; &nbsp; &nbsp; 4465&nbsp; &nbsp; &nbsp;1&nbsp; 0 22:20 pts/1&nbsp; &nbsp; 00:00:00 vncconfig -iconic<br />root&nbsp; &nbsp; &nbsp; 4500&nbsp; 4062&nbsp; 0 22:20 pts/1&nbsp; &nbsp; 00:00:00 grep vnc<br />[root@ocmrac1 ~]#</span></div></div>
<p>如果你进去看不到类似xmanager的界面，你可以修改这个文件：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">vi /root/.vnc/xstartup</span></div></div>
<p>将里面的twm &#038; 注释掉，改成gnome-session &#038;：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[root@ocmrac1 ~]# cat /root/.vnc/xstartup<br />#!/bin/sh<br />&nbsp;<br /># Uncomment the following two lines for normal desktop:<br /># unset SESSION_MANAGER<br /># exec /etc/X11/xinit/xinitrc<br />&nbsp;<br />[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<br />[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<br />xsetroot -solid grey<br />vncconfig -iconic &amp;<br />xterm -geometry 80x24+10+10 -ls -title &quot;$VNCDESKTOP Desktop&quot; &amp;<br />#twm &amp;<br />gnome-session &amp;</span></div></div>
<p>然后重启vnc服务：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">service vncserver restart</span></div></div>
<p>ps:培训的时候问了ou的老师，vnc进去只有最简单的terminal界面，也就是twm &#038;的方式。</p>
<p>1.2 检查2台主机裸设备的划分：此时的裸设备需要能在2个主机上都被看到。因此，如果没有划分好裸设备，需要自己划分，就在db01上用fdisk先划分好，划分好的情况如下所示：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[root@ocmrac1 ~]# fdisk -l<br />&nbsp;<br />Disk /dev/sda: 21.4 GB, 21474836480 bytes<br />255 heads, 63 sectors/track, 2610 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />&nbsp;<br />&nbsp;&nbsp; Device Boot&nbsp; &nbsp; &nbsp; Start&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp; &nbsp; &nbsp; Blocks&nbsp; &nbsp;Id&nbsp; System<br />/dev/sda1&nbsp; &nbsp;*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;910&nbsp; &nbsp; &nbsp;7309543+&nbsp; 83&nbsp; Linux<br />/dev/sda2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;911&nbsp; &nbsp; &nbsp; &nbsp; 1170&nbsp; &nbsp; &nbsp;2088450&nbsp; &nbsp;82&nbsp; Linux swap<br />/dev/sda3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1171&nbsp; &nbsp; &nbsp; &nbsp; 2610&nbsp; &nbsp; 11566800&nbsp; &nbsp;83&nbsp; Linux<br />&nbsp;<br />Disk /dev/sdb: 536 MB, 536870912 bytes<br />64 heads, 32 sectors/track, 512 cylinders<br />Units = cylinders of 2048 * 512 = 1048576 bytes<br />&nbsp;<br />&nbsp;&nbsp; Device Boot&nbsp; &nbsp; &nbsp; Start&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp; &nbsp; &nbsp; Blocks&nbsp; &nbsp;Id&nbsp; System<br />/dev/sdb1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;256&nbsp; &nbsp; &nbsp; 262128&nbsp; &nbsp;83&nbsp; Linux<br />/dev/sdb2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;257&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;512&nbsp; &nbsp; &nbsp; 262144&nbsp; &nbsp;83&nbsp; Linux<br />&nbsp;<br />Disk /dev/sdc: 3221 MB, 3221225472 bytes<br />255 heads, 63 sectors/track, 391 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />&nbsp;<br />&nbsp;&nbsp; Device Boot&nbsp; &nbsp; &nbsp; Start&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp; &nbsp; &nbsp; Blocks&nbsp; &nbsp;Id&nbsp; System<br />/dev/sdc1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;391&nbsp; &nbsp; &nbsp;3140676&nbsp; &nbsp;83&nbsp; Linux<br />&nbsp;<br />Disk /dev/sdd: 3221 MB, 3221225472 bytes<br />255 heads, 63 sectors/track, 391 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />&nbsp;<br />&nbsp;&nbsp; Device Boot&nbsp; &nbsp; &nbsp; Start&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp; &nbsp; &nbsp; Blocks&nbsp; &nbsp;Id&nbsp; System<br />/dev/sdd1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;391&nbsp; &nbsp; &nbsp;3140676&nbsp; &nbsp;83&nbsp; Linux<br />&nbsp;<br />Disk /dev/sde: 2147 MB, 2147483648 bytes<br />255 heads, 63 sectors/track, 261 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br />&nbsp;<br />&nbsp;&nbsp; Device Boot&nbsp; &nbsp; &nbsp; Start&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp; &nbsp; &nbsp; Blocks&nbsp; &nbsp;Id&nbsp; System<br />/dev/sde1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;261&nbsp; &nbsp; &nbsp;2096451&nbsp; &nbsp;83&nbsp; Linux<br />[root@ocmrac1 ~]#</span></div></div>
<p>1.3 检查2台主机裸设备的对应情况和启动裸设备的服务：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[root@ocmrac1 ~]# cat /etc/sysconfig/rawdevices<br /># This file and interface are deprecated.<br /># Applications needing raw device access should open regular<br /># block devices with O_DIRECT.<br /># raw device bindings<br /># format:&nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">rawdev</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"> </span><span style="color: Olive;">&lt;</span><span style="color: Green;">major</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"> </span><span style="color: Olive;">&lt;</span><span style="color: Green;">minor</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"><br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">rawdev</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"> </span><span style="color: Olive;">&lt;</span><span style="color: Green;">blockdev</span><span style="color: Olive;">&gt;</span><span style="color: Gray;"><br /># example: /dev/raw/raw1 /dev/sda1<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/raw/raw2 8 5<br />/dev/raw/raw1 /dev/sdc1<br />/dev/raw/raw2 /dev/sdd1<br />/dev/raw/raw3 /dev/sde1<br />/dev/raw/raw4 /dev/sdb1<br />/dev/raw/raw5 /dev/sdb2<br />[root@ocmrac1 ~]# <br />[root@ocmrac1 ~]# service rawdevices restart<br />Assigning devices: <br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/raw/raw1&nbsp; --&gt;&nbsp; &nbsp;/dev/sdc1<br />/dev/raw/raw1:&nbsp; bound to major 8, minor 33<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/raw/raw2&nbsp; --&gt;&nbsp; &nbsp;/dev/sdd1<br />/dev/raw/raw2:&nbsp; bound to major 8, minor 49<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/raw/raw3&nbsp; --&gt;&nbsp; &nbsp;/dev/sde1<br />/dev/raw/raw3:&nbsp; bound to major 8, minor 65<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/raw/raw4&nbsp; --&gt;&nbsp; &nbsp;/dev/sdb1<br />/dev/raw/raw4:&nbsp; bound to major 8, minor 17<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/raw/raw5&nbsp; --&gt;&nbsp; &nbsp;/dev/sdb2<br />/dev/raw/raw5:&nbsp; bound to major 8, minor 18<br />done<br />[root@ocmrac1 ~]#</span></div></div>
<p>1.4 检查2台主机裸设备宿主情况：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[root@ocmrac1 ~]# ls -l /dev/raw/<br />total 0<br />crw-rw----&nbsp; 1 oracle dba 162, 1 Jun&nbsp; 9 10:29 raw1<br />crw-rw----&nbsp; 1 oracle dba 162, 2 Jun&nbsp; 9 10:29 raw2<br />crw-rw----&nbsp; 1 oracle dba 162, 3 Jun&nbsp; 9 10:29 raw3<br />crw-rw----&nbsp; 1 oracle dba 162, 4 Jun&nbsp; 9 10:29 raw4<br />crw-rw----&nbsp; 1 oracle dba 162, 5 Jun&nbsp; 9 10:29 raw5<br />[root@ocmrac1 ~]#</span></div></div>
<p>1.5 配置主机间信任关系：<br />
1.5.1 检查2个机器oracle的home目录权限是否为755：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">[root@ocmrac2 home]# ll<br />total 8<br />drwxr-xr-x&nbsp; 3 oracle dba 4096 Jun&nbsp; 9 11:49 oracle</span></div></div>
<p>1.5.2 生产rsa和dsa的私有key和public key：<br />
在rac1：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac1-&gt; ssh-keygen -t rsa<br />Generating public/private rsa key pair.<br />Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa): <br />Enter passphrase (empty for no passphrase): <br />Enter same passphrase again: <br />Your identification has been saved in /export/home/oracle/.ssh/id_rsa.<br />Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.<br />The key fingerprint is:<br />95:23:e0:f1:64:9c:97:cf:42:e2:ca:40:73:ce:98:45 oracle@ocmrac1<br />ocmrac1-&gt; <br />&nbsp;<br />ocmrac1-&gt; ssh-keygen -t dsa<br />Generating public/private dsa key pair.<br />Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa): <br />Enter passphrase (empty for no passphrase): <br />Enter same passphrase again: <br />Your identification has been saved in /export/home/oracle/.ssh/id_dsa.<br />Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.<br />The key fingerprint is:<br />79:80:99:f7:fb:b4:db:e9:89:7c:4b:f2:cc:37:36:87 oracle@ocmrac1<br />ocmrac1-&gt;</span></div></div>
<p>在rac2上：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac2-&gt; ssh-keygen -t rsa<br />Generating public/private rsa key pair.<br />Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa): <br />Enter passphrase (empty for no passphrase): <br />Enter same passphrase again: <br />Your identification has been saved in /export/home/oracle/.ssh/id_rsa.<br />Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.<br />The key fingerprint is:<br />90:04:2e:46:c1:14:36:1c:84:b1:69:88:ae:ae:9c:86 oracle@ocmrac2<br />ocmrac2-&gt; <br />ocmrac2-&gt; <br />ocmrac2-&gt; <br />ocmrac2-&gt; ssh-keygen -t dsa<br />Generating public/private dsa key pair.<br />Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa): <br />Enter passphrase (empty for no passphrase): <br />Enter same passphrase again: <br />Your identification has been saved in /export/home/oracle/.ssh/id_dsa.<br />Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.<br />The key fingerprint is:<br />1a:20:06:f6:3e:fc:7f:50:38:87:c4:fd:73:8c:7d:bb oracle@ocmrac2<br />ocmrac2-&gt;</span></div></div>
<p>1.5.3 将pub key加入到authorized_keys：<br />
在rac1上：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac1-&gt; cat id_dsa.pub&gt;&gt;authorized_keys<br />ocmrac1-&gt; cat id_rsa.pub&gt;&gt;authorized_keys<br />ocmrac1-&gt; ssh ocmrac2 cat /export/home/oracle/.ssh/id_dsa.pub&gt;&gt;authorized_keys<br />oracle@ocmrac2's password: <br />ocmrac1-&gt; <br />ocmrac1-&gt; <br />ocmrac1-&gt; <br />ocmrac1-&gt; ssh ocmrac2 cat /export/home/oracle/.ssh/id_rsa.pub&gt;&gt;authorized_keys<br />oracle@ocmrac2's password: <br />ocmrac1-&gt;</span></div></div>
<p>在rac2上：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac2-&gt; ssh ocmrac1 cat /export/home/oracle/.ssh/authorized_keys&gt;&gt;authorized_keys<br />The authenticity of host 'ocmrac1 (192.168.190.81)' can't be established.<br />RSA key fingerprint is 69:07:46:e9:80:e6:d7:0f:b0:cb:54:e0:c3:66:39:be.<br />Are you sure you want to continue connecting (yes/no)? yes<br />Warning: Permanently added 'ocmrac1,192.168.190.81' (RSA) to the list of known hosts.<br />ocmrac2-&gt; <br />ocmrac2-&gt;</span></div></div>
<p>1.5.4 测试：<br />
在2台机器上分别：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac1-&gt; ssh localhost date<br />Wed Jun&nbsp; 9 13:20:43 CST 2010<br />ocmrac1-&gt; ssh localhost.oracle.com date<br />Wed Jun&nbsp; 9 13:20:49 CST 2010<br />ocmrac1-&gt; ssh ocmrac1 date<br />Wed Jun&nbsp; 9 13:20:53 CST 2010<br />ocmrac1-&gt; ssh ocmrac1.oracle.com date<br />Wed Jun&nbsp; 9 13:20:59 CST 2010<br />ocmrac1-&gt; ssh ocmrac2 date<br />Wed Jun&nbsp; 9 13:21:04 CST 2010<br />ocmrac1-&gt; ssh ocmrac2.oracle.com date<br />Wed Jun&nbsp; 9 13:21:11 CST 2010<br />ocmrac1-&gt; ssh ocmrac1-priv date<br />Wed Jun&nbsp; 9 13:21:19 CST 2010<br />ocmrac1-&gt; ssh ocmrac1-priv.oracle.com date<br />Wed Jun&nbsp; 9 13:21:26 CST 2010<br />ocmrac1-&gt; ssh ocmrac2-priv date<br />Wed Jun&nbsp; 9 13:21:32 CST 2010 <br />ocmrac1-&gt; ssh ocmrac2-priv.oracle.com date<br />Wed Jun&nbsp; 9 13:27:46 CST 2010</span></div></div>
<p>1.5.5 检查2台机器的网卡是否都工作正常，public的是否配置了default gateway（如果这个不配，在运行完root.sh之后，配置vipca的时候会报错的）。</p>
<p>1.6 运行runInstaller进行安装cluster。</p>
<p>这处主要改成crs_1，默认是db_1<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/06/spximage1.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/06/spximage1.jpg" alt="" title="crs_home" width="500" height="395" class="aligncenter size-full wp-image-1040" /></a></p>
<p>添加一个cluster：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage2.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage2.jpg" alt="" title="spximage2" width="500" height="391" class="aligncenter size-full wp-image-1049" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage3.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage3.jpg" alt="" title="spximage3" width="500" height="390" class="aligncenter size-full wp-image-1050" /></a></p>
<p>修改eth0为public：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage4.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage4.jpg" alt="" title="spximage4" width="500" height="413" class="aligncenter size-full wp-image-1051" /></a></p>
<p>指定orc和votingdisk：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage5.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage5.jpg" alt="" title="spximage5" width="500" height="388" class="aligncenter size-full wp-image-1052" /></a></p>
<p>运行完成后，运行orainstRoot.sh和root.sh注意执行完在节点2会报错vip的问题，我们需要再次vipca，进行配置后才能按ok：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage7.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage7.jpg" alt="" title="spximage7" width="500" height="391" class="aligncenter size-full wp-image-1053" /></a></p>
<p>配置vipca：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage7_b.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage7_b.jpg" alt="" title="spximage7_b" width="500" height="379" class="aligncenter size-full wp-image-1054" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage8.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage8.jpg" alt="" title="spximage8" width="500" height="357" class="aligncenter size-full wp-image-1055" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage9.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage9.jpg" alt="" title="spximage9" width="500" height="371" class="aligncenter size-full wp-image-1056" /></a></p>
<p>最后配置完成：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage10.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage10.jpg" alt="" title="spximage10" width="500" height="399" class="aligncenter size-full wp-image-1057" /></a></p>
<p>1.7 运行runInstaller安装asm：<br />
最好选择一个独立的asm_home:<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage131.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage131.jpg" alt="" title="spximage131" width="500" height="393" class="aligncenter size-full wp-image-1059" /></a><br />
这里提醒下大家，由于指定了一个不同的asm_home，在手工停asm实例的时候，不仅必须export ORACLE_SID为asm是实例名，还要export ORACLE_HOME为你刚刚指定的asm_home。所以其实如果为了考试简单起见，也可以直接用db_1这个asm_home。</p>
<p>继续：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage14.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage14.jpg" alt="" title="spximage14" width="500" height="393" class="aligncenter size-full wp-image-1060" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage15.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage15.jpg" alt="" title="spximage15" width="500" height="393" class="aligncenter size-full wp-image-1061" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage16.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage16.jpg" alt="" title="spximage16" width="500" height="390" class="aligncenter size-full wp-image-1062" /></a></p>
<p>1.8 安装数据库软件：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage21.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage21.jpg" alt="" title="spximage21" width="500" height="391" class="aligncenter size-full wp-image-1063" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage22.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage22.jpg" alt="" title="spximage22" width="500" height="388" class="aligncenter size-full wp-image-1065" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage23.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage23.jpg" alt="" title="spximage23" width="500" height="393" class="aligncenter size-full wp-image-1066" /></a></p>
<p>1.9 安装实例：<br />
1.9.1 先用crs_stat -t 检查一下是否状态正常，没有的话，用crs_stop -all或crs_stop -f/crs_start -all重启一下：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac2-&gt; crs_stat -t<br />Name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Target&nbsp; &nbsp; State&nbsp; &nbsp; &nbsp;Host&nbsp; &nbsp; &nbsp; &nbsp; <br />------------------------------------------------------------<br />ora....SM1.asm application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....C1.lsnr application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....ac1.gsd application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....ac1.ons application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....ac1.vip application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....SM2.asm application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....C2.lsnr application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....ac2.gsd application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....ac2.ons application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....ac2.vip application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ocmrac2-&gt;</span></div></div>
<p>1.9.2 用dbca开始安装：<br />
先在asm上再划一个存储用作一会需要的flash recovery area：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage24.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage24.jpg" alt="" title="spximage24" width="500" height="353" class="aligncenter size-full wp-image-1067" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage25.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage25.jpg" alt="" title="spximage25" width="500" height="354" class="aligncenter size-full wp-image-1068" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage26.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage26.jpg" alt="" title="spximage26" width="500" height="352" class="aligncenter size-full wp-image-1069" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage27.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage27.jpg" alt="" title="spximage27" width="500" height="351" class="aligncenter size-full wp-image-1070" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage28.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage28.jpg" alt="" title="spximage28" width="500" height="409" class="aligncenter size-full wp-image-1071" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage29.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage29.jpg" alt="" title="spximage29" width="500" height="351" class="aligncenter size-full wp-image-1073" /></a></p>
<p>开始创建database：<br />
<a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage30.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage30.jpg" alt="" title="spximage30" width="500" height="352" class="aligncenter size-full wp-image-1074" /></a></p>
<p>后续db instance创建的截图这边就先略了。</p>
<p>以上，rac的安装只是一个很简单的题目，可以说是个送分的题目。rac的考点还是网络的设置：如侦听的设置，tnsnames的设置，service的设置，在考试的时候特别需要注意看清题意再做。</p>
<p>这里介绍一个rac service的增加，以节点1做available和节点2做preferred：</p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage47.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage47.jpg" alt="" title="spximage47" width="500" height="352" class="aligncenter size-full wp-image-1075" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage48.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage48.jpg" alt="" title="spximage48" width="500" height="354" class="aligncenter size-full wp-image-1076" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage49.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage49.jpg" alt="" title="spximage49" width="500" height="351" class="aligncenter size-full wp-image-1077" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage50.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage50.jpg" alt="" title="spximage50" width="500" height="355" class="aligncenter size-full wp-image-1078" /></a></p>
<p><a href="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage51.jpg"><img src="http://www.oracleblog.cn/wp-content/uploads/2010/07/spximage51.jpg" alt="" title="spximage51" width="500" height="355" class="aligncenter size-full wp-image-1079" /></a></p>
<p>检查新建的service的情况：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac2-&gt; crs_stat -t<br />Name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Target&nbsp; &nbsp; State&nbsp; &nbsp; &nbsp;Host&nbsp; &nbsp; &nbsp; &nbsp; <br />------------------------------------------------------------<br />ora.devdb.db&nbsp; &nbsp;application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....b1.inst application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....b2.inst application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....erv1.cs application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....db1.srv application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....SM1.asm application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....C1.lsnr application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....ac1.gsd application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....ac1.ons application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....ac1.vip application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac1&nbsp; &nbsp; &nbsp;<br />ora....SM2.asm application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....C2.lsnr application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....ac2.gsd application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....ac2.ons application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ora....ac2.vip application&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ONLINE&nbsp; &nbsp; ocmrac2&nbsp; &nbsp; &nbsp;<br />ocmrac2-&gt;</span></div></div>
<p>检查在各个节点的情况：<br />
在节点1：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac1-&gt; sqlplus &quot;/ as sysdba&quot;<br />&nbsp;<br />SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jun 19 23:56:03 2010<br />&nbsp;<br />Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<br />&nbsp;<br />&nbsp;<br />Connected to:<br />Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production<br />With the Partitioning, Real Application Clusters, OLAP and Data Mining options<br />&nbsp;<br />SQL&gt; show parameter service<br />&nbsp;<br />NAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TYPE&nbsp; &nbsp; &nbsp; &nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br />service_names&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string&nbsp; &nbsp; &nbsp; devdb, serv1<br />SQL&gt;</span></div></div>
<p>在节点2：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac2-&gt; sqlplus &quot;/ as sysdba&quot;<br />&nbsp;<br />SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jun 19 23:56:20 2010<br />&nbsp;<br />Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<br />&nbsp;<br />&nbsp;<br />Connected to:<br />Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production<br />With the Partitioning, Real Application Clusters, OLAP and Data Mining options<br />&nbsp;<br />SQL&gt; show parameter service<br />&nbsp;<br />NAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TYPE&nbsp; &nbsp; &nbsp; &nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br />service_names&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string&nbsp; &nbsp; &nbsp; devdb<br />SQL&gt;</span></div></div>
<p>测试：<br />
杀掉节点1上的smon进程，此时数据库会自动将service转移到preferred节点：<br />
节点2上：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Gray;">ocmrac2-&gt; sqlplus &quot;/ as sysdba&quot;<br />&nbsp;<br />SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jun 20 00:28:57 2010<br />&nbsp;<br />Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<br />&nbsp;<br />&nbsp;<br />Connected to:<br />Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production<br />With the Partitioning, Real Application Clusters, OLAP and Data Mining options<br />&nbsp;<br />SQL&gt; show parameter service<br />&nbsp;<br />NAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TYPE&nbsp; &nbsp; &nbsp; &nbsp; VALUE<br />------------------------------------ ----------- ------------------------------<br />service_names&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string&nbsp; &nbsp; &nbsp; devdb, serv1</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/study-note/install-rac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>下一站，IBM</title>
		<link>http://www.oracleblog.cn/its-my-life/next-stop-ibm/</link>
		<comments>http://www.oracleblog.cn/its-my-life/next-stop-ibm/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 09:27:56 +0000</pubDate>
		<dc:creator>小荷</dc:creator>
		
		<category><![CDATA[It's my life]]></category>

		<guid isPermaLink="false">http://www.oracleblog.cn/?p=1042</guid>
		<description><![CDATA[    6月的最后一周，我离开了卓望，加入了IBM。
    在卓望，我度过了4年多的时间，在这4年多的时间里面，我从一名刚毕业一年什么都不会的学生，成长为一名合格的oracle dba。不得不说，卓望... ]]></description>
			<content:encoded><![CDATA[<p>    6月的最后一周，我离开了卓望，加入了IBM。</p>
<p>    在卓望，我度过了4年多的时间，在这4年多的时间里面，我从一名刚毕业一年什么都不会的学生，成长为一名合格的oracle dba。不得不说，卓望是个很好的平台，很锻炼人，很有机会，我是卓望培养出来的dba。如果有人想成为一名oracle dba，我会很强烈的推荐他们去卓望这个平台。真的很不错！</p>
<p>    由于个人的原因，我离开了卓望。我快奔三了，趁着还没到30，还有激情，还有动力，还能吃点苦，我想给自己换个环境。获得更多的知识，再锻炼下自己。很偶然的一次机会，IBM选择了我，我也选择了IBM。</p>
<p>    刚来第一周，所有的一切都是新的。新的工牌，新的座位，新的领导，新的同事。甚至于在刚进公司门的时候，还要想想自己的座位是在哪个方位。企业里面推行绅士文化，每周一到四只能穿正装，周五可以穿休闲正装，家里面的牛仔裤基本上就被废掉了。怪不得有人说IBM=Install B Man。不过还好，入职培训的时候，有一位US IBM退休的老前辈，和他交流他说穿polo shirt应该没问题。</p>
<p>    电脑还没领到，一直在走流程，公司大了，流程就很复杂。没办法的事情！</p>
<p>    IBM很多外文三字经，好多都是若干个英文单词的缩写，什么JPI、GCG、KT。本来一直很疑惑这个，幸好老大告诉我个网址可以查：<a href="http://acrobot.almaden.ibm.com/">http://acrobot.almaden.ibm.com/ </a>。呵呵，和老员工混就会有不少好处。</p>
<p>    和同事交流，最近会有一个系统的oracle数据库需要从9207升级到9208。本来很easy的一个case，但是在沟通中发现原来是一个server上有20多个库需要升级！这边不少这样的架构，一个server中装n个库。我估计这可能很IBM的思维有关系，原来一直是用db2，而db2是一个实例下有n个数据库，一个数据库只属于一个实例，但一个实例管n多个数据库。而oracle却不是这样，oracle是一个实例一个库，一个库可以有多个实例，如rac。目前为止我还没发现哪个oracle server上有超过5个库的。对于oracle来说，只需要在一个server中建立一个库，对于不同的应用建立不同的schema就可以了。</p>
<p>    看来，以后的任务任重而道远，改架构容易，改思维却很难。我需要利用我的oracle知识，在ibm传播oracle的思想，注入oracle的文化，架起oracle和ibm之间的桥梁。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oracleblog.cn/its-my-life/next-stop-ibm/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
